Creating a base controller
A base controller is an important element in the navigation stack because it is the only way to effectively control your robot. It communicates directly with the electronics of your robot.
ROS does not provide a standard base controller, so you must write a base controller for your mobile platform.
Your robot has to be controlled with the message type geometry_msgs/Twist
. This message was used on the Odometry
message that we saw before.
So, your base controller must subscribe to a topic with the name cmd_vel
, and must generate the correct commands to move the platform with the correct linear and angular velocities.
We are now going to recall the structure of this message. Type the following command in a shell to see the structure:
$ rosmsg show geometry_msgs/Twist
The output of this command is as follows:
The vector with the name linear
indicates the linear velocity for the axes x
, y
, and z
. The vector with the name angular
is for the angular velocity on the axes.
For...