Skip to content

Adds parameter lookup function for kinematics plugins - #701

Merged
v4hn merged 4 commits into
moveit:kinetic-develfrom
henningkayser:kinetic-devel_kb-params
Dec 7, 2017
Merged

v4hn merged 4 commits into
moveit:kinetic-develfrom
henningkayser:kinetic-devel_kb-params

Conversation

@henningkayser

Copy link
Copy Markdown
Member

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

henningkayser and others added 2 commits November 30, 2017 17:06
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.
@v4hn

v4hn commented Dec 1, 2017

Copy link
Copy Markdown
Contributor

This is the best solution @henhenhen and I came up with to finally resolve all the linked issues/bugs.
We will have to change the parameter lookup in all common IK plugins, but I guess it's worth the trouble.
We demonstrated it's not much work in our patch for ur_kinematics.

I just ran abi-compliance-checker and it agrees with me in that the change is API/ABI stable.
Thus I would like to port it back to indigo too.

Feedback/Approval @davetcoleman @bmagyar @jrgnicho ?

@davetcoleman davetcoleman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great solution!


/**
* @brief Enables kinematics plugins access to parameters that are defined
* for the 'robot_description_kinematics' namespace.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@henningkayser henningkayser Dec 7, 2017 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we sure we want the ordering of looking for the parameter like this, with group second?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the order should have been like @v4hn mentioned.
Private namespace as the most specific and prior default should be queried first.
Also subgroup should be checked before the group to allow group-wise specifications.

I changed it with commit 53cb470

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.
@henningkayser
henningkayser force-pushed the kinetic-devel_kb-params branch from 45a35c8 to 3614380 Compare December 7, 2017 14:12

@rhaschke rhaschke left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@v4hn
v4hn merged commit 3730d57 into moveit:kinetic-devel Dec 7, 2017
v4hn pushed a commit to v4hn/moveit that referenced this pull request Dec 7, 2017
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.
v4hn added a commit that referenced this pull request Dec 7, 2017
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.
@henningkayser
henningkayser deleted the kinetic-devel_kb-params branch December 8, 2017 11:14
@v4hn v4hn mentioned this pull request Dec 10, 2017
@130s 130s added the Indigo label Dec 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants