Erratic Robot
Description of Erratic
Bringup Erratic in Gazebo
Controlling the Erratic
Description of Erratic
The Erratic robot is a clone by Videre of the well known Pioneer2 robotic platform that's been around for more than 10 years.
Note: Until further notice, we will be using the erratic robot for Project 1. Remember that, You should not have anything to do with Gazebo once you finish Phase 1 until you are ready for Phase 3.
Bring up the Erratic Robot in Gazebo
Install the stack, Launch Gazebo & Teleoperate
- Install the
erratic_robot
stack:
sudo apt-get install ros-cturtle-erratic-robot
- Launch gazebo with the erratic in an empty environment:
roslaunch erratic_navigation_apps demo_2dnav_empty_map.launch
- Run the teleoperation node:
rosrun erratic_teleop erratic_keyboard_teleop
- Have fun driving that bad boy around with the
WASD
keys! PressShift
to put the pedal to the metal.
Controlling the Erratic
Brief Description
Topics
/odom
(nav_msgs/Odometry)
- subscribe to this topic to receive updates on the robot's odometry. (units are meters, radians)
/cmd_speed
(geometry_msgs/Twist)
- publish speed commands for the left and right motors on this topic to control the robot's base.
- linear.x: msg field for speed of left motorlinear.y: msg field for speed of right motorforward speed: 0 < v <= 2.0 (max: 2.0)reverse speed: -2.0 <= v < 0 (max: -2.0)
C++ / Python
There isn't much you have to know other than what is described in the brief summary above. You have to subscribe to /odom
and publish motor commands on /cmd_speed
.
You still have to download erratic_control_2-3-2011.zip because it contains the modified erratic_gazebo_plugins package that subscribes to /cmd_speed
instead of /cmd_vel
- the standard topic. Make sure you place the erratic_gazebo_plugins folder in your ROS_PACKAGE_PATH
before /opt/ros/cturtle/stacks
. Then source your ~/.bashrc
file and run rosmake erratic_gazebo_plugins
.
You can use this launch file: erratic_gazebo.launch to bring up the erratic in gazebo. ''(note: it refers to a texture in the erratic_control_example package, so I would suggest to put that folder in your ROS_PACKAGE_PATH as well...)
Matlab
- Download the code erratic_control_2-3-2011.zip.
- Unzip it.
unzip erratic_control_2-3-2011.zip
- Put the erratic_control folder in your ROS_PACKAGE_PATH.
- Compile the
erratic_gazebo_plugins
package.
rosmake erratic_gazebo_plugins
- Now let's run the example code. Let's launch gazebo, ipc & ipc_bridge. If everything loaded properly, you should see the gazebo window come up with the erratic at the center.
roslaunch erratic_control_example bringup_erratic_with_controller.launch
- We will now run an example script in matlab that reads the odometry measurement and then sends dummy control signals to the left and right motors. Open
erratic_control_example/control_erratic.m
in matlab. PressF5
to run it.
Try running the script again if you get an error. It doesn't always load properly the first time (I don't know why).
In gazebo, you should see the robot randomly choose new speeds for the left and right motors every 5 seconds.
http://www.youtube.com/watch?v=D2Pck5l51A0
A totally pointless video showing the robot responding to random motor commands.
Look. It moves.
[position] x: -1.038 y: -8.720 z: 0.000 [orientation] x: 0.000 y: 0.000 z: -0.970 w: 0.243 [command] right_motor: 0.018 left_motor: 0.323 --------------- [position] x: -1.370 y: -8.724 z: 0.000 [orientation] x: 0.000 y: 0.000 z: 0.893 w: 0.450 [command] right_motor: 0.018 left_motor: 0.323 ...... [position] x: -1.017 y: -7.245 z: 0.000 [orientation] x: 0.000 y: 0.000 z: 0.577 w: 0.817 [command] right_motor: 0.090 left_motor: 0.059 --------------- [position] x: -0.977 y: -7.094 z: 0.000 [orientation] x: 0.000 y: 0.000 z: 0.649 w: 0.761 [command] right_motor: 0.090 left_motor: 0.059 --------------- [position] x: -0.967 y: -6.942 z: 0.000 [orientation] x: 0.000 y: 0.000 z: 0.716 w: 0.698 [command] right_motor: 0.090 left_motor: 0.059 --------------- [position] x: -0.984 y: -6.793 z: 0.000 [orientation] x: 0.000 y: 0.000 z: 0.776 w: 0.631 [command] right_motor: 0.090 left_motor: 0.059 --------------- [position] x: -1.022 y: -6.663 z: 0.000 [orientation] x: 0.000 y: 0.000 z: 0.825 w: 0.566 [command] right_motor: 0.374 left_motor: 0.385 ---------------