Explanation about the Book ROS by Example (Hydro)

44 views
Skip to first unread message

Davide Picchi

unread,
Aug 11, 2014, 12:28:28 PM8/11/14
to ros-by-...@googlegroups.com
Hello,
first thank you very much to publish such a book. It is a very useful resource to understand ROS.
My only concern is about a statement on page 39 where you say:

The base controller node typically publishes odometry data on the /odom topic and
listens for motion commands on the /cmd_vel topic.


I don t agree with that because I think that in order to control the robot you have to publish on the /cmd_vel topic and listen data from the /odom topic.
This would be the right way for a controller to work.

Am I right? Or did I misunderstand the text?

Anyway thank you very much again for your work. Please keep going on :)
Regards



Patrick Goebel

unread,
Aug 11, 2014, 5:51:09 PM8/11/14
to ros-by-...@googlegroups.com
Hi Davide,

Great question!  You are correct that to control the motion of the robot, we publish Twist messages on the /cmd_vel topic and listen on the /odom topic.  However, the base controller node does things in reverse.

For example, suppose you are trying to teleop the robot using a joystick or some other manual control.  In this case, the teleop node needs to publish motion commands on the /cmd_vel topic but the base controller node (which talks more-or-less directly to the motor control hardware) must listen on this topic in order to respond to your commands.  At the same time, the base controller node typically reads encoder data (and perhaps gyro data as well) from the underlying hardware and publishes the data as a ROS Odometry message on the /odom topic.  Other nodes like move_base in the Navigation stack can then subscribe to the /odom topic so they can track the movement of the robot.

A good example of a ROS base controller node can be found in the ros_arduino_bridge package.  In particular, take a look at the base_controller.py file which subscribes to the /cmd_vel topic and publishes on the /odom topic.

--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 http://groups.google.com/group/ros-by-example.
For more options, visit https://groups.google.com/d/optout.

Davide Picchi

unread,
Aug 12, 2014, 1:45:25 AM8/12/14
to ros-by-...@googlegroups.com
Hi Patrick,
thanx!! It makes sense now.

Regards
Reply all
Reply to author
Forward
0 new messages