Ask Your Question

Switching between autonomous control and keyboard control in ROS

asked 2013-11-28 03:48:26 -0600

RB gravatar image

I want to write a C++ program to switch the control from keyboard to autonomous and vice-versa. Will it be feasible in ROS?

Because, my program need to communicate through two packages namely move_base and brown_remotelab ( I can’t visualize the whole scenario and it’s complexity.

Can you give some insight about the situation and some idea to design the program?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2013-11-28 04:43:35 -0600

dornhege gravatar image

ROS already provides tools for that.

Mux will let you switch an output topic from multiple incoming topics by calling a service, basically what you were asking for.

What might be more convenient to use is the cmd_vel_mux. It lets you define a couple of sources for a cmd_vel topic that are ordered by priorities. From the active topics the one with highest priority is used. Usually one puts autonomous control at the lowest and uses a teleop setup that is silent when no commands are issued. In this case the switch to autonomy will happen automatically when teleop is not used.

edit flag offensive delete link more


Thanks for your reply. I have one doubt. Are you sure that even if in maze; ROS can produce an effective autonomous plan to achieve a certain goal? Will there be any chance that the Robot halts at various junction like L, T or +?

RB gravatar imageRB ( 2013-12-03 05:40:08 -0600 )edit

Till now I have not achieved autonomous navigation, so I am aware of only cmd_vel topic by teleop. After achieving High level navigation, will there be any auto_cmd_vel (auto tends for autonomous) by move_base node? Again cmd_vel_mux is bang on target and if I can use it then it will be very useful for me, but as I am using USARSimROS (for P3AT robot) and my knowledge regarding kobuki_node is very less. I if cmd_vel of teleop and cmd_vel of move_base must publish messages to mux node; I think. Do, I need to write custom code to link move_base node to mux node?

RB gravatar imageRB ( 2013-12-03 06:37:22 -0600 )edit

This works out of the box. It's intended for the turltebots/kobuki, but independent. The only thing it does is automatically switch between the cmd_vel topics. Usually you'd just remap them accordingly, e.g. move_base's will go to /cmd_vel_mux/autonomy_cmd_vel or something like that.

dornhege gravatar imagedornhege ( 2013-12-04 04:21:45 -0600 )edit

Something like autonomous plans to achieve goals in a maze is out of the scope for this question and a very different problem. Open a new question if you want to inquire about some capabilities of the navigation stack.

dornhege gravatar imagedornhege ( 2013-12-04 04:22:53 -0600 )edit

ok.. Thanks sir @dornhege

RB gravatar imageRB ( 2013-12-04 06:33:40 -0600 )edit

One more question @dornhege; can I assign two different priorities(at time instant t1, priority p1 and in another time instant t2, priority p2) to the same cmd_vel topic?

RB gravatar imageRB ( 2013-12-08 18:29:31 -0600 )edit

I don't know. Maybe just try it?

dornhege gravatar imagedornhege ( 2013-12-08 23:06:10 -0600 )edit

@dornhege cmd_vel_mux ( is written for Groovy/hydro. I am using Fuerte. So can I use this package directly by simply modifying subscriber and publisher? Is there any problem with communication between nodelet and normal nodes? I have seen in here Where mobile_base has to be a nodelet as well. PLEASE REPLY

RB gravatar imageRB ( 2014-01-29 17:59:24 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2013-11-28 03:48:26 -0600

Seen: 372 times

Last updated: Nov 28 '13