Skip to content

Leeds Gryphon Racing AI Software Stack for 2024-25

License

Notifications You must be signed in to change notification settings

Dyst-0/gra-ros2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prerequisites

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).

Install ROS 2 Jazzy

  1. Enable the Ubuntu Universe Repository:

    sudo apt install software-properties-common
    sudo add-apt-repository universe
  2. 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
  3. 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
  4. Install ROS 2:

    sudo apt update
    sudo apt upgrade
    sudo apt install ros-jazzy-desktop

Install Gazebo Harmonic

  1. Install necessary tools:

    sudo apt-get update
    sudo apt-get install curl lsb-release gnupg
  2. 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
  3. Install Gazebo Harmonic:

    sudo apt-get update
    sudo apt-get install gz-harmonic

Build Instructions

  1. Source the ROS 2 Environment:

    source /opt/ros/jazzy/setup.bash
  2. Create a Workspace:

    mkdir -p ~/colcon_ws/src
    cd ~/colcon_ws/src
  3. Clone the Repository:

    git clone https://github.com/GryphonRacingAI/gra-ros2.git .
  4. Install Necessary Tools

    sudo apt install -y python3-colcon-common-extensions
    sudo apt install -y python3-rosdep
    sudo rosdep init
    rosdep update
  5. Resolve Dependencies:

    cd ~/colcon_ws
    rosdep install -i --from-path src --rosdistro jazzy -y
  6. Build and Source the Workspace:

    cd ~/colcon_ws
    colcon build --symlink-install
    source install/setup.bash

Usage

Environment Setup

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.bash

or simply run the following

echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc
echo "source ~/colcon_ws/install/setup.bash" >> ~/.bashrc

Run the following command so Gazebo can find the vehicle mesh

echo "export GZ_SIM_RESOURCE_PATH=$HOME/colcon_ws/install/simulation/share/" >> ~/.bashrc

then continue in a new terminal.

Launch the Simulator

To run the simulator, run the following commands

ros2 launch simulation dynamic_event.launch.py autostart:=true

This should launch Gazebo Sim, with the acceleration track and ADS-DV vehicle model spawned in. Example

Launch Arguments

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

About

Leeds Gryphon Racing AI Software Stack for 2024-25

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 56.0%
  • Python 35.5%
  • CMake 8.5%