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

Proper Working of cmd_vel_mux for Velocity Multiplexing

asked 2014-04-20 05:28:46 -0500

RB gravatar image

updated 2014-04-22 20:17:04 -0500


I am using ROS fuerte version and the simulator is USARSim.

::AIM:: Now, I try to use the velocity multiplexer (sudo apt-get install ros-fuerte-yujin-ocs) designed by YujinRobot( for multiplexing between teleoperation and autonomous navigation. I use rviz for setting the goal for autonomous navigation.

::ACTION TAKEN:: I have used following command to bring nodelet_manager and velocity_multiplexer:

roslaunch cmd_vel_mux standalone.launch

and following is the example_cfg.yaml


• name: "Teleoperation"

topic: "teleop_cmd_vel"

timeout: 180

priority: 10

• name: "Navigation"

topic: "cmd_vel"

timeout: 0.1

priority: 0

TASK 1 I want to give more priority to teleoperation. Before declaring the /teleop_cmd_vel to be inactive topic for multiplexing, I want the timeout period to be more.

TASK 2 I don't want the autonomous navigator of ROS snatch away the driving control. But, I am not getting the proper behavior that I am expecting. The autonomous controller snatch away the control before the 180 second (even if both topics are active) from teleoperation.

Question:What may be the reason that the robot is not following exactly the example_cfg.yaml?

If it goes like this then adding dynamic reconfigure server will not be fruitful for my experiment.

ALL The Nodes Launched Properly.



  1. timeout for "teleop_cmd_vel" is 180 seconds, but as you can see in the following screenshot, two no new messages should not deliver the control to "cmd_vel" i.e autonomous navigator; but surprisingly it is happening.


image description

image description

Who will be the publisher of output topic /cmd_vel

As the velocity multiplexer don't publish to /cmd_vel (output topic of config file), should I modify the code?

RAW Config File Config File.jpg

Modified Config File M_Config.jpg

edit retag flag offensive close merge delete


The config looks correct to me. You can debug the individual input and output topics via rostopic echo to verify that this is really the source of the problem.

dornhege gravatar image dornhege  ( 2014-04-20 07:06:29 -0500 )edit

@dornhege, I have added two screenshots; so whenever I stop pressing keys in teleoperation, no new messages in that topic. So, the topic becomes inactive although it should wait for 180 seconds according to config file....Again avg publishing rate slowly increases in case of teleopearation, that's why the robot don't want to listen to teleope controller, I think? Does the package has some other criteria like it only works for Kobuki?

RB gravatar image RB  ( 2014-04-20 19:43:43 -0500 )edit

You should spend some time formatting your question properly, and perhaps include a screenshot of the node graph from a tool like RQT graph.

ahendrix gravatar image ahendrix  ( 2014-04-20 20:11:39 -0500 )edit

@ahendrix, I will definitely add the screenshot. But currently I have added the rxgraph output. The problem is AVG. PUBLISHING RATE DON'T OBEY THE PRIORITY CONFIG FILE.

RB gravatar image RB  ( 2014-04-20 21:22:39 -0500 )edit

Do you even have multiplexing between the two commands? Just to verify that the topics are all set up correctly. Please paste the complete raw configuration file in here.

dornhege gravatar image dornhege  ( 2014-04-21 03:30:40 -0500 )edit

@dornhege, I have updated the question with "RAW Config File Config File.jpg". By your comment, what I get is that I should write "/teleop_cmd_vel" instead of "teleop_cmd_vel"?

RB gravatar image RB  ( 2014-04-21 05:06:15 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2014-04-21 06:17:57 -0500

dornhege gravatar image

You have not configured an output topic. I suspect that will be cmd_vel then.

This is also the navigation input. I believe the cmd_vel_mux is thus working correctly in prioritizing between teleop and navigation. However, as you are publishing cmd_vel on the same topic as the output of the cmd_vel mux, you just override the cmd_vel_mux.

You will need to have three different topics for this setup: 2 Inputs and 1 Output. The output goes to the robot. The inputs come from teleop and navigation.

Teleop and Navigation topics must not have the same name as the output, otherwise they will publish there directly.

edit flag offensive delete link more


I have added a new Modified Config file in the question, please check once whether it is correct or not.

RB gravatar image RB  ( 2014-04-21 09:04:59 -0500 )edit

My navigation input originates from move_base package. So, I modify the topic name from /cmd_vel to /auto_cmd_vel according to your suggestion. But now autonomous navigation is not working and robot rotates in a circle. I think 'cmd_vel' topic is utilized by other packages like base_local_planner. Am I right?

RB gravatar image RB  ( 2014-04-21 09:13:17 -0500 )edit

Instead of modifying the source code for move_base, you should use remapping arguments in your launch file.

ahendrix gravatar image ahendrix  ( 2014-04-21 17:04:13 -0500 )edit

@ahendrix, it is really an easy solution, and but now the robot don't move even after setting the goal in rviz? Why the move_base package behaves abnormally after it's topic name got changed? I have modified the Teleop package's topic like that but it works smoothly.

RB gravatar image RB  ( 2014-04-21 19:12:18 -0500 )edit

It may be that you have the timeout set so high that move_base gives up and starts executing recovery behaviors before the multiplexer switches to it.

ahendrix gravatar image ahendrix  ( 2014-04-21 19:31:19 -0500 )edit

Now move_base package behaves correctly. I want to know who will be the publisher and subscriber for the output topic /cmd_vel? How messages from other two input topics come to the output topic after multiplexing.?

RB gravatar image RB  ( 2014-04-21 20:31:48 -0500 )edit

The multiplexer publishes /cmd_vel, and the robot base subscribes to it. The process of subscribing to the other cmd_vel topics and publishing to /cmd_vel is pretty much the textbook definition of a multiplexer.

ahendrix gravatar image ahendrix  ( 2014-04-21 20:41:51 -0500 )edit

Currently I have the /cmd_vel topic which is subscribed by robot_base, but as you can see in the rxgraph output, velocity multiplexer node doesn't publishes to /cmd_vel. Should I modify the code of cmd_vel_mux? I think this is the PROBLEM why I am not getting proper behavior.

RB gravatar image RB  ( 2014-04-22 01:26:13 -0500 )edit

Question Tools

1 follower


Asked: 2014-04-20 05:28:46 -0500

Seen: 2,254 times

Last updated: Apr 22 '14