A ROS2 Jazzy monorepo for simulating and controlling fixed-wing aircraft using the SportCub aircraft model. This workspace provides complete simulation, visualization, planning, and control capabilities for autonomous fixed-wing aircraft.
📚 Full Documentation | Installation Guide | Quick Start
Message definitions for aircraft control and telemetry.
AircraftControl.msg- Normalized control inputs (aileron, elevator, rudder, throttle)
Aircraft description files: URDF models and 3D meshes for the SportCub.
Racecourse configurations: gate and pylon definitions in YAML format, visualization markers.
Data files including rosbag recordings and reference flight data.
Aircraft dynamics modeling and analysis tools using CasADi.
- Differentiable dynamics models
- Linearization and trim analysis
- Numerical integration
Control algorithms for aircraft (used in simulation and hardware).
- Autolevel attitude stabilization controller
- Closed-loop system composition (aircraft + controller)
- PID controller implementation
- Reusable across simulation and real hardware
Simulation nodes and runtime.
- SportCub simulation node
- Gamepad/keyboard control interfaces
- TF broadcasting
Path planning algorithms for autonomous flight.
- Dubins path planner for racecourse navigation
- Waypoint gate management
Custom RViz panel plugins:
- Virtual joystick for manual control
- Simulation control (reset, pause, speed)
- HUD for telemetry display
Launch files for starting complete systems (simulation, visualization, planning).
# Build workspace
cd /path/to/your/workspace
colcon build --symlink-install
source install/setup.bash
# Launch simulation with visualization (all-in-one)
ros2 launch cubs2_bringup sim.xmlThis single command starts simulation, visualization, and replay by default.
Customize the launch with optional arguments:
# Disable visualization
ros2 launch cubs2_bringup sim.xml viz:=false
# Disable replay
ros2 launch cubs2_bringup sim.xml replay:=false
# Enable gamepad control
ros2 launch cubs2_bringup sim.xml gamepad:=true
# Launch only specific components
ros2 launch cubs2_bringup viz.xml # Visualization only
ros2 launch cubs2_bringup gamepad_control.xml # Gamepad onlyReplay is enabled by default, showing a "ghost" plane following recorded flight data. The replay loops continuously for easy comparison with live simulation.
# Use different bag file
ros2 launch cubs2_bringup sim.xml bag_path:=/path/to/your/bag.mcap| Topic | Type | Description |
|---|---|---|
/control |
cubs2_msgs/AircraftControl |
Control inputs to aircraft |
/pose |
geometry_msgs/PoseStamped |
Aircraft pose |
/imu |
sensor_msgs/Imu |
IMU data from simulation |
/racecourse/gates |
visualization_msgs/MarkerArray |
Racecourse gate markers |
- ROS2 Jazzy
- Python 3.12+
- NumPy
- CasADi (for dynamics modeling)
- Qt5 (for RViz panels)
# Build all packages
colcon build --symlink-install
# Run tests and linting (standard ROS 2 approach)
colcon test
colcon test-result --verbose
# Run tests for specific packages
colcon test --packages-select cubs2_dynamics cubs2_controlThis project follows standard ROS 2 linting practices using ament tools:
Python linting (ament_flake8, ament_pep257):
- Automatically checked via
colcon test - Style: PEP 8 with 99-character line limit
- Docstrings: NumPy-style (PEP 257 compliant)
C++ linting (ament_cpplint, ament_uncrustify):
- Automatically checked via
colcon test - Style: ROS 2 C++ style guide
All linters configured in package.xml:
ament_copyright- License header validationament_flake8- Python style checkingament_pep257- Python docstring validationament_cpplint- C++ style checkingament_uncrustify- C++ code formattingament_lint_cmake- CMake lintingament_xmllint- XML validation
Run linters separately:
# Check Python code style
ament_flake8 src/cubs2/cubs2_dynamics
# Check Python docstrings
ament_pep257 src/cubs2/cubs2_dynamics
# Check C++ code
ament_cpplint src/cubs2/cubs2_rviz- Hierarchical Model Composition: Compose aircraft dynamics and controllers into integrated systems
- Type-Safe Modeling: Structured state/input/output access with dataclasses
- Single Integration Loop: Numerically accurate unified integration of all subsystems
- Dubins Path Planning: Optimal path generation through waypoint gates
- Physics-Based Simulation: CasADi-based differentiable dynamics
- RViz Integration: 3D visualization with custom panels
- Configurable Racecourses: YAML-based gate definitions
- Replay Support: Compare simulation with recorded flights
Each package has detailed documentation in its own README:
- cubs2_msgs - Message definitions
- cubs2_description - Aircraft URDF and meshes
- cubs2_data - Rosbag data files
- cubs2_dynamics - Dynamics modeling
- cubs2_control - Control algorithms
- cubs2_simulation - Simulation runtime
- cubs2_planning - Path planning
- cubs2_rviz - RViz plugins
- cubs2_bringup - Launch files
- racecourse_description - Racecourse configuration
Apache-2.0
