Important: Building pre-requisites from below is only recommended if you have a powerful enough NVIDIA machine (RTX 2060 or more) and are willing to setup dual boot
Ubuntu 24.04. If not follow the instructions at apptainer to create a container in the university computers where all the below is done.
This package is intended for the following:
- Ubuntu 24.04
- ROS 2 Jazzy
- Gazebo Harmonic
Important: For the most up-to-date installation instructions, please refer to the official pages:
Make sure to install ros-jazzy-desktop (which includes RViz2).
-
Enable the Ubuntu Universe Repository:
sudo apt install software-properties-common sudo add-apt-repository universe
-
Add ROS 2 GPG key:
sudo apt update && sudo apt install curl -y sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg -
Add ROS 2 repository:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
-
Install ROS 2:
sudo apt update sudo apt upgrade sudo apt install ros-jazzy-desktop
-
Install necessary tools:
sudo apt-get update sudo apt-get install curl lsb-release gnupg
-
Add Gazebo repository:
sudo curl https://packages.osrfoundation.org/gazebo.gpg --output /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
-
Install Gazebo Harmonic:
sudo apt-get update sudo apt-get install gz-harmonic
-
Source the ROS 2 Environment:
source /opt/ros/jazzy/setup.bash -
Create a Workspace:
mkdir -p ~/colcon_ws/src cd ~/colcon_ws/src
-
Clone the Repository:
git clone https://github.com/GryphonRacingAI/gra-ros2.git . -
Install Necessary Tools
sudo apt install -y python3-colcon-common-extensions sudo apt install -y python3-rosdep sudo rosdep init rosdep update
-
Resolve Dependencies:
cd ~/colcon_ws rosdep install -i --from-path src --rosdistro jazzy -y
-
Build and Source the Workspace:
cd ~/colcon_ws colcon build --symlink-install source install/setup.bash
To source the overlays automatically every time you open a new terminal, add the following lines to the .bashrc script:
source /opt/ros/jazzy/setup.bash
source ~/colcon_ws/install/setup.bashor simply run the following
echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc
echo "source ~/colcon_ws/install/setup.bash" >> ~/.bashrcRun the following command so Gazebo can find the vehicle mesh
echo "export GZ_SIM_RESOURCE_PATH=$HOME/colcon_ws/install/simulation/share/" >> ~/.bashrcthen continue in a new terminal.
To run the simulator, run the following commands
ros2 launch simulation dynamic_event.launch.py autostart:=trueThis should launch Gazebo Sim, with the acceleration track and ADS-DV vehicle model spawned in.

The following launch arguments are provided for dynamic_event.launch.py
| Argument | Description | Options | Default |
|---|---|---|---|
| event | specifies which track to spawn in based on the dynamic event | acceleration, skidpad, autocross, trackdrive |
acceleration |
| autostart | starts the simulation automatically | true, false |
true |
| model_file | path to the vehicle model sdf file | Any valid path to vehicle sdf model | hard-coded path |
| name | sets the vehicle name in Gazebo | Any valid string | ads_dv |
| verbosity | sets the Gazebo console output verbosity | 0 - 4 | 1 |
To launch the perception nodes, use the following command
ros2 launch ultralytics_ros predict_with_cloud.launch.xml use_sim_time:=true yolo_model:=conev11n.pt input_topic:=/zed2i/depth_camera/image| Argument | Description | Options | Default |
|---|---|---|---|
| use_sim_time | uses simulation time published to /clock | true, false |
true |
| yolo_model | sets the model for inference | conev11n.pt, conev8n.pt, conev8n_40.pt |
conev11n.pt |
| input_topic | sets camera input topic | any valid camera video topic | /image_raw |
All parameters for the 3D perception node predict_with_cloud_node are specified in config/predict_with_cloud_node.yaml