Repository navigation
Adds parameter lookup function for kinematics plugins - #701
Conversation
Some kinematics plugins rely on certain parameters to be set in the private namespace of their node. Running multiple instances requires each node to be initialized with these parameters which can be very inconvenient in some setups. This commit resolves the issue by enabling plugins to lookup parameters from the namespace 'robot_description_kinematics' so that they can be defined in the kinematics.yaml.
|
This is the best solution @henhenhen and I came up with to finally resolve all the linked issues/bugs. I just ran abi-compliance-checker and it agrees with me in that the change is API/ABI stable. Feedback/Approval @davetcoleman @bmagyar @jrgnicho ? |
|
|
||
| /** | ||
| * @brief Enables kinematics plugins access to parameters that are defined | ||
| * for the 'robot_description_kinematics' namespace. |
There was a problem hiding this comment.
Could you add a comment explaining how it tried to find the param in the root namespace first, then in the group name subgroup second?
There was a problem hiding this comment.
3614380 adds some explanation for the lookup order.
|
|
||
| if (nh.hasParam("robot_description_kinematics/" + group_name_ + "/" + param)) | ||
| { | ||
| val = nh.param("robot_description_kinematics/" + group_name_ + "/" + param, default_val); |
There was a problem hiding this comment.
are we sure we want the ordering of looking for the parameter like this, with group second?
There was a problem hiding this comment.
No I'm not sure. I'm actually surprised to see it this way around now that you mention it...
In my opinion more specific places should go first and the order should be
~robot_description_kinematics/group_name/robot_description_kinematics
@henhenhen could you please update the request (or provide insights that justify the current order)?
Parameters are queried in order of the specified group hierarchy. That is parameters are first searched in the private namespace then in the subroup namespace and finally in the group namespace. This order maintains default behavior by keeping the private namespace as the predominant configuration but also allows groupwise specifications.
45a35c8 to
3614380
Compare
Some kinematics plugins rely on certain parameters to be set in the private namespace of their node. Running multiple instances requires each node to be initialized with these parameters which can be very inconvenient in some setups. This commit resolves the issue by enabling plugins to lookup parameters from the namespace 'robot_description_kinematics' so that they can be defined in the kinematics.yaml.
Some kinematics plugins rely on certain parameters to be set in the private namespace of their node. Running multiple instances requires each node to be initialized with these parameters which can be very inconvenient in some setups. This commit resolves the issue by enabling plugins to lookup parameters from the namespace 'robot_description_kinematics' so that they can be defined in the kinematics.yaml.
Some kinematics plugins access parameters that are defined in the private namespace of their node.
With multiple nodes, each node needs to be initialized with the same parameters which can be
very inconvenient in some setups.
This commit resolves the issue by enabling plugins to query parameters from the
namespace 'robot_description_kinematics' so that they can be defined in the kinematics.yaml either under the corresponding group or directly.
This PR helps to resolve issues with multiple arms and when launching the plugin with rviz and the moveit commander simultaneously (also see here and here), although the plugins will actually have to make use of the new method.
Example:
In our UR5 setup we add a prefix 'ur5_' to each joint name in the robot description.
When using the UR5KinematicsPlugin from ur_kinematics we have to define the parameter 'arm_prefix' at every launch within the private namespace of each node using the kinematics plugin.
With this PR and this minor change in ur_kinematics we just need to set the parameter once inside the kinematics.yaml under the group arm.
@v4hn