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

If I understand your example correctly, the states gotoA and gotoB each take a longer time. And while gotoA and gotoB are running, you want to check for some transition condition. I see two possible solutions here:

1) In the execute() methods of gotoA and gotoB, you continuously check for this transition condition, and return an outcome when the transition condition is satisfied.

2) Use the concurrence container to create a monitor state that runs in parallel with gotoA and gotoB. All the monitor state does is check for the transition condition. When the transition is satisfied, the concurrence container can automatically preempts gotoA or gotoB.

If I understand your example correctly, the states gotoA and gotoB each take a longer time. And while gotoA and gotoB are running, you want to check for some transition condition. I see two possible solutions here:

1) In the execute() methods of gotoA and gotoB, you continuously check for this transition condition, and return an outcome when the transition condition is satisfied.

2) Use the concurrence container to create a monitor state that runs in parallel with gotoA and gotoB. So gotoA will run in a concurrence container with a monitor state, and gotoB will run in a different concurrence container with a monitor state. All the monitor state does is check for the transition condition. When the transition is satisfied, the concurrence container can automatically preempts gotoA or gotoB.