Skip to content

Commit

Permalink
Fix planning_scene_monitor sync when passed empty robot state
Browse files Browse the repository at this point in the history
  • Loading branch information
MarqRazz committed Jan 2, 2025
1 parent c3a2edc commit 06b171f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,10 @@ bool PlanningSceneMonitor::newPlanningSceneMessage(const moveit_msgs::msg::Plann

if (!scene.is_diff && parent_scene_)
{
// if the scene does not contain a robot state then use the latest value from the current_state_monitor_
// so that we are not updating the scene with stale values for the robots state.
if (scene.robot_state.joint_state.name.empty())
parent_scene_->setCurrentState(*current_state_monitor_->getCurrentState());
// clear maintained (diff) scene_ and set the full new scene in parent_scene_ instead
scene_->clearDiffs();
result = parent_scene_->setPlanningSceneMsg(scene);
Expand Down

0 comments on commit 06b171f

Please sign in to comment.