mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-02 14:08:45 -04:00
Sub: lock out depth hold mode if no external sensor is present
This commit is contained in:
parent
4a1c6fc46c
commit
a217b4c684
@ -9,6 +9,11 @@
|
|||||||
// althold_init - initialise althold controller
|
// althold_init - initialise althold controller
|
||||||
bool Sub::althold_init(bool ignore_checks)
|
bool Sub::althold_init(bool ignore_checks)
|
||||||
{
|
{
|
||||||
|
if(!ap.depth_sensor_present) { // can't hold depth without a depth sensor, exit immediately.
|
||||||
|
gcs_send_text(MAV_SEVERITY_WARNING, "Depth hold requires external pressure sensor.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// initialize vertical speeds and leash lengths
|
// initialize vertical speeds and leash lengths
|
||||||
// sets the maximum speed up and down returned by position controller
|
// sets the maximum speed up and down returned by position controller
|
||||||
pos_control.set_speed_z(-g.pilot_velocity_z_max, g.pilot_velocity_z_max);
|
pos_control.set_speed_z(-g.pilot_velocity_z_max, g.pilot_velocity_z_max);
|
||||||
|
Loading…
Reference in New Issue
Block a user