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

I can offer an idea, but don't have a node handy for you. You'll have to write it yourself.

First: Navigation stack doesn't send goals. You send goals to the goal topic and move_base uses it.

What you want to do sounds reasonably simple:

1 - intercept a goal from whatever the source of that goal is. Remap goal so your custom nodes gets the goal. You can do this by reading here: http://answers.ros.org/question/9248/how-do-you-remap-a-topic/

2 - when a goal is received, you issue command on cmd_vel topic to cause the robot to spin - http://answers.ros.org/question/11655/help-publishing-to-cmd_vel-and-subscribing-to-laserscan/

3 - listen to the odom topic and when the robot stops rotating, forward the intercepted goal back onto the appropriate topic so move_base can make the move - http://wiki.ros.org/navigation/Tutorials/SendingSimpleGoals

4 - either listen again to the odom topic, or listen to the move_base/status topic and when the move to the goal is done you again send command on the cmd_vel topic for robot to rotate.

I see no reason for you to need to cancel the move_base process. Just take control of the issuing of goals and move_base should not interfere with anything. I believe that as long as move_base is not actively driving toward a goal, that it will not publish on the cmd_vel topic so your node should have full access to it. If I am wrong and move_base continues to publish on cdm_vel, then you would need to multiplex the input to the topic as described here: http://wiki.ros.org/cmd_vel_mux

I can offer an idea, but don't have a node handy for you. You'll have to write it yourself.

First: Navigation stack doesn't send goals. You send goals to the goal topic and move_base uses it.

What you want to do sounds reasonably simple:

1 - intercept a goal from whatever the source of that goal is. Remap goal so your custom nodes gets the goal. You can do this by reading here: http://answers.ros.org/question/9248/how-do-you-remap-a-topic/

2 - when a goal is received, you issue command on cmd_vel topic to cause the robot to spin - http://answers.ros.org/question/11655/help-publishing-to-cmd_vel-and-subscribing-to-laserscan/

3 - listen to the odom topic and when the robot stops rotating, forward the intercepted goal back onto the appropriate topic so move_base can make the move - http://wiki.ros.org/navigation/Tutorials/SendingSimpleGoals

4 - either listen again to the odom topic, or listen to the move_base/status topic and when the move to the goal is done you again send command on the cmd_vel topic for robot to rotate.

I see no reason for you to need to cancel the move_base process. Just take control of the issuing of goals and move_base should not interfere with anything. I believe that as long as move_base is not actively driving toward a goal, that it will not publish on the cmd_vel topic so your node should have full access to it. If I am wrong and move_base continues to publish on cdm_vel, then you would need to multiplex the input to the topic as described here: http://wiki.ros.org/cmd_vel_mux

Update: I have confirmed that move_base stops publishing on the /cmd_vel topic once the move is complete.