mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-18 06:38:29 -04:00
GCS_MAVLink: Fix Airspeed without AHRS
This commit is contained in:
parent
8b50f3b54b
commit
c19e5713ae
@ -2331,7 +2331,7 @@ void GCS_MAVLINK::send_scaled_pressure3()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if AP_AIRSPEED_ENABLED
|
#if AP_AIRSPEED_ENABLED
|
||||||
void GCS_MAVLINK::send_airspeed()
|
void GCS_MAVLINK::send_airspeed()
|
||||||
{
|
{
|
||||||
AP_Airspeed *airspeed = AP_Airspeed::get_singleton();
|
AP_Airspeed *airspeed = AP_Airspeed::get_singleton();
|
||||||
if (airspeed == nullptr) {
|
if (airspeed == nullptr) {
|
||||||
@ -2357,11 +2357,13 @@ void GCS_MAVLINK::send_airspeed()
|
|||||||
flags |= 1U << AIRSPEED_SENSOR_FLAGS::AIRSPEED_SENSOR_UNHEALTHY;
|
flags |= 1U << AIRSPEED_SENSOR_FLAGS::AIRSPEED_SENSOR_UNHEALTHY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if AP_AHRS_ENABLED
|
||||||
// Set using flag if the AHRS is using this sensor
|
// Set using flag if the AHRS is using this sensor
|
||||||
const AP_AHRS &ahrs = AP::ahrs();
|
const AP_AHRS &ahrs = AP::ahrs();
|
||||||
if (ahrs.using_airspeed_sensor() && (ahrs.get_active_airspeed_index() == index)) {
|
if (ahrs.using_airspeed_sensor() && (ahrs.get_active_airspeed_index() == index)) {
|
||||||
flags |= 1U << AIRSPEED_SENSOR_FLAGS::AIRSPEED_SENSOR_USING;
|
flags |= 1U << AIRSPEED_SENSOR_FLAGS::AIRSPEED_SENSOR_USING;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Assemble message and send
|
// Assemble message and send
|
||||||
const mavlink_airspeed_t msg {
|
const mavlink_airspeed_t msg {
|
||||||
@ -2380,7 +2382,7 @@ void GCS_MAVLINK::send_airspeed()
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif // AP_AIRSPEED_ENABLED
|
||||||
|
|
||||||
#if AP_AHRS_ENABLED
|
#if AP_AHRS_ENABLED
|
||||||
void GCS_MAVLINK::send_ahrs()
|
void GCS_MAVLINK::send_ahrs()
|
||||||
|
Loading…
Reference in New Issue
Block a user