4141#include < moveit/task_constructor/stage.h>
4242#include < moveit/task_constructor/properties.h>
4343#include < moveit/task_constructor/type_traits.h>
44+ #include < moveit_msgs/CollisionObject.h>
4445#include < map>
4546
4647namespace moveit {
@@ -77,6 +78,10 @@ class ModifyPlanningScene : public PropagatingEitherWay
7778
7879 // / attach or detach a list of objects to the given link
7980 void attachObjects (const Names& objects, const std::string& attach_link, bool attach);
81+ // / Add an object to the planning scene
82+ void addObject (const moveit_msgs::CollisionObject& collision_object);
83+ // / Remove an object from the planning scene
84+ void removeObject (const std::string& object_name);
8085
8186 // / conviency methods accepting a single object name
8287 inline void attachObject (const std::string& object, const std::string& link);
@@ -130,6 +135,8 @@ class ModifyPlanningScene : public PropagatingEitherWay
130135protected:
131136 // list of objects to attach (true) / detach (false) to a given link
132137 std::map<std::string, std::pair<Names, bool >> attach_objects_;
138+ // list of objects to add / remove to the planning scene
139+ std::vector<moveit_msgs::CollisionObject> collision_objects_;
133140
134141 // list of objects to mutually
135142 struct CollisionMatrixPairs
@@ -144,6 +151,7 @@ class ModifyPlanningScene : public PropagatingEitherWay
144151protected:
145152 // apply stored modifications to scene
146153 InterfaceState apply (const InterfaceState& from, bool invert);
154+ void processCollisionObject (planning_scene::PlanningScene& scene, const moveit_msgs::CollisionObject& object);
147155 void attachObjects (planning_scene::PlanningScene& scene, const std::pair<std::string, std::pair<Names, bool >>& pair,
148156 bool invert);
149157 void allowCollisions (planning_scene::PlanningScene& scene, const CollisionMatrixPairs& pairs, bool invert);
0 commit comments