ROS 2 workspace for the underdog autonomous vehicle platform developed for the master's thesis Comparing Gradient-Based and Sampling-Based Model Predictive Control for Autonomous Racing, see the paper here.
The vehicle is based on a Traxxas Slash 4x4 chassis with all-wheel drive, powered by a Velineon 3500 motor and controlled via a VXL-3s ESC. Steering is handled by a TRX-2255 servo, while power is supplied by interchangeable NiMH or LiPo batteries.
For autonomy, the car is equipped with an Intel NUC 13 Pro (i7 CPU, 32 GB RAM) running Ubuntu 22.04 and ROS2 Humble, paired with an Arduino Nano Every that generates PWM signals for motor and steering control. High-precision odometry is provided by a Movella Xsens MTi-680G INS with an RTK-enabled GNSS receiver, achieving ~1 cm accuracy via NTRIP corrections. A DC/DC converter stabilizes power delivery, and a Logitech F710 gamepad provides manual control.
All components are mounted on custom 3D-printed platforms, bringing the vehicle mass to ~4.75 kg.
The workspace contains multiple packages that support both simulation and real-world driving:
- controller – vehicle control algorithms and logic.
- node_manager – lifecycle management, gamepad interface, and configuration of ROS nodes.
- odometry – estimation of the vehicle pose from sensor data (INS interface).
- path_publisher – publication of reference paths for control.
- sim_dynamics and sim_scope – lightweight vehicle simulation and visualization tools.
- underdog – launch files and utilities tying the system together.
- underdog_msgs – custom ROS 2 message definitions.
Additional directories contain prototypes, hardware interfaces, and supporting utilities:
- arduino – interface for PWM control of the ESC and steering servo via Arduino.
- controller_proto – Python prototypes for rapid controller development and testing.
- sys_id – tools for data collection, system identification, and performance analysis.
- Xsens_MTi_ROS_Driver_and_Ntrip_Client – vendor-provided driver and NTRIP client for the Xsens INS.
Make sure your system is running Ubuntu 22.04 LTS (containerization support has not been taken into account here).
- Install ROS2 Humble and the required dependencies, see the docs here.
- Clone this repository with submodules, i.e.
git clone --recurse-submodules [email protected]:coding-leonid/underdog_ws.git- Go into the repository root folder and build it with
colcon build --symlink-install(the--symlink-installflag is required for reading ROS parameters). - Source the workspace:
source install/setup.bash.
Software state machine control:
- Button 5 – Toggle activation of lifecycle nodes (except the controller node).
- Button 1 – Toggle activation of controller node.
Manual vehicle control:
- Button 7 – Forward throttle (gas).
- Button 6 – Reverse throttle (brake/reverse).
- Axis 0 – Steering.
NOTE. Manual vehicle control is deactivated when controller is activated (or if the lifecycle nodes have not been activated).
WARNING! The controller is NOT deactivated when button 5 is pressed, i.e. autonomous driving can only be stopped by pressing button 1.
Detailed instructions and examples are available in the docs directory:
- Running the simulation
- Running on the vehicle
- Adding a vehicle model
- Adding a controller
- Controller prototyping
This project is licensed under the MIT License. You are free to use, modify, and distribute the code, provided that the original copyright and license notice are included in any copies or substantial portions of the software.

