ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Finally I ran into this issue myself and started digging.

The existence of this "stopTrajectory()" function you mentioned makes me think, that the authors of move_arm actually had this situation in mind, but might just forgot to finally use/implement it.

Anyway, I found a good place to make use of this function and now when cancelling move_arm's action goal it in turn also cancels the controller's action goal, which makes my robot stop executing the trajectory. Here is the small patch:

--- a/move_arm/src/move_arm_simple_action.cpp   Thu Jun 28 18:29:21 2012 -0700
+++ b/move_arm/src/move_arm_simple_action.cpp   Thu Sep 27 09:40:43 2012 +0900
@@ -1140,6 +1140,7 @@
         else               //if we've been preempted explicitly we need to shut things down
         {
           ROS_DEBUG("The move arm action was preempted by the action client. Preempting this goal.");
+          stopTrajectory();
           revertPlanningScene();
           resetStateMachine();
           action_server_->setPreempted();

I also sent this patch in via this ticket.