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

Interrupt navigation stack and spin once

asked 2016-12-01 05:47:31 -0600

gijsje170 gravatar image

Hi,

I want a node which on receiving a goal from the navigation stack makes a turn continue's to the goal and after like 10 seconds spins again etc. How am i going to implement this? I know i need to subscribe to like /newgoal or something. Also i know i have to use move_base/cancel to stop navigation stack. Then i should somehow spin exactly 360 degrees? Then i should send my newgoal to /move_base_simple/goal Is there any tutorial i could follow to implement this? especially the part of an exact 360 degrees spin using odom.

Thanks in advance

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-01-06 14:31:52 -0600

billy gravatar image

updated 2017-01-07 02:14:27 -0600

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/...

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...

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/Tutori...

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.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2016-12-01 05:47:31 -0600

Seen: 1,092 times

Last updated: Jan 07 '17