Skip to content

Commit

Permalink
ModifyPlanningScene: check state for collisions
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaschke committed May 24, 2024
1 parent a8896e4 commit 9c05305
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/src/stages/modify_planning_scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,17 @@ std::pair<InterfaceState, SubTrajectory> ModifyPlanningScene::apply(const Interf

if (callback_)
callback_(scene, properties());

// check for collisions
collision_detection::CollisionRequest req;
collision_detection::CollisionResult res;
req.contacts = true;
req.max_contacts = 1;
scene->checkCollision(req, res);
if (res.collision) {
const auto contact = res.contacts.begin()->second.front();
traj.markAsFailure(contact.body_name_1 + " colliding with " + contact.body_name_2);
}
} catch (const std::exception& e) {
traj.markAsFailure(e.what());
}
Expand Down

0 comments on commit 9c05305

Please sign in to comment.