Skip to content

Build System

The software on the car all lives inside the ROS2 workspace named roboracer_ws, which is located at the path ~/roboracer_ws. It's built and launched with airfield.

If you're not familiar with ROS2, it is highly recommended that you complete the following ROS2 tutorials. These tutorials should be completed on your computer, not on the car.

Initial Setup

If you haven't yet read the Hardware Car Overview, please read this first to familiarize yourself with the car components and controls.

There are a few steps you need to complete the first time you set up your car. The setup script does most of them, and lists the rest when it finishes.

  1. Configure the camera(s). The setup script does this; see Raspberry Pi Camera Setup.

  2. Bind the Joystick to the car. Follow the Joystick setup instructions in Joystick Setup.

Build the workspace

Before running any ROS2 nodes on the car, you need to build the roboracer_ws workspace to compile all the packages and code. You only need to build the workspace when the source code has changed, such as after pulling new changes from git or modifying code files.

Airfield requires a workspace that has been migrated to it. Check for the scripts/build file and a plans/ folder in ~/roboracer_ws. If your car does not have them, it is still on the older layout; follow the instructions in the box below.

Open a shell on the car (either directly or via ssh), then build:

cd ~/roboracer_ws
scripts/build

There is no container to enter first. scripts/build builds a container image for each package, then compiles the code once into a workspace that every package's container shares. It goes one package at a time so the Orin doesn't run out of memory.

After you change one package, rebuild just that one, for example scripts/build ut_automata. Read more in the Airfield guide.

On the older layout: the container shell

Enter the container and change directory to the roboracer_ws workspace:

cd ~/roboracer_ws
./container shell

Note: All ros2 commands need to be run inside the container. If something is not working, be sure that you're inside the container by running ./container shell from the roboracer_ws directory. Once you're in the container, your terminal prompt will change to show: [docker]:orin@orin03:~/roboracer_ws$, where orin03 is the hostname of the car.

Then, in the container, build the workspace:

make

Note that make runs the command colcon build --cmake-args -DCMAKE_BUILD_MODE="Hardware". colcon build is the standard way to build the ROS2 workspace, and the additional CMAKE_BUILD_MODE is required to build the correct software packages for the car.