ROS packages for OU's IGVC Self-Drive competition entry.
After cloning into a ROS workspace, run the following the command from the root of the workspace to install the necessary ROS package dependencies to make everything work correctly:
rosdep install --from-paths src --ignore-src -r
roslaunch gazebo_ros empty_world.launch
To load a custom Gazebo world file, pass its file path to the world_name
argument:
roslaunch gazebo_ros empty_world.launch world_name:=<complete path to world file here\>
Spawn Sequoia in Gazebo with spawn_sequoia.launch
in the sequoia_ros
package:
roslaunch sequoia_gazebo spawn_sequoia.launch
The self_drive_tasks.world
file in the self_drive_tasks_gazebo
package simulates the specific tasks as described in the official rules document, which can be found [here].
To load the world and spawn the vehicle at the starting point for a particular task, run the corresponding launch file in the self_drive_tasks_gazebo
package. For example, to run task F3, the right turn test where the vehicle has to stop at the intersection:
roslaunch self_drive_tasks_gazebo f3_gazebo.launch
-
/fix
: GPS position given in latitude and longitude in the form of asensor_msgs/NavSatFix
message -
/camera_sim/image_raw/*
: Standard group of image parameters fromimage_proc
-
/laser/scan
: LIDAR scan data in the form of asensor_msgs/LaserScan
message -
/vehicle/twist
: The current measurement of the vehicle's speed and yaw rate in ageometry_msgs/TwistStamped
message. Thelinear.x
field contains the speed in m/s andangular.z
contains the yaw rate in rad/s
Gazebo subscribes to the following sensor_msgs/Float64
topics to simulate control inputs to the vehicle:
-
/vehicle/throttle_cmd
: Throttle percentage (0 to 1) -
/vehicle/brake_cmd
: Brake torque in Newton-meters (0 to 1000) -
/vehicle/steering_cmd
: Desired steering wheel angle in radians (-9.5 to +9.5)
Instead of directly publishing messages to the above topics, the sequoia_twist_controller
package provides a system for performing closed loop speed control and kinematic transformation from yaw rate to steering wheel angle.
To run the twist controller:
roslaunch sequoia_twist_controller sequoia_twist_controller.launch
To use the twist controller, just publish a geometry_msgs/Twist
message on the /vehicle/cmd_vel
topic, and it will generate the appropriate brake, throttle and steering wheel angle commands to send to the simulator.