How to share a move group for two planning groups?

asked 2019-08-15 10:24:58 -0500

ssnover gravatar image

I'm running an application with Moveit on ROS Melodic where I have two arms that each have their own planning group. What I'm finding is that most of the time this is not a problem and I'm able to plan a motion with each one. This becomes a problem during queued sequences where a single trigger moves both arms to pre-determined locations. This ends up causing a race condition where the arm that sends a goal first gets preempted and the second arm gets to plan (or maybe vice versa).

Is there a way through the action client API to check the state of the move group planning action server? I'd prefer to avoid a situation where an arm tries to replan and then preempts the other arm which just preempted it.

edit retag flag offensive close merge delete

Comments

Currently, a move_group can only handle one planning request at a time. So, unless I'm misunderstanding you, I don't believe what you describe can be solved (if you must plan for each group individually).

You could consider running two move_group instances. Synchronisation of the planning scene should be possible, but I've not done it for full planning scenes.

gvdhoorn gravatar imagegvdhoorn ( 2019-08-17 05:10:48 -0500 )edit

The solution I settled on is to synchronize the two processes with a named semaphore to allow one process exclusive access at a time for planning and then allow the other process to wait on the planner semaphore. I think internally in MoveIt it may be better to "queue" planning request goals and send responses rather than just allowing new requests to preempt.

ssnover gravatar imagessnover ( 2019-08-19 09:47:30 -0500 )edit

I think internally in MoveIt it may be better to "queue" planning request goals and send responses rather than just allowing new requests to preempt.

Queueing can lead to some pretty interesting -- and unexpected -- behaviour.

But in any case: ROS Answers is not the place to post enhancement requests / suggest improvements. The MoveIt issue tracker would be the appropriate place for that.

gvdhoorn gravatar imagegvdhoorn ( 2019-08-19 09:55:08 -0500 )edit