diff --git a/moveit_core/planning_scene/src/planning_scene.cpp b/moveit_core/planning_scene/src/planning_scene.cpp index 0b955ac888..8655117fb8 100644 --- a/moveit_core/planning_scene/src/planning_scene.cpp +++ b/moveit_core/planning_scene/src/planning_scene.cpp @@ -212,12 +212,12 @@ PlanningScene::PlanningScene(const PlanningSceneConstPtr& parent) : parent_(pare setStateFeasibilityPredicate(parent->getStateFeasibilityPredicate()); setMotionFeasibilityPredicate(parent->getMotionFeasibilityPredicate()); - setCollisionObjectUpdateCallback(parent_->current_world_object_update_callback_); // maintain a separate world. Copy on write ensures that most of the object // info is shared until it is modified. world_ = std::make_shared(*parent_->world_); world_const_ = world_; + setCollisionObjectUpdateCallback(parent_->current_world_object_update_callback_); // record changes to the world world_diff_ = std::make_shared(world_); @@ -1214,9 +1214,6 @@ void PlanningScene::decoupleParent() (object_types_.value())[it->first] = it->second; } } - - setCollisionObjectUpdateCallback(nullptr); - parent_.reset(); }