This repository contains software for 1/10th scale autonomous race cars to compete in the F1/10 competition. It is developed by the Autonomous Racing Project Group of TU Dortmund.
We provide several LIDAR based driving algorithms:
Our software works on physical hardware and in a simulated environment using Gazebo. Further features are:
You need to install the Robot Operating System (ROS) to use our software. We target ROS Kinetic on Ubuntu 16.04, but ROS Melodic seems to work as well.
Note for VM users: Gazebo 7.0.0, which is installed with ROS Kinetic by default, does not work on a virtual machine. To solve this, Gazebo has to be updated to at least 7.4.0 as explained here.
Install dependencies:
sudo pip uninstall pip && sudo apt install python-pip
sudo apt install libsdl2-dev clang-format python-pyqtgraph
pip install torch autopep8 cython circle-fit
# RangeLibc
git clone http://github.com/kctess5/range_libc
cd range_libc/pywrapper
# Either:
./compile.sh # on VM
# Or:
./compile_with_cuda.sh # on car - compiles GPU ray casting methods
Clone the repository:
git clone --recurse-submodules https://github.com/Autonomous-Racing-PG/ar-tu-do.git
Install missing ROS dependencies:
cd ar-tu-do/ros_ws
rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO}
Compile while inside the ros_ws
directory:
catkin_make
Set up enviroment variables for your shell:
source devel/setup.bash # (or setup.zsh, depending on your shell)
Use a launch file to start ROS and Gazebo:
roslaunch launch/car.launch # (Physical car, Wallfollowing)
roslaunch launch/car_navigation_stack.launch # (Physical car, SLAM & ROS navigation)
roslaunch launch/gazebo.launch # (Simulation, Wallfollowing)
roslaunch launch/navigation_stack.launch # (Simulation, SLAM & ROS navigation)
roslaunch launch/q_learning.launch # (Simulation, Train the Q-Learning model)
roslaunch launch/policy_gradient.launch # (Simulation, Train the Policy Gradient model)
roslaunch launch/evolutionary.launch # (Simulation, Train the evolutionary neural network)
These arguments can be passed to the launch files above. For example, to use the gazebo.launch
file without emergency stop and with car highlighting, run:
roslaunch launch/gazebo.launch emergency_stop:=false car_highlighting:=true
The arguments can be changed permanently by editing the launch files.
Argument | Description | Supported by launch/<file>.launch |
||||
---|---|---|---|---|---|---|
car | car_navstack | gazebo | navigation_stack | q_learning, policy_gradient, evolutionary | ||
debug |
Boolean value whether Gazebo should run in debug mode. Defaults to false. | ✗ | ✗ | ✓ | ✓ | ✗ |
emergency_stop |
Boolean value whether the emergency stop should be active. Defaults to true. | ✗ | ✗ | ✓ | ✗ | ✗ |
gui |
Boolean value whether Gazebo should show a user interface. Defaults to true. | ✗ | ✗ | ✓ | ✓ | ✓ |
joystick_type |
The type of joystick controller. Possible values: ps3 , xbox360 and xboxone |
✓ | ✓ | ✓ | ✓ | ✗ |
map |
Name of the map to be used by the particle filter. Defaults to a prerecorded map of racetrack_decorated_2 . |
✗ | ✓ (no default) |
✗ | ✓ | ✗ |
paused |
Boolean value whether Gazebo should start paused. Defaults to false. | ✗ | ✗ | ✓ | ✓ | ✗ |
pf_angle_step |
Angle step of the particle filter. Defaults to 18. | ✗ | ✓ | ✗ | ✓ | ✗ |
pf_max_particles |
Maximum amount of particles to be used by the particle filter. Defaults to 500. | ✗ | ✓ | ✗ | ✓ | ✗ |
pf_squash_factor |
Squash factor of the particle filter. Defaults to 2.2. | ✗ | ✓ | ✗ | ✓ | ✗ |
plot_window |
Integer value indicating the amount of episodes that should be plotted. Defaults to 200. | ✗ | ✗ | ✗ | ✗ | ✓ / ✓ / ✗ |
realtime_simulation |
Boolean value whether Gazebo should try to simulate with a real time factor of 1. If false, Gazebo tries to simulate as fast as possible. Defaults to true. | ✗ | ✗ | ✗ | ✗ | ✓ |
use_gpu |
Boolean value whether Gazebo should use the GPU when simulating the lidar. Defaults to true. | ✗ | ✗ | ✓ | ✓ | ✓ |
use_sim_time |
Boolean value whether all ros nodes should use simulated Gazebo time instead of wall clock time. Defaults to true. | ✗ | ✗ | ✓ | ✓ | ✗ |
verbose |
Boolean value whether Gazebo should give verbose standard output. Defaults to true. | ✗ | ✗ | ✓ | ✓ | ✗ |
visualize_lidar |
Boolean value whether Gazebo should show the simulated lidar rays. Defaults to false. | ✗ | ✗ | ✓ | ✓ | ✗ |
world |
The name of the racetrack. Possible values: racetrack_decorated , racetrack_decorated_2 (default) and racetrack_decorated_2_big |
✗ | ✗ | ✓ | ✓ | ✓ |
Our car is based on a 1/10th scale RC car (Traxxas Ford Fiesta) with these additions:
This project (excluding git submodules) is under MIT and GPLv3 dual licensed - see the MIT.LICENSE and GPLv3.LICENSE file for details.