moveit_ros
moveit_ros copied to clipboard
Preemting a move_group goal should interrupt planning
Follow-up of the the preempting planners thread on moveit-users.
The move_group
server should react instantly when a cancel request is issued, even if it's currently busy planning.
In move_group::MoveGroupMoveAction
, planning is executed synchronously with the action server execute callback:
executeMoveCallback(...)
→ executeMoveCallback_Plan*(...)
→ generatePlan(...)
So implementing this feature would require:
- A threading model in which cancel requests are not blocked by a busy goal callback. A possibility would be to defer planning to a worker thread so the goal callback returns immediately.
- When the
MoveGroupMoveAction
receives a cancel request and is currently busy planning, preempt the motion planner using PlanningPipeline::terminate() - Propagate preemption capabilities to the
moveit::planning_interface::MoveGroup
class. The stop() method looks like a good candidate for handling this. It currently stops execution, but its scope could be extended to stop working, be it planning or executing.