Sub Modes¶
Sub has the following modes:
legend for requirements: P - needs Position(GPS,etc.), D - needs Depth sensor, R - needs Rangefinder
Mode |
Description |
Requires |
|---|---|---|
MANUAL |
Pilot control with no stabilization |
- |
ACRO |
Body-frame rate control, manual depth control |
- |
STABILIZE |
Manual angle control, manual depth control |
- |
ALT_HOLD |
Stabilize with automatic depth control |
D |
AUTO |
Automatic mission command list execution |
P/D |
GUIDED |
Swim to location or velocity/direction using GCS |
P/D |
CIRCLE |
Circle swim with depth control |
P/D |
SURFACE |
Return to surface, pilot directional control |
- |
POSHOLD |
Loiter with depth control and pilot overrides |
P/D |
MOTOR_DETECT |
Automatically determine motor rotation and adjust |
- |
SURFTRAK |
Hold distance above seafloor while stabilizing |
R |
See Pilot Control for more details on modes.
Mode Details¶
ACRO Mode¶
ALT_HOLD Mode¶
GUIDED Mode¶
In GUIDED mode the vehicle is commanded by a GCS, companion computer or Lua script. Position, velocity and acceleration targets can be sent using SET_POSITION_TARGET_LOCAL_NED or SET_POSITION_TARGET_GLOBAL_INT, with the type_mask field selecting which of the three are being supplied. The accepted combinations are:
position only
velocity only
position and velocity
position, velocity and acceleration
Any other combination, such as velocity with acceleration, is ignored.
A target that includes velocity describes one point on a moving trajectory: where the vehicle should be, and how it should be moving, at the moment the message is received. It is not a destination to stop at. Between messages the target keeps moving: its position advances by the target velocity, and its velocity changes by the target acceleration. The vehicle follows this moving target, so targets would normally be sent several times per second along the desired path. For example, a target with a forward acceleration makes the vehicle start speeding up immediately, rather than when it reaches the target position. Because the velocity and acceleration move the target position, they never conflict with it: a velocity pointing away from the sent position simply moves the target away from that position.
The vehicle’s speed and acceleration while following the target, including the target’s own velocity and acceleration, are limited by WP_SPD, WP_SPD_UP, WP_SPD_DN, WP_ACC and WP_ACC_Z. A target that moves faster than these limits is followed with a lag.
If no new target is received for 3 seconds, the velocity and acceleration targets are set to zero and the vehicle holds the last target position. To swim to a location and stop there, send a position-only target, which uses waypoint navigation at WP_SPD.
Lua scripts can send the same targets with vehicle:set_target_posvelaccel_NED(), and can offset the vehicle’s current target using the poscontrol bindings, poscontrol:set_posvelaccel_offset() and poscontrol:get_posvelaccel_offset(). The guided_above_terrain_posvelaccel_sub.lua example script uses these to swim at a constant forward speed while holding a set height above the seafloor.
CIRCLE Mode¶
Mode Selection¶
By default modes are controlled via MAVLink command from the GCS or companion computer, or by Joystick Buttons. But RC control can be enabled by setting:
RC_PROTOCOLS not equal to zero (“1” is usually used)
FLTMODE_CH to the RC channel which will control swim mode selection
FLTMODE1 - FLTMODE6to desired Swim Mode