Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The "robot_description" param is just the description of the robot universally (it's loaded from the URDF). The robot model/state does not update automatically, so you're going to be getting back the default joint positions every time because you're just setting it to the default positions. You need to feed in the joint state using kinematic_state->setVariablePositions(...). How you get the joint positions is going to be dependent on your application, but it sounds like you're probably doing a conventional setup where you may be publishing to "joint_states", so you should subscribe to that topic, read the positions in and feed it to the model. The model won't do it for you automatically.

It's a good thing the state doesn't update automatically because it allows us to do things like setting the state to a hypothetical target and testing for things like collisions before actually moving there.