ArduSub is the ArduPilot firmware for underwater vehicles. It targets remotely operated vehicles (ROVs) operated by a topside joystick, as well as autonomous underwater vehicles (AUVs) executing pre-planned missions. The vehicle code lives inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Ardupilot/ardupilot/llms.txt
Use this file to discover all available pages before exploring further.
ArduSub/ and compiles to the ardusub binary. ArduSub shares the same core library stack as every other ArduPilot vehicle while adding subsystems specific to underwater operation: leak detection, depth pressure sensing, and thruster mixing for vectored-thrust frames.
Flight modes
11 modes from manual pass-through to fully autonomous waypoint navigation and depth tracking.
Depth hold
AltHold and SurfTrak modes maintain a constant depth or constant distance above the seafloor.
Leak detection
The
AP_LeakDetector library monitors leak sensors and triggers configurable failsafe responses.Joystick control
joystick.cpp maps a six-degrees-of-freedom joystick to thruster outputs for manual ROV piloting.Supported vehicle types
ArduSub supports multiple underwater vehicle configurations selected through theFRAME_CONFIG parameter.
| Vehicle type | Description |
|---|---|
| BlueROV2 (Heavy) | 8-thruster vectored frame, the reference platform for ArduSub development |
| BlueROV2 (Standard) | 6-thruster frame with 4 horizontal and 2 vertical thrusters |
| Vectored 6DOF | Generic 6-degree-of-freedom thruster layout |
| SimpleROV | 3-thruster basic frame for entry-level builds |
| Custom | Configurable thruster count and orientation via MOT_ parameters |
ArduSub supports the Blue Robotics Navigator board — a Raspberry Pi HAT with IMU, barometer, and PWM outputs — as a low-cost Linux-based autopilot. Build with
./waf configure --board navigator when targeting this hardware.Flight modes
All modes are defined inArduSub/mode.h. Mode numbers match the values reported to ground stations over MAVLink.
| # | Mode | GPS required | Description |
|---|---|---|---|
| 0 | Stabilize | No | Attitude-stabilized with manual depth control |
| 1 | Acro | No | Body-frame angular rate control, manual throttle |
| 2 | AltHold | No | Attitude-stabilized with automatic depth hold |
| 3 | Auto | Yes | Fully automatic waypoint mission |
| 4 | Guided | Yes | Navigate to GCS-commanded positions |
| 7 | Circle | Yes | Automatic circular orbit at constant depth |
| 9 | Surface | No | Automatically ascend to the surface; pilot keeps horizontal control |
| 16 | PosHold | Yes | Automatic 3D position hold with manual override |
| 19 | Manual | No | Direct pass-through to thrusters, no stabilization |
| 20 | MotorDetect | No | Automated motor orientation and direction detection |
| 21 | SurfTrak | No | Hold a constant distance above the seafloor using a downward rangefinder |
Key features
SurfTrak mode
Tracks a configurable range above the seafloor using a downward-facing rangefinder or USBL, ideal for bottom surveys.
Leak detection
AP_LeakDetector polls one or more leak sensors and can trigger emergency surface ascent.6-DOF thruster mixing
The motor mixing system supports fully vectored frames with independent surge, sway, heave, roll, pitch, and yaw axes.
Joystick input
joystick.cpp decodes MAVLink MANUAL_CONTROL messages so a gamepad or joystick controls the ROV directly.Script buttons
script_button.cpp maps button inputs to Lua script triggers, enabling custom topside panel controls.Underwater positioning
ArduSub accepts external position updates from USBL, LBL, or DVL systems via MAVLink
VISION_POSITION_ESTIMATE.Depth and altitude control
ArduSub uses barometric pressure from a water-rated depth sensor (e.g., Blue Robotics Bar30) for depth estimation. The sensor is read through the standardAP_Baro library, which reports depth when the vehicle is detected as underwater.
- AltHold
- SurfTrak
- PosHold
Holds a constant depth using the barometric depth reading. The pilot controls roll, pitch, and yaw while the autopilot manages the vertical thrusters to maintain depth. Depth setpoint is updated by the pilot’s vertical joystick input.
Building
Libraries linked by wscript
TheArduSub/wscript file lists the vehicle-specific libraries added on top of the common set.
| Library | Purpose |
|---|---|
AC_AttitudeControl | Roll, pitch, yaw, and depth attitude controllers |
AC_WPNav | Waypoint, loiter, and circle navigation |
AP_Camera | Camera trigger control |
AP_InertialNav | Inertial navigation blending for position hold |
AP_JSButton | Joystick button mapping to vehicle actions |
AP_LeakDetector | Leak sensor polling and failsafe triggering |
AP_Motors | Thruster output mixing and PWM generation |
AP_TemperatureSensor | Onboard temperature monitoring |