ROS 2 colcon workspace for the SOMARS autonomous drone (C-UASC 2026). This repo ties together all subsystems via git submodules.
git clone --recurse-submodules https://github.com/Slugbotics/somars-main.git
cd somars-maingit submodule update --init --recursivegit pull --recurse-submodules
# or try this if above doesn't work
git submodule update --remote# One command to start everything:
./start.sh
# Or step by step:
./start.sh --no-vision # Controls only (for testing)
./start.sh --sim # Simulation (mock nodes, no hardware)The start script handles: micro-XRCE-DDS Agent → somars-embedded nodes → somars-vision.
# Terminal 1 — micro-XRCE-DDS Agent (bridge PX4 ↔ ROS 2)
MicroXRCEAgent serial --dev /dev/ttyTHS1 -b 921600
# Terminal 2 — build & launch controls
colcon build --packages-select somars_controls
source install/setup.bash
ros2 launch somars_controls controls.launch.py
# Terminal 3 — vision
python3 src/somars-vision/main.pyros2 topic echo /fmu/out/vehicle_local_position # PX4 position
ros2 topic echo /vision/detections # pixel detections from vision
ros2 topic echo /targets/ned # NED target from localizer
ros2 topic echo /fmu/in/trajectory_setpoint # setpoints going to PX4Pixhawk 6x -UART-> Jetson Orin Nano
micro-XRCE-DDS Agent bridges this serial link into ROS 2
| Submodule | Repo | Purpose |
|---|---|---|
src/somars-embedded |
Slugbotics/somars-embedded | Offboard manager, guidance node, target localizer |
src/somars-vision |
Slugbotics/somars-vision | YOLO detection, MJPEG streaming, orthophoto mapping |
src/px4_msgs |
PX4/px4_msgs | PX4 ROS 2 message definitions |
- ROS 2 Humble or Jazzy
- Eigen3
- micro-XRCE-DDS Agent (run separately on Jetson)
- JetPack 6.2.2 (on Jetson Orin Nano)
- Python 3 +
rclpy,ultralytics,opencv-python(for vision)
- Calibrate camera (if not done):
python3 src/somars-embedded/tools/calibrate_camera.py --camera 0 --cols 9 --rows 6 --square-size 0.025 - Edit waypoints in
src/somars-embedded/config/waypoints.yaml(GPS coords given at check-in, altitudes in meters MSL) - Set geofence in QGroundControl
- Start the stack:
./start.sh - Monitor in QGroundControl (telemetry + map view)