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

Revision history [back]

I think it is not a problem of your statemachine but of the states that are not preempting correctly. I currently have a similar issue when executing MoveIt states but have not had the time to investigate deeper.

I found sending a new goal via axclient to the statemachine is a good way to debug this behaviour.

Hopefully i will soon have time to take a closer look at the problem, if i find a solution i'll let you know :)

I think it is not a problem of your statemachine but of the states that are not preempting correctly. I currently have a similar issue when executing MoveIt states but have not had the time to investigate deeper.

I found sending a new goal via axclient to the statemachine is a good way to debug this behaviour.

Hopefully i will soon have time to take a closer look at the problem, if i find a solution i'll let you know :)


edit:

i just took a quick look at an actionserver that moves another part of our robot (not MoveIt!) which reacts correctly when an abort is requested or a new goal is sent.

Below is a code snipped of the inside part execution. This corresponds to my current thoughts that if there is no frequent check whether a preempt or abort signal was sent the active goal execution will not be stopped...


while(((position - goal->finalPosition) >= 0.001 || (position - goal->finalPosition) <= -0.001) && timeout > 0)
            {
                //timeout--;
                // check that preempt has not been requested by the client
                if (as_LinearGuideMove.isPreemptRequested() || !ros::ok())
                {
                    ROS_INFO("%s: Preempted", action_name_LinearGuideMove.c_str());
                    // set the action state to preempted
                    as_LinearGuideMove.setPreempted();
                    success = false;
                    break;
                }
                ros::spinOnce();
                if(m_bLinearGuideActionAbort){
                    #ifndef __SIM__
                    m_CanCtrlPltf->setVelGearMpS(m_CanCtrlPltf->CANNODE_LINEARGUIDEMOTOR, 0);
                    #endif
                    ROS_INFO("%s: Aborted by operator", action_name_LinearGuideMove.c_str());
                    as_LinearGuideMove.setAborted();
                    success = false;
                    break;
                }