Sub: Move SITL barometer check to control_check_barometer
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
This commit is contained in:
parent
f075d6bd93
commit
e62b560095
@ -341,6 +341,7 @@ void Sub::update_altitude()
|
||||
|
||||
bool Sub::control_check_barometer()
|
||||
{
|
||||
#if CONFIG_HAL_BOARD != HAL_BOARD_SITL
|
||||
if (!ap.depth_sensor_present) { // can't hold depth without a depth sensor
|
||||
gcs().send_text(MAV_SEVERITY_WARNING, "Depth sensor is not connected.");
|
||||
return false;
|
||||
@ -348,6 +349,7 @@ bool Sub::control_check_barometer()
|
||||
gcs().send_text(MAV_SEVERITY_WARNING, "Depth sensor error.");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -8,11 +8,9 @@
|
||||
// althold_init - initialise althold controller
|
||||
bool Sub::althold_init()
|
||||
{
|
||||
#if CONFIG_HAL_BOARD != HAL_BOARD_SITL
|
||||
if(!control_check_barometer()) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
// initialize vertical speeds and leash lengths
|
||||
// sets the maximum speed up and down returned by position controller
|
||||
|
@ -3,11 +3,9 @@
|
||||
|
||||
bool Sub::surface_init()
|
||||
{
|
||||
#if CONFIG_HAL_BOARD != HAL_BOARD_SITL
|
||||
if(!control_check_barometer()) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
// initialize vertical speeds and leash lengths
|
||||
pos_control.set_speed_z(wp_nav.get_speed_down(), wp_nav.get_speed_up());
|
||||
|
Loading…
Reference in New Issue
Block a user