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

Switching between autonomous control and keyboard control in ROS

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

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 (http://wiki.ros.org/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
3

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

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

Comments

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 image RB  ( 2013-12-03 05:40:08 -0500 )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 image RB  ( 2013-12-03 06:37:22 -0500 )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 image dornhege  ( 2013-12-04 04:21:45 -0500 )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 image dornhege  ( 2013-12-04 04:22:53 -0500 )edit

ok.. Thanks sir @dornhege

RB gravatar image RB  ( 2013-12-04 06:33:40 -0500 )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 image RB  ( 2013-12-08 18:29:31 -0500 )edit

I don't know. Maybe just try it?

dornhege gravatar image dornhege  ( 2013-12-08 23:06:10 -0500 )edit

@dornhege cmd_vel_mux (http://wiki.ros.org/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 http://www.isep.ipp.pt/roswiki/kobuki(2f)Tutorials(2f)Kobuki(27)s(20)Control(20)System.html Where mobile_base has to be a nodelet as well. PLEASE REPLY

RB gravatar image RB  ( 2014-01-29 17:59:24 -0500 )edit

Question Tools

2 followers

Stats

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

Seen: 1,916 times

Last updated: Nov 28 '13