Description
Observed problem:
rviz constantly rebuilds the entire planning scene, rather than just updating joint states. This eats loads of cpu.
Speculative details:
The move group publishes planning scene diffs:
- When
PlanningSceneMonitor::scenePublishingThread publishes diffs with new_scene_update_ == UPDATE_STATE, it strips out msg.robot_state.attached_collision_objects.
- However, it does not strip out
msg.link_padding or msg.link_scale.
rviz subscribes to these planning scene diffs:
- When
PlanningSceneMonitor::newPlanningSceneMessage receives a planning scene diff, it checks if attached_collision_objects, link_padding and link_scale are all empty, and if they aren't it treats the scene update type as UPDATE_SCENE.
- This triggers a complete rebuild in rviz.
Proposed solution:
Change
if (new_scene_update_ == UPDATE_STATE)
{
msg.robot_state.attached_collision_objects.clear();
msg.robot_state.is_diff = true;
}
to
if (new_scene_update_ == UPDATE_STATE)
{
msg.link_padding.clear();
msg.link_scale.clear();
msg.robot_state.attached_collision_objects.clear();
msg.robot_state.is_diff = true;
}
in PlanningSceneMonitor::scenePublishingThread.
Questions:
- Does my analysis of the problem look correct?
- Does this proposed fix look sensible?
- Are there any issues I should be aware of before making this change?
ROS Distro
Jazzy
OS and version
24.04
Source or binary build?
Source
If binary, which release version?
No response
If source, which branch?
Jazzy (Technically a fork of Jazzy, but it looks like this has been an issue on trunk for years)
Which RMW are you using?
CycloneDDS
Steps to Reproduce
Put a print statement in PlanningSceneDisplay::onSceneMonitorReceivedUpdate to see what kind of update_type it is receiving.
Expected behavior
update_state should vary depending on what has changed in the planning scene.
Actual behavior
update_state is always UPDATE_SCENE.
Backtrace or Console output
No response
Description
Observed problem:
rviz constantly rebuilds the entire planning scene, rather than just updating joint states. This eats loads of cpu.
Speculative details:
The move group publishes planning scene diffs:
PlanningSceneMonitor::scenePublishingThreadpublishes diffs withnew_scene_update_ == UPDATE_STATE, it strips outmsg.robot_state.attached_collision_objects.msg.link_paddingormsg.link_scale.rviz subscribes to these planning scene diffs:
PlanningSceneMonitor::newPlanningSceneMessagereceives a planning scene diff, it checks ifattached_collision_objects,link_paddingandlink_scaleare all empty, and if they aren't it treats the scene update type asUPDATE_SCENE.Proposed solution:
Change
to
in
PlanningSceneMonitor::scenePublishingThread.Questions:
ROS Distro
Jazzy
OS and version
24.04
Source or binary build?
Source
If binary, which release version?
No response
If source, which branch?
Jazzy (Technically a fork of Jazzy, but it looks like this has been an issue on trunk for years)
Which RMW are you using?
CycloneDDS
Steps to Reproduce
Put a print statement in
PlanningSceneDisplay::onSceneMonitorReceivedUpdateto see what kind ofupdate_typeit is receiving.Expected behavior
update_stateshould vary depending on what has changed in the planning scene.Actual behavior
update_stateis alwaysUPDATE_SCENE.Backtrace or Console output
No response