Most of the wheeled robots in ROS use move_base to move the robot. move_base geometry model is based on differential drive which basically transforms a velocity command (twist message) into a command for rotating the left and the right wheels at a different speed which enable the car to turn into the right or left or goes straight.
I was looking for a car robot model with such geometry so I can test it in gazebo and ROS. I didn’t find what I was looking for but I found several packages and with some adaptations, I managed to build and control a car with Ackermann steering geometry with a joystick.
As you can see in the following graph, I’m reading my joystick data and translate them into twist messages (The topic is cmd_vel). Then I translate these messages into Ackermann messages (The topic is ackermann_cmd).
Click to enlarge the image.
The robot in the video downloaded from here with some modifications for this work.
For this work, first I loaded the RRBot in Gazebo and
launched Its joints controller, then I sent a periodic signal to the robot such that the laser scanner mounted on the robot swings.
In the following, I assembled the incoming laser scans with the transformation from tf and created PCL point cloud.
5.Move your robot via keyboard or joystick controller:
1
roslaunch turtlebot_teleop keyboard_teleop.launch
1
roslaunch turtlebot_teleop logitech.launch
or
1
roslaunch turtlebot_teleop xbox360_teleop.launch
or
1
roslaunch turtlebot_teleop ps3_teleop.launch
To make your joystick controller works, you have to hold the “axis_deadman” button. This has been specified in the corresponding launch file. For instance for xbox360 controller edit
you can see, in this file, it has been assigned to 4
1
<param name="axis_deadman"value="4"/>
To see which button on your controller has been assigned to “axis_deadman”, run
1
sudo jstest/dev/input/js
and press all buttons one by one until you see which button is 4″
now you have to keep pressing that button for sending a command from your controller. You can watch the state of each button by listening to the /joy topic:
1
rostopic echo/joy
Now start adding objects into gazebo scene and start exploring the environment, you should see the map: