File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
moveit_ros/planning/planning_scene_monitor/src Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -416,13 +416,24 @@ void PlanningSceneMonitor::startPublishingPlanningScene(SceneUpdateType update_t
416
416
const std::string& planning_scene_topic)
417
417
{
418
418
publish_update_types_ = update_type;
419
- if (!publish_planning_scene_ && scene_)
419
+
420
+ if (publish_planning_scene_)
421
+ {
422
+ RCLCPP_INFO (logger_, " Stopping existing planning scene publisher." );
423
+ stopPublishingPlanningScene ();
424
+ }
425
+
426
+ if (scene_)
420
427
{
421
428
planning_scene_publisher_ = pnode_->create_publisher <moveit_msgs::msg::PlanningScene>(planning_scene_topic, 100 );
422
429
RCLCPP_INFO (logger_, " Publishing maintained planning scene on '%s'" , planning_scene_topic.c_str ());
423
430
monitorDiffs (true );
424
431
publish_planning_scene_ = std::make_unique<std::thread>([this ] { scenePublishingThread (); });
425
432
}
433
+ else
434
+ {
435
+ RCLCPP_WARN (logger_, " Did not find a planning scene, so cannot publish it." );
436
+ }
426
437
}
427
438
428
439
void PlanningSceneMonitor::scenePublishingThread ()
You can’t perform that action at this time.
0 commit comments