mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 00:28:30 -04:00
AP_Airspeed: correct compilation when AP_AIRSPEED_AUTO_CAL_ENABLE is false
CubeNode was trying to check a parameter which doesn't exist ../../libraries/AP_Airspeed/Airspeed_Calibration.cpp: In member function 'void AP_Airspeed::send_airspeed_calibration(const Vector3f&)': ../../libraries/AP_Airspeed/Airspeed_Calibration.cpp:179:23: error: 'class AP_Airspeed_Params' has no member named 'autocal' 179 | if (!param[i].autocal && !calibration_enabled) { | ^~~~~~~ compilation terminated due to -Wfatal-errors.
This commit is contained in:
parent
7a16bf1987
commit
439c85e793
@ -164,11 +164,13 @@ void AP_Airspeed::update_calibration(const Vector3f &vground, int16_t max_airspe
|
|||||||
for (uint8_t i=0; i<AIRSPEED_MAX_SENSORS; i++) {
|
for (uint8_t i=0; i<AIRSPEED_MAX_SENSORS; i++) {
|
||||||
update_calibration(i, vground, max_airspeed_allowed_during_cal);
|
update_calibration(i, vground, max_airspeed_allowed_during_cal);
|
||||||
}
|
}
|
||||||
|
#if HAL_GCS_ENABLED && AP_AIRSPEED_AUTOCAL_ENABLE
|
||||||
send_airspeed_calibration(vground);
|
send_airspeed_calibration(vground);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if HAL_GCS_ENABLED
|
#if HAL_GCS_ENABLED && AP_AIRSPEED_AUTOCAL_ENABLE
|
||||||
void AP_Airspeed::send_airspeed_calibration(const Vector3f &vground)
|
void AP_Airspeed::send_airspeed_calibration(const Vector3f &vground)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -180,7 +182,6 @@ void AP_Airspeed::send_airspeed_calibration(const Vector3f &vground)
|
|||||||
// auto-calibration not enabled on this sensor
|
// auto-calibration not enabled on this sensor
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#if AP_AIRSPEED_AUTOCAL_ENABLE
|
|
||||||
const mavlink_airspeed_autocal_t packet{
|
const mavlink_airspeed_autocal_t packet{
|
||||||
vx: vground.x,
|
vx: vground.x,
|
||||||
vy: vground.y,
|
vy: vground.y,
|
||||||
@ -199,8 +200,7 @@ void AP_Airspeed::send_airspeed_calibration(const Vector3f &vground)
|
|||||||
(const char *)&packet);
|
(const char *)&packet);
|
||||||
break; // we can only send for one sensor
|
break; // we can only send for one sensor
|
||||||
}
|
}
|
||||||
#endif // AP_AIRSPEED_AUTOCAL_ENABLE
|
|
||||||
}
|
}
|
||||||
#endif // HAL_GCS_ENABLED
|
#endif // HAL_GCS_ENABLED && AP_AIRSPEED_AUTOCAL_ENABLE
|
||||||
|
|
||||||
#endif // AP_AIRSPEED_ENABLED
|
#endif // AP_AIRSPEED_ENABLED
|
||||||
|
Loading…
Reference in New Issue
Block a user