Skip to content

3. Deployment and Docker

This guide is the canonical runtime workflow for JetRacer on Jetson Nano.

Supported Configuration

  • Hardware: Jetson Nano
  • Host OS baseline: Ubuntu 20.04 workaround image on JetPack 4.6.1 (L4T 32.7.1)
  • Container base: Ubuntu 20.04
  • ROS distro in container: ROS 2 Foxy
  • Runtime policy: ROS 2 only (no ros1_bridge)
  • Native setup/install_ros2.sh on Ubuntu 20.04 host: not supported

Before continuing, complete the host baseline in 00_ROS2-Jetson-Nano.md.

1. Host Prerequisites (Jetson)

Ensure Docker and NVIDIA container runtime are available:

docker --version
docker compose version
docker info | grep -i Runtime

If Docker is missing, install it from this repository:

cd setup
./install_docker.sh

Ensure your user can run Docker without sudo:

sudo usermod -aG docker $USER

Log out and log back in after changing group membership.

2. Start the Container

From repository root:

docker compose up -d --build

What this gives you:

  • Image built from local Dockerfile
  • Source bind-mounted into /workspaces/JetRacer-ROS2
  • Host networking and device passthrough for robot hardware

3. Build the ROS 2 Workspace

Open a shell in the running container:

docker exec -it jetracer_workspace bash

Then run:

source ~/.bashrc
rosdep update
rosdep install --from-paths src --ignore-src -r -y
build_workspace
source install/setup.bash

4. Run Core Modes

Use separate terminals (each with docker exec -it jetracer_workspace bash).

Hardware bringup (must run first):

ros2 launch jetracer_bringup jetracer.launch.py

Full lane-following stack (camera + control):

ros2 launch jetracer_bringup lane_following.launch.py

Enable autonomous lane command output:

ros2 param set /lane_following start true

Disable lane command output:

ros2 param set /lane_following start false

5. Foxglove Telemetry

Start autonomy pipeline in the container:

ros2 launch jetracer_bringup autonomy.launch.py

Then from a browser on your PC/tablet:

  1. Open studio.foxglove.dev
  2. Select Foxglove WebSocket
  3. Connect to ws://<JETSON_IP_ADDRESS>:8765

6. Useful Operations

Stop services:

docker compose down

Rebuild after Dockerfile or dependency changes:

docker compose up -d --build

View container logs:

docker logs -f jetracer_workspace

Next: 04. Perception Stack