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

multiplexing between two topic

asked 2014-10-21 15:34:08 -0500

Hi i am using P3AT(USARSim simulator) and want to drive it from my ROS-Fuerte. what i want to do is,

  1. Driving the robot using keyboard (using teleop_twist_keyboard)

  2. Automated navigation of robot (using Navigation stack)

I want to drive the robot using keyboard but when i commit mistake(i.e. approaching to hit a wall) the automated behavior need to be activated.

by following this, i have my configuration file


  - name:        "Human_is_Driving"
    topic:       "teleop_cmd_vel"
    timeout:     0.5
    priority:    5
  - name:        "MACHINE_TAKES_OVER"
    topic:       "auto_cmd_vel"
    timeout:     0.5
    priority:    5
publisher:       "velocity_multiplexer/mux_cmd_vel"


  <node pkg="nodelet" type="nodelet" name="nodelet_manager" args="manager"/>
  <node pkg="nodelet" type="nodelet" name="velocity_multiplexer" args="load cmd_vel_mux/CmdVelMuxNodelet nodelet_manager">

    <param name="subscribers_cfg_file" value="$(find cmd_vel_mux)/param/example_cfg1.yaml"/>

    <remap from="cmd_vel_mux/mux_cmd_vel" to="mobile_base/commands/velocity"/>
    <remap from="cmd_vel_mux/web_cmd_vel" to="web_app_teleop"/>
    <remap from="cmd_vel_mux/key_cmd_vel" to="key_cmd_vel"/>
    <remap from="velocity_multiplexer/amcl_pose" to="amcl_pose" />
    <remap from="velocity_multiplexer/move_base_simple/goal" to="move_base_simple/goal" />


resulting rqt graphs of

  1. teleoperation

  2. automated navigation

i am not able to understand the complexity of the problem.

please help me to understand "how can i switch between cmd_vel used by teleop & cmd_vel used by move_base"

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-10-21 15:44:40 -0500

ahendrix gravatar image

Take a look at the assisted_teleop package:

It isn't documented, but there are a few sample launch files like

edit flag offensive delete link more


@ahendrix thank you for reply

i have read about cmd_vel_mux, can we use it for the same purpose. i am also using the same. but not able to write the launch file.

sumant gravatar image sumant  ( 2014-10-22 17:16:33 -0500 )edit

cmd_vel_mux allows switching between topics, but is generally useful in the cases where manual control should preempt autonomous control; not the other way around.

ahendrix gravatar image ahendrix  ( 2014-10-22 20:07:52 -0500 )edit

Question Tools

1 follower


Asked: 2014-10-21 15:34:08 -0500

Seen: 6,696 times

Last updated: Oct 21 '14