Build System
The software on the car all lives inside the ROS2 workspace named roboracer_ws, which is located at the path ~/roboracer_ws.
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.
-
Configure the camera(s). Follow the camera setup instructions in Raspberry Pi Camera Setup.
-
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.
Open a shell on the car (either directly or via ssh), enter the container and change directory to the roboracer_ws workspace:
cd ~/roboracer_ws
Start the container:
./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 shellfrom theroboracer_wsdirectory. Once you're in the container, your terminal prompt will change to show:[docker]:orin@orin03:~/roboracer_ws$, whereorin03is the hostname of the car.
Read more about using the container in the guide on Containers.
Then, in the container, build the workspace:
make
Note that make runs the command
colcon build --cmake-args -DCMAKE_BUILD_MODE="Hardware".colcon buildis 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.