Ask Your Question

Publisher/Subscriber Error with /cmd_vel

asked 2018-07-16 14:40:24 -0500

boggsje gravatar image


I'm using ROS Kinetic on a virtualbox running Ubuntu 16.04.

When I run the bringup packages there are no errors and the turtlebot3_robot.launch says that it has set up the subscriber for the /cmd_vel topic from geometry_msgs.msgs/Twist.

When I go back to my Remote PC and run turtlebot3_teleop_key, data is published to /cmd_vel according to echo rostopic /cmd_vel. However, the robot does not move. When I run rqt_graph, it does not show a subscriber for /cmd_vel.

So I have conflicting information, with both parts (publisher and subscriber) claiming they're doing their job, but the robot is unable to move.

I'm new to ROS and TurtleBot operation so I apologize if this is a simple fix but I can't find a solution.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-07-17 02:26:04 -0500

Reamees gravatar image

You need to connect your virtual machine and the other computer as ROS master/slave.

Here is ROS wiki about master/slave and networking. And here is a tutorial that is a bit more straight forward to follow.

Basically what you need to do is (change the ip's to the ip's of your setup):

  1. Choose which computer will be master (Running roscore, doing calculations that are more time-critical)
  2. On the slave machine ping the master
  3. Set the slave pc ROS_MASTER_URI to the ip you pinged ($ export ROS_MASTER_URI=
  4. Set the slave pc ROS_IP to the ip of the slave ($ export ROS_IP=

To verify that you have ROS connected on the two computers:

  1. Start roscore on the master $ roscore
  2. On the slave PC $ printenv | grep ROS to verify the before-mentioned variables are set correctly
  3. On the slave PC ($ rostopic list )

If everything works as expected you should see the /rosout and /rosout_agg topics listed on the slave terminal. You could now run your launch files in these terminals and it should work. With this setup you have to set the variables for each terminal you want to communicate with the master. If this is not to your liking read the links posted above.

edit flag offensive delete link more


Great thanks that worked, although I did have several problems with hostnames. Thanks for your help.

boggsje gravatar image boggsje  ( 2018-07-17 13:32:00 -0500 )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: 2018-07-16 14:40:24 -0500

Seen: 442 times

Last updated: Jul 17 '18