Skip to content

ESTACA-Mini-Ville/jetracer-setup-cli

Repository files navigation

🏎️ JetRacer Setup CLI

A terminal-based UI (TUI) application for configuring and managing NVIDIA JetRacer robots running ROS Melodic. Built with Textual, it provides an interactive interface for setting up Fast DDS middleware, managing ROS packages, and configuring robot identity — all from the comfort of your terminal.


✨ Features

  • FastDDS Setup — One-click automated installation and build of the eProsima Fast DDS stack (Fast-CDR, Fast-DDS, Fast-DDS-Gen) with architecture auto-detection (x86_64 / aarch64).
  • ROS Package Management — Install, update, and delete ROS packages from GitHub with live progress output, automatic submodule handling, and post-install/update hook support.
  • Workspace Build — Trigger catkin build for the entire ~/catkin_ws workspace directly from the UI.
  • Robot ID Configuration — View and set a global ROBOT_ID environment variable (persisted in ~/.bashrc).
  • Real-time Logging — All command output is streamed live to the TUI so you can monitor progress as it happens.
  • Sudo Support — Secure password prompt modal for commands that require elevated privileges.
  • Docker Support — Dockerfile and Compose configuration included for development and testing without a physical JetRacer.

📋 Prerequisites

Requirement Notes
Ubuntu 18.04 (Bionic) The target OS for ROS Melodic on Jetson Nano
ROS Melodic Must be installed at /opt/ros/melodic/
Python 3.8+ Installed automatically by install.sh via the deadsnakes PPA
Git Installed automatically by install.sh

Note: If you just want to try the tool without a physical JetRacer, see the Docker section below.


🚀 Installation

1. Clone the repository

git clone https://github.com/ESTACA-Mini-Ville/jetracer-setup-cli.git
cd jetracer-setup-cli

2. Run the install script

The install script handles everything: Python 3.8, virtual environment creation, pip dependencies, workspace directory setup, and .bashrc configuration.

chmod +x install.sh
./install.sh

⚠️ Do not run the install script as root — it will use sudo internally where needed.

3. Activate the virtual environment

source .venv/bin/activate

🖥️ Usage

Launch the TUI from the project directory with the virtual environment activated:

python3 main.py

You will be greeted by the main menu with the following options:

Option Description
FastDDS Setup Installs CMake, asio, and builds the full Fast DDS stack in ~/Fast-DDS/
ROS Packages Setup Manage ROS packages — install, update, delete, and build the catkin workspace
Quit Exit the application

Keyboard Shortcuts

Key Action
/ Navigate menus and tables
Enter Activate the focused button / submit input
d Toggle dark mode

FastDDS Setup Screen

  1. Optionally set a Robot ID (saved to ~/.bashrc as export ROBOT_ID="...").
  2. Click Run Setup — you will be prompted for your sudo password.
  3. DDS dependencies, libraries, and code-generation tools will be installed and built automatically.

ROS Packages Screen

The package table shows each configured package with its current and latest commit SHA, plus an update status. Context-sensitive buttons appear based on the selected package's state:

  • Install — Clone the repo (with submodules) into ~/catkin_ws/src/ and run post-install hooks.
  • Update — Pull the latest changes, sync submodules, and run post-update hooks.
  • Delete — Remove the package directory from the workspace.
  • Build Workspace — Run catkin build across the entire workspace.
  • Refresh — Re-check installation and version status for all packages.

📁 Project Structure

jetracer-setup-cli/
├── main.py                  # Application entry point
├── install.sh               # Bootstrap script (Python 3.8, venv, deps)
├── requirements.txt         # Python dependencies (textual, pyyaml)
├── Dockerfile               # Docker image definition (ros:melodic base)
├── docker-compose.yml       # Compose config with persistent volumes
├── tui/
│   ├── app.py               # Textual App — screen registration & routing
│   ├── styles.tcss           # Textual CSS stylesheet
│   └── screens/
│       ├── main_menu.py     # Main menu screen
│       ├── dds.py           # FastDDS setup screen (+ sudo modal)
│       └── ros.py           # ROS package management screen
└── utils/
    ├── executor.py          # Async command execution with live streaming
    ├── dds_setup.py         # DDS setup command list generator
    ├── ros_packages.py      # ROS package registry & workspace config
    └── robot_id.py          # ROBOT_ID read/write in ~/.bashrc

🐳 Docker

A Docker environment is provided for development and testing without physical JetRacer hardware.

Build and run

docker compose up -d --build

Attach to the container

docker compose exec -it jetracer bash

Launch the TUI inside the container

cd /app && python3 main.py

Key details

  • Base image: ros:melodic (Ubuntu 18.04)
  • User: jetracer (password: jetracer, has sudo)
  • Persistent volumes: catkin_ws and fast_dds survive container restarts
  • Network: Host mode for ROS communication

⚙️ Configuration

ROS Packages

Packages are defined in utils/ros_packages.py. Each entry specifies:

{
    "name": "package_name",                    # Directory name in ~/catkin_ws/src/
    "repo": "https://github.com/org/repo.git", # Git clone URL
    "branch": "main",                          # Branch to track
    "post_install_cmds": [...],                # Commands to run after install
    "post_update_cmds": [...]                  # Commands to run after update
}

The default workspace path is ~/catkin_ws/src (configured via ROS_WORKSPACE in the same file).

DDS Setup

DDS setup commands are generated dynamically in utils/dds_setup.py with automatic architecture detection for CMake downloads. The setup installs:

  • CMake 4.2.3
  • libasio-dev
  • foonathan_memory_vendor, Fast-CDR, Fast-DDS
  • OpenJDK 17 + Fast-DDS-Gen

📜 License

This project is part of the ESTACA Mini-Ville initiative.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors