-
Notifications
You must be signed in to change notification settings - Fork 558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix getLinkModelNamesWithCollisionGeometry to include the base link #2660
Conversation
…f the planning group
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2660 +/- ##
==========================================
+ Coverage 51.15% 51.15% +0.01%
==========================================
Files 393 393
Lines 32749 32753 +4
==========================================
+ Hits 16750 16753 +3
- Misses 15999 16000 +1 ☔ View full report in Codecov by Sentry. |
Closes #2325 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me, thanks for fixing it!
@@ -229,6 +229,14 @@ JointModelGroup::JointModelGroup(const std::string& group_name, const srdf::Mode | |||
{ | |||
link_model_map_[link_model->getName()] = link_model; | |||
link_model_name_vector_.push_back(link_model->getName()); | |||
// if this is the first link of the group with a valid parent and includes geometry (for example `base_link`) it should included | |||
if (link_model_with_geometry_vector_.empty() && link_model->getParentLinkModel() && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is the correct approach. There can be more than one discrete subtree in a group, this would only consider the first one.
We discussed a similar issue I observed in moveit/moveit#3570
I think the previous version of the code is correct for is_chain_ == false
(a list of <link> or <joint>
tags in SRDF) but not for the case of <chain>
where the root link is included but not parent joint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh you're right, thanks for pointing that out! Do you think we should revert this change for now or just add a check for is_chain_
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this is getting surprisingly complicated ... is_chain_
is not passed to the constructor but guessed about near the end of the constructor. They might be different things altogether?
According to the code in RobotModel
a chain as specified in SRDF could also go from finger_1_tip
to finger_2_tip
with the root being somewhere in the middle (eg the wrist
).
Maybe a list of links should also get passed in to the constructor.
I'm also not yet sure how this relates to collision checking and what the problem actually was.
Could you please add your SRDF? |
Unfortunately, I don't have access to it |
Here is the SRDF for the Panda arm. Prior to this PR if you were to request the link models with collision geometry |
Good to know that the collision checking failure was caused by workarounds. I tested a bit with a similar setup today (MoveIt1) but couldn't notice anything broken. I think this fix adds regressions if:
And does not fix
Most likely the list of links should be passed into the constructor and the special casing for be done in RobotModel |
Description
I was working on an MTC task a while ago where I was manually modifying the planning scene. In my program I was calling
getLinkModelNamesWithCollisionGeometry()
on theJointModelGroup
to get the links of the manipulator that had collision geometry and noticed that the base link of the group is never included. This caused planning problems like this while I was debugging...To test this change out I modified the moveit2_tutorial
Robot Model and Robot State
where I asked it to print the results ofgetLinkModelNamesWithCollisionGeometry
and with this new change it now includespanda_link0
🥇Very small nitpick but I have also noticed that in Rviz the base link is not highlighted for the goal pose which shows that it is not include in the group when using the motion planning widget.
Checklist