Problem with rostopic pub, the robot doesn´t move

1,285 views
Skip to first unread message

Julián René Cháux Cedeño

unread,
Mar 23, 2016, 1:01:51 AM3/23/16
to ros-by-example
Hello patrick

Excuse me for my bad English.

I am a new user of ros and I'm studying your book "ros_by_example_volume_1" very good and interesting, I congratulate you. 

I have a problem in chapter 7.5 "Sending Messages Twist to a Real Robot", follow the procedure and the robot doesn't move.

I follow this procedure:

turtlebot_bringup roslaunch minimal.launch --screen

rostopic pub -r 10 / cmd_vel geometry_msgs / Twist '{linear: {x: 0, y: 0, z 0}, angular: {x: 0, y: 0, z: 1.0}}'


I use "roslaunch turtlebot_bringup minimal.launch --screen" because that is in the book "roslaunch rbx1_bringup turtlebot_minimal_create.launch" generates an error.

I've already done the "Teleop" and "Autodocking" and works very well.

Help me.

Julian Chaux

Patrick Goebel

unread,
Mar 23, 2016, 9:19:05 AM3/23/16
to ros-by-...@googlegroups.com
Hi Julian,

Can you please tell us what version of ROS you are using (e.g. Hydro or
Indigo) and whether you are using the original iRobot Create Turtlebot
or the Kobuki Turtlebot?

Thanks,
patrick

--
The Pi Robot Project
http://www.pirobot.org/wordpress

Julián René Cháux Cedeño

unread,
Mar 23, 2016, 11:05:56 AM3/23/16
to ros-by-example
Hi Patrick

* Indigo
* Kobuki Turtlebot

Thanks,

Julian

Patrick Goebel

unread,
Mar 23, 2016, 1:55:06 PM3/23/16
to ros-by-...@googlegroups.com
Hi Julian,

Under ROS Indigo, the turtlebot_bringup/minimal.launch file runs the yocs_cmd_vel_mux node that multiplexes velocity commands from different sources including teleop, navigation, and the Kobuki safety controller.  You can find more details about the yocs_cmd_vel_mux nodelet on the ROS Wiki and in Volume 2 of ROS By Example.

The net result is that multiplexer does not listen on the traditional /cmd_vel topic by default but instead listens on several input topics that are ranked according to priority.  The default input topics are:

cmd_vel_mux/input/safety_controller
cmd_vel_mux/input/teleop
cmd_vel_mux/input/navi

and these topics are usually remapped using additional launch files.  The cmd_vel_mux node then outputs the currently active velocity command on the topic /mobile_base/commands/velocity.  So if you just want to test a simple Twist command with your Kobuki, you can run either:

$ rostopic pub -r 10 /mobile_base/commands/velocity geometry_msgs / Twist '{linear: {x: 0, y:  0, z 0}, angular: {x: 0, y: 0, z: 1.0}}'

or you can use one of the cmd_vel_mux input topics assuming the topic isn't already being used.  For example, assuming you aren't already running a teleop node, you could try:

$ rostopic pub -r 10 /cmd_vel_mux/input/teleop geometry_msgs / Twist '{linear: {x: 0, y:  0, z 0}, angular: {x: 0, y: 0, z: 1.0}}'

--patrick

Julián René Cháux Cedeño

unread,
Mar 26, 2016, 1:57:34 AM3/26/16
to ros-by-example
Thank's Patrick, works perfectly.

Julian

Patrick Goebel

unread,
Mar 29, 2016, 9:57:55 AM3/29/16
to ros-by-...@googlegroups.com
Just in case someone is looking at this message in the archives, there are some typos in the two commands given below for moving a Kobuki.  They should be as follows:

The cmd_vel_mux node outputs the currently active velocity command on the topic /mobile_base/commands/velocity.  So if you just want to test a simple Twist command with your Kobuki, you can run either:

$ rostopic pub -r 10 /mobile_base/commands/velocity geometry_msgs/Twist '{linear: {x: 0, y: 0, z: 0}, angular: {x: 0, y: 0, z: 1.0}}'


or you can use one of the cmd_vel_mux input topics assuming the topic isn't already being used. For example, assuming you aren't already running a teleop node, you could try:

$ rostopic pub -r 10 /cmd_vel_mux/input/teleop geometry_msgs/Twist '{linear: {x: 0, y: 0, z: 0}, angular: {x: 0, y: 0, z: 1.0}}'

--patrick
--
You received this message because you are subscribed to the Google Groups "ros-by-example" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ros-by-exampl...@googlegroups.com.
Visit this group at https://groups.google.com/group/ros-by-example.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages