Skip to content
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

Support including the names of other attached objects in touch_link (backport #3276) #3288

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions moveit_core/collision_detection_fcl/src/collision_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,30 @@ bool collisionCallback(fcl::CollisionObjectd* o1, fcl::CollisionObjectd* o2, voi
}
}
}

// bodies attached to the same link should not collide
// If one of the attached objects lists the other in touch links set, then collisions are also allowed
if (cd1->type == BodyTypes::ROBOT_ATTACHED && cd2->type == BodyTypes::ROBOT_ATTACHED)
{
if (cd1->ptr.ab->getAttachedLink() == cd2->ptr.ab->getAttachedLink())
{
always_allow_collision = true;
}
else
{
const std::set<std::string>& tl1 = cd1->ptr.ab->getTouchLinks();
const std::set<std::string>& tl2 = cd2->ptr.ab->getTouchLinks();
if (tl1.find(cd2->getID()) != tl1.end() || tl2.find(cd1->getID()) != tl2.end())
{
always_allow_collision = true;
}
}
if (always_allow_collision && cdata->req_->verbose)
{
RCLCPP_DEBUG(getLogger(),
"Attached object '%s' is allowed to touch attached object '%s'. No contacts are computed.",
cd2->getID().c_str(), cd1->getID().c_str());
}
}

// if collisions are always allowed, we are done
Expand Down
Loading