-
Notifications
You must be signed in to change notification settings - Fork 957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating rviz planning scene when monitored planning scene is locked #3688
Comments
As ever, I'm keen to make a PR to fix this issue, if someone could point me in the right direction for how to approach it. |
Unfortunately not - those PRs fix the current state monitor waiting on the locked planning scene, but they don't fix the planning scene publisher waiting on the locked planning scene. So motions can now execute while planning - the robot moves, the joint state and robot state topics update, and the tf display in rviz updates - but the displayed robot in rviz doesn't update. It feels like |
I wonder if it would be sensible to have the current state monitor publishing its own planning scene, separate from the one monitored by the planning scene monitor? |
I see. I think, planning should not lock the PSM's scene for the whole duration of planning. Rather, it just needs to compute the current scene as a new local variable, which is then used for planning, while the PSM's scene can be updated during planning. To this end, you need to find all locations, where the PSM's scene is locked and fix the code to keep the locking time as short as possible. For example, here (but there might be more locations): moveit/moveit_ros/move_group/src/default_capabilities/move_action_capability.cpp Line 156 in b9ed835
moveit/moveit_ros/move_group/src/default_capabilities/move_action_capability.cpp Line 209 in b9ed835
|
That makes sense, I'll give it a go. Thanks again. |
If there are numerous locations following the same locking scheme, it might be useful to introduce a utility function: planning_scene::PlanningScenePtr getPlanningScene(const PlanningSceneMonitorPtr& psm, const moveit_msgs::PlanningScene& diff)
{
planning_scene_monitor::LockedPlanningSceneRO lscene(psm);
PlanningScenePtr scene = lscene->diff();
lscene.unlock();
if (!moveit::core::isEmpty(diff))
scene->setPlanningSceneDiffMsg(diff);
return scene;
}
|
Description
General description:
I'm not sure if we're configuring moveit and rviz slightly wrong, or if this is an actual problem.
We are setting up rviz with
Planning Scene Topic: /move_group/monitored_planning_scene
to display the robot.We are planning and executing a series of motions, with planning and executing happening in parallel.
When a motion is executing while another motion is planning, the rviz visual of the robot freezes. This happens both when using a real robot, or using a simulated robot entirely run by moveit.
Technical details:
I have tracked the problem back to
PlanningSceneMonitor::scenePublishingThread
, where thescene_update_mutex_
is locked while planning is happening. This blocks the publishing of the planning scene on/move_group/monitored_planning_scene
.Possible solutions:
Your environment
Steps to reproduce
Plan and execute a series of motions, where the planning for subsequent motions happens while previous motions are executing.
Expected behaviour
The rviz visualisation of the robot should follow the executing motion.
Actual behaviour
The rviz visualisation freezes when a motion starts planning.
Backtrace or Console output
Use gist.github.com to copy-paste the console output or segfault backtrace using gdb.
The text was updated successfully, but these errors were encountered: