ArduPilot / ArduPilot/ardupilot
Sub/Boat: add autotests for core features
- Dominant language
- C++
- Stars
- 15.9k
- Forks
- 21.4k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 119
Description
## Feature request
**Is your feature request related to a problem? Please describe.**
ArduSub and ArduRover boat vehicles have some unique features compared to other vehicle types, and are often controlled in different ways, many of which aren't yet covered by [autotests](https://ardupilot.org/dev/docs/the-ardupilot-autotest-framework.html).
**Describe the solution you'd like**
Add autotests for the following features (where indicated as relevant for the vehicle type):
> Key:
> - ❗️ → autotest needed
> - 〰️ → maybe useful, but not essential
> - ✅ → autotest already available
> - ❎ → not needed / not (currently) relevant
| Feature | Sub? | Boat? | Notes |
| --- | --- | --- | --- |
| MAVLink [`MANUAL_CONTROL`](https://mavlink.io/en/messages/common.html#MANUAL_CONTROL) axes | ❗️ | [✅](https://github.com/ArduPilot/ardupilot/blob/ArduPilot-4.6/Tools/autotest/rover.py#L1077) | Used for GCS control by a joystick. Include roll/pitch axes for Sub, and yaw for Rover. |
| MAVLink [`MANUAL_CONTROL`](https://mavlink.io/en/messages/common.html#MANUAL_CONTROL) buttons | ❗️ | ❎ | Used for GCS control by a joystick |
| Joystick roll/pitch trim button functions | ❗️ | ❎ | joystick attitude control |
| Joystick pilot gain inc/dec button functions | ❗️ | ❎ | joystick speed control |
| [Pilot control failsafe](https://ardupilot.org/sub/docs/pilot-control-failsafe.html) | ❗️ | ❎ | |
| [Normal](https://ardupilot.org/sub/docs/parameters.html#mot-pwm-type-output-pwm-type) PWM motors | ❗️ | ❎ | `MOT_PWM_MIN`/`MAX`/`REVERSED` |
| Trimmable ([PWMAngle](https://ardupilot.org/sub/docs/parameters.html#mot-pwm-type-output-pwm-type)) motors | ❗️ | ❎ | `SERVOn_MIN`/`MAX`/`REVERSE` |
| Vectored 6DoF [frame](https://ardupilot.org/sub/docs/parameters.html#frame-config-frame-configuration) | ❗️ | ❎ | |
| [`MOTOR_DETECT`](https://ardupilot.org/sub/docs/modes.html) mode | ❗️ | ❎ | automatic motor reversal detection |
| [`AHRS_ORIENTATION`](https://ardupilot.org/sub/docs/parameters.html#ahrs-orientation-board-orientation) | ❗️ | ❗️ | accel / gyro orientation offset |
| [INS position offset](https://ardupilot.org/rover/docs/parameters.html#ins-pos1-x-imu-accelerometer-x-position) | 〰️ | ❗️| |
| `TetherTrn` reports | ❗️ | ❎ | [`NAMED_VALUE_FLOAT`](https://mavlink.io/en/messages/common.html#NAMED_VALUE_FLOAT) messages tracking cumulative yaw turns |
| Baro offset calibration | ❗️ | ❎ | Can be done manually, and happens automatically if the reading reports a positive altitude (negative depth) |
| Distance sensor position and orientation offsets | ❗️ | ❗️ | Critical for bathymetry, important for some obstacle avoidance |
| [compass motor compensation](https://ardupilot.org/copter/docs/common-compass-setup-advanced.html#compassmot-compensation-for-interference-from-the-power-wires-escs-and-motors) | ❗️ | ❗️ | not (yet) frequently used |
| Leak failsafe | ❗️ | ❎ | |
| [`VISO_ORIENT`](https://ardupilot.org/sub/docs/parameters.html#viso-orient-visual-odometery-camera-orientation) | ❗️ | 〰️ | DVL orientation |
| MAVLink [`GPS_INPUT`](https://mavlink.io/en/messages/common.html#GPS_INPUT) | ❗️ | 〰️ | Used by some positioning systems |
| GPS heading | [✅](https://github.com/ArduPilot/ardupilot/blob/ArduPilot-4.7/Tools/autotest/ardusub.py#L780) | [✅](https://github.com/ArduPilot/ardupilot/pull/32521) | |
| GPS [antenna position offset](https://ardupilot.org/rover/docs/parameters.html#gps1-pos-x-antenna-x-position-offset) | ❎ | [✅](https://github.com/ArduPilot/ardupilot/pull/32536) | |
| MAVLink [`AP_ADC`](https://mavlink.io/en/messages/ardupilotmega.html#AP_ADC) | 〰️ | 〰️ | ADC feedback |
| EKF failsafe | 〰️ | ❗️ | |
| Lights1/2 output functions | ❗️ | ❎ | [`SERVOn_FUNCTION`](https://ardupilot.org/sub/docs/parameters.html#servo1-function-servo-output-function), Lights1/2 [`NAMED_VALUE_FLOAT`](https://mavlink.io/en/messages/common.html#NAMED_VALUE_FLOAT) messages, servo PWM range, duty-cycle PWM range, joystick inc/dec buttons, [`JS_LIGHTS_STEPS`](https://ardupilot.org/sub/docs/parameters.html#js-lights-steps-lights-brightness-steps) param |
| Mount tilt servo | ❗️ | ❎ | PWM range, rate-based stabilised angle control, joystick button inc/dec, CamTilt [`NAMED_VALUE_FLOAT`](https://mavlink.io/en/messages/common.html#NAMED_VALUE_FLOAT) messages |
| Gripper | ❗️ | ❎ | Rate-control servo-style PWM, joystick momentary button functions |
| Relay control | ❗️ | [✅](https://github.com/ArduPilot/ardupilot/blob/ArduPilot-4.6/Tools/autotest/rover.py#L556) | on/off joystick button functions, [`MAV_CMD_DO_SET_RELAY`](https://mavlink.io/en/messages/common.html#MAV_CMD_DO_SET_RELAY) programmatic/GCS control, [`RELAY_STATUS`](https://mavlink.io/en/messages/common.html#RELAY_STATUS) reporting |
| MAVLink [`RC_CHANNELS_OVERRIDE`](https://mavlink.io/en/messages/common.html#RC_CHANNELS_OVERRIDE) support | ❗️ | ❎ | RC-like programmatic control |
**Describe alternatives you've considered**
Manual testing is generally possible, and should sometimes still be used as well, but is often less comprehensive and less convenient than regular automated tests which ensure features continue to work (particularly at the PR level).
**Platform**
[ ] All
[ ] AntennaTracker
[ ] Copter
[ ] Plane
[x] Rover
[x] Submarine
**Additional context**
I'm planning to work on these, but figured it doesn't hurt to share the list in case anyone wants to help.
List derived from a WIP [spreadsheet of features and firmware release tests](https://docs.google.com/spreadsheets/d/1ocXJxLq5iqt1vfY44bLjV7AJApmLLYg0DasRq-RDLMw/edit?gid=548439307#gid=548439307) from Blue Robotics, intended for testing ROVs and skid-steer boats.
Contributor guide
Research direction
Start with the ArduPilot autotest framework documentation and the existing vehicle tests in Tools/autotest/ardusub.py and Tools/autotest/rover.py, including the linked examples for GPS heading and relay control. Choose one missing Sub or Rover feature from the table, identify its matching test entry point, and confirm that the completed autotest passes for the relevant vehicle.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- embedded-iot, robotics, testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100