ros / joint_state_publisher

http://wiki.ros.org/joint_state_publisher
50 stars 81 forks source link

Incorrect order of joints using ROS Humble #87

Open IvoD1998 opened 1 year ago

IvoD1998 commented 1 year ago

Hello

When trying to use the joint states of the robot for a forward kinematic calculation, we noticed that the order of the joint positions seems to be published incorrectly. It appears that the order of joints is now published as:

(see screenshot below for added clarity)

Screenshot from 2023-02-15 11-50-42

Thank you in advance! Ivo Dekker

clalancette commented 1 year ago

Can you please describe why that is wrong, and how joint_state_publisher is involved here?

IvoD1998 commented 1 year ago

We were wondering why the list of joints as published by the joint state publisher does not match the sequential order they are supposed to be in according to the robot URDF. We tested this with various different robot models and got the same result. It could of course also be an issue on the side of the MoveIt configs for the robots, but we are uncertain.

karanchahal commented 1 year ago

Can I use foxglove to do this ? What do I need to do ?

sloretz commented 1 year ago

It looks like there is an intent to publish the joints in a fixed order:

https://github.com/ros/joint_state_publisher/blob/424fd9e1955fddf38f1b3e1721baf9f6e9322d6b/joint_state_publisher/joint_state_publisher/joint_state_publisher.py#L344

Mind posting a urdf that shows the issue? It might be the change in order came from the urdf parser, as that's where joint_state_publisher gets the order from

https://github.com/ros/joint_state_publisher/blob/424fd9e1955fddf38f1b3e1721baf9f6e9322d6b/joint_state_publisher/joint_state_publisher/joint_state_publisher.py#L87-L98