Repository Summary
| Description | A repo for the racing stack code we used in ICRA'22 F1TEHTH competition. |
| Checkout URI | https://github.com/zzjun725/f1tenth-racing-stack-icra22.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2024-01-13 |
| Dev Status | UNKNOWN |
| Released | UNRELEASED |
| Tags | No category tags. |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| dummy_car | 0.0.0 |
| lane_follow | 0.0.0 |
| opponent_predictor | 0.0.0 |
| pure_pursuit | 0.0.0 |
README
This is the codebase we released for our ICRA’22 F1tenth Competition. Check an exciting video in which we competed with the ETH Zurich team!
Overview
We are using pure-pursuit controller and a lane switcher for overtaking/obstacle avoidance.


Installation
Download the package
To use the stack in your workspace, you need to put them inside the src folder so the structure of your workspace should be like this:
├── build
├── install
├── log
└── src
├── config
├── csv
├── dummy_car
├── trajectory_generator
├── lane_follow
├── maps
├── opponent_predictor
├── scripts
└── <YOUR OTHER PACKAGES>
Create virtual environment and install the dependencies
Note: This package use the TUM global raceline optimization which requires specific version of numpy and sklearn packages which can be incompatible with other application. So, it is better to use Anaconda3/venv to create a virtual environment specific for using the raceline optimization. Here, we use the venv package in python.
-
Go inside the
srcfolder:cd ./src -
Install venv:
sudo apt install python3.8-venv -
Create virtual environment, exclude it from the colcon build and source the virtual environment:
python3 -m venv ./venv && touch ./venv/COLCON_IGNORE && source ./venv/bin/activate -
Install the dependencies:
pip install -r trajectory_generator/requirements.txt
Process the map and generate the optimal raceline
Before you execute the following steps, make sure you are inside the ./src folder and the virtual environment is activated with: source ./venv/bin/activate.
- Put maps(.png, .pgm, etc) and its configuration(.yaml) under
maps - Edit
config/params.yamlto include correct map name - Run
./scripts/populate.shto populate data files into subdirectories - Run
python3 trajectory_generator/lane_generator.pyto generate track data from image(Click the pop-up image, Press any keys(Enter, for example) to continue). - Run
python3 trajectory_generator/main_globaltraj.pyto generate race line file. - Run
python3 trajectory_generator/raceline_scripts.pyto visualize the curvature of the generated optimal raceline. - Run
./scripts/populate.shagain to populate generated raceline into subdirectories
Use the generated raceline for lane_follow(single agent)
You should do colcon build and launch the node from the workspace folder ./ as normal, not inside the src.
-
Bring up simulation RVIZ(see f1tenth_gym_ros):
ros2 launch f1tenth_gym_ros gym_bridge_launch.py -
Run
ros2 launch lane_follow lane_follow_launch.py
You can load the config file ./config/race.rviz for rviz2. The global raceline is published under topic/global_path/optimal_trajectory, and the target of pure pursuit is published under topic /waypoint.
ThirdParty Library
raceline optimization: TUM global raceline optimization
Attendees for ICRA’22 F1tenth Competition