Skip to content

Commit 366b7fa

Browse files
committed
Only check end effector collisions for target pose in ComputeIK
1 parent b3b215a commit 366b7fa

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

core/src/stages/compute_ik.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ bool isTargetPoseColliding(const planning_scene::PlanningScenePtr& scene, Eigen:
104104
robot_state.updateCollisionBodyTransforms();
105105

106106
// disable collision checking for parent links (except links fixed to root)
107-
auto& acm = scene->getAllowedCollisionMatrixNonConst();
107+
collision_detection::AllowedCollisionMatrix acm(scene->getAllowedCollisionMatrix());
108108
std::vector<const std::string*> pending_links; // parent link names that might be rigidly connected to root
109109
while (parent) {
110110
pending_links.push_back(&parent->getName());
@@ -119,6 +119,15 @@ bool isTargetPoseColliding(const planning_scene::PlanningScenePtr& scene, Eigen:
119119
}
120120
}
121121

122+
// Remaining pending_links are fixed to root, disable padded scene collisions for this check
123+
if (!pending_links.empty()) {
124+
for (const std::string& object_id : scene->getWorld()->getObjectIds()) {
125+
for (const std::string* name : pending_links) {
126+
acm.setEntry(object_id, *name, true);
127+
}
128+
}
129+
}
130+
122131
// check collision with the world using the padded version
123132
collision_detection::CollisionRequest req;
124133
collision_detection::CollisionResult result;

0 commit comments

Comments
 (0)