Dock to battery charger

ROS2 Galactic and teleop_gui

teleop_gui was one of the first programs among my ROS2 articles. It was mimicking the ROS2 utility teleop_twist_keyboard, except, it allowed you to use GUI buttons instead of keyboard shortcuts to control the robot.

... and (as it usually happens with obsolete articles) if you try running it, you will find that it doesn't work on navigation_bot_10. The reason is, in teleop_gui we published '/diff_cont/cmd_vel_unstamped' topic, while now we need to publish /cmd_vel topic.

The difference between using /cmd_vel and /diff_drive_controller/cmd_vel_unstamped is due to the controller you are using. /cmd_vel is a standard topic used in ROS2 for sending velocity commands to a mobile robot. It is the default topic for most robot controllers, including differential drive controllers, and can be used with a variety of robot platforms. Of course, ROS2 developers couldn't resist the temptation...

... and therefore, /diff_drive_controller/cmd_vel_unstamped was used as a topic specific to the diff_drive_controller package in ROS2. As you remember, I have provided two diff. drive robots, one using Gazebo diff. drive controller, and another one using ROS2 diff. drive controller. And yes, they need different topics. Of course, if you know about it, you can remap messages, ROS provides this option.

The reason I mentioned it is, that we are going to work on the code that controls robot's speed and direction directly (as opposed to doing it through navigation plugins). So we need to keep the problem in mind if we want it all to work. Particularly, the code that publishes commands for diff. drive controller will look like this:

                    self.publisher_ = self.create_publisher(
                        # For ROS2 diff. drive controller
                        #TwistStamped,
                        #'/diff_cont/cmd_vel_unstamped',    

                        # For Gazebo diff. drive controller
                        Twist,  
                        "/cmd_vel",                        

                        10)
                

This code will be part of our script, teleop_gui was just an example.

(C) snowcron.com, all rights reserved

Please read the disclaimer