The method "setJointPositions" in robot_state is misleading. Due to the "s" at the end one assumes that all joints are set if provided with names and positions. In fact only one joint is set.
The method works, it's only misleading due to the name. Maybe think about removing the last "s", or make it set multiple joints.
Setting position of all joints.
Setting position of just one joint.
Thanks for reporting an issue. Because we're a volunteer community, providing a pull request with suggested changes is always welcomed.
Hi Marc, thanks for the feedback.
For reference, here's the relevant prototypes.
I do understand the confusion. Indeed, there is no overload of the setJointPositions method that touches more than one joint... This can be puzzling for new users for sure.
However, the naming is consistent throughout the class, because the methods can set multiple positions of the same joint (for joints with more than one DoF). There is also the family of setJointGroupPositions which follow the same naming schema.
The method you were looking for would be any overload of setVariablePositions instead.
It probably makes sense to add a sentence on this to the doxygen documentation?
Could you/ whoever noticed this create a pull-request for this?
Resolved by #1921. Again, thanks for reporting @SammyRamone
Most helpful comment
Hi Marc, thanks for the feedback.
For reference, here's the relevant prototypes.
I do understand the confusion. Indeed, there is no overload of the
setJointPositionsmethod that touches more than one joint... This can be puzzling for new users for sure.However, the naming is consistent throughout the class, because the methods can set multiple positions of the same joint (for joints with more than one DoF). There is also the family of
setJointGroupPositionswhich follow the same naming schema.The method you were looking for would be any overload of
setVariablePositionsinstead.It probably makes sense to add a sentence on this to the doxygen documentation?
Could you/ whoever noticed this create a pull-request for this?