mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-03 04:03:59 -04:00
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()
|
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
|
if (!ap.depth_sensor_present) { // can't hold depth without a depth sensor
|
||||||
gcs().send_text(MAV_SEVERITY_WARNING, "Depth sensor is not connected.");
|
gcs().send_text(MAV_SEVERITY_WARNING, "Depth sensor is not connected.");
|
||||||
return false;
|
return false;
|
||||||
@ -348,6 +349,7 @@ bool Sub::control_check_barometer()
|
|||||||
gcs().send_text(MAV_SEVERITY_WARNING, "Depth sensor error.");
|
gcs().send_text(MAV_SEVERITY_WARNING, "Depth sensor error.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,11 +8,9 @@
|
|||||||
// althold_init - initialise althold controller
|
// althold_init - initialise althold controller
|
||||||
bool Sub::althold_init()
|
bool Sub::althold_init()
|
||||||
{
|
{
|
||||||
#if CONFIG_HAL_BOARD != HAL_BOARD_SITL
|
|
||||||
if(!control_check_barometer()) {
|
if(!control_check_barometer()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// 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
|
||||||
|
@ -3,11 +3,9 @@
|
|||||||
|
|
||||||
bool Sub::surface_init()
|
bool Sub::surface_init()
|
||||||
{
|
{
|
||||||
#if CONFIG_HAL_BOARD != HAL_BOARD_SITL
|
|
||||||
if(!control_check_barometer()) {
|
if(!control_check_barometer()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// initialize vertical speeds and leash lengths
|
// initialize vertical speeds and leash lengths
|
||||||
pos_control.set_speed_z(wp_nav.get_speed_down(), wp_nav.get_speed_up());
|
pos_control.set_speed_z(wp_nav.get_speed_down(), wp_nav.get_speed_up());
|
||||||
|
Loading…
Reference in New Issue
Block a user