Ask Your Question
1

Proper Working of cmd_vel_mux for Velocity Multiplexing

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

RB gravatar image

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

Hello,

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

subscribers:

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

RESULT

1.TOPICS DON"T FOLLOW PRIORITY CONFIG FILE?

  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.

PLZ REPLY :-)

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

Comments

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 imagedornhege ( 2014-04-20 07:06:29 -0600 )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 imageRB ( 2014-04-20 19:43:43 -0600 )edit
1

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 imageahendrix ( 2014-04-20 20:11:39 -0600 )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 imageRB ( 2014-04-20 21:22:39 -0600 )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 imagedornhege ( 2014-04-21 03:30:40 -0600 )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 imageRB ( 2014-04-21 05:06:15 -0600 )edit

1 Answer

Sort by » oldest newest most voted
1

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

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

Comments

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

RB gravatar imageRB ( 2014-04-21 09:04:59 -0600 )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 imageRB ( 2014-04-21 09:13:17 -0600 )edit
1

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

ahendrix gravatar imageahendrix ( 2014-04-21 17:04:13 -0600 )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 imageRB ( 2014-04-21 19:12:18 -0600 )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 imageahendrix ( 2014-04-21 19:31:19 -0600 )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 imageRB ( 2014-04-21 20:31:48 -0600 )edit
1

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 imageahendrix ( 2014-04-21 20:41:51 -0600 )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 imageRB ( 2014-04-22 01:26:13 -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

1 follower

Stats

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

Seen: 1,652 times

Last updated: Apr 22 '14