ArduPlane: add airspeed estimate status logging

This commit is contained in:
Henry Wurzburg 2023-10-02 20:43:49 -05:00 committed by Randy Mackay
parent 5a64cc9e8e
commit 7c46585bac

View File

@ -79,6 +79,7 @@ struct PACKED log_Control_Tuning {
float rudder_out;
float throttle_dem;
float airspeed_estimate;
uint8_t airspeed_estimate_status;
float synthetic_airspeed;
float EAS2TAS;
int32_t groundspeed_undershoot;
@ -88,7 +89,8 @@ struct PACKED log_Control_Tuning {
void Plane::Log_Write_Control_Tuning()
{
float est_airspeed = 0;
ahrs.airspeed_estimate(est_airspeed);
AP_AHRS::AirspeedEstimateType airspeed_estimate_type = AP_AHRS::AirspeedEstimateType::NO_NEW_ESTIMATE;
ahrs.airspeed_estimate(est_airspeed, airspeed_estimate_type);
float synthetic_airspeed;
if (!ahrs.synthetic_airspeed(synthetic_airspeed)) {
@ -106,6 +108,7 @@ void Plane::Log_Write_Control_Tuning()
rudder_out : SRV_Channels::get_output_scaled(SRV_Channel::k_rudder),
throttle_dem : TECS_controller.get_throttle_demand(),
airspeed_estimate : est_airspeed,
airspeed_estimate_status : (uint8_t)airspeed_estimate_type,
synthetic_airspeed : synthetic_airspeed,
EAS2TAS : ahrs.get_EAS2TAS(),
groundspeed_undershoot : groundspeed_undershoot,
@ -303,15 +306,17 @@ const struct LogStructure Plane::log_structure[] = {
// @Field: NavPitch: desired pitch
// @Field: Pitch: achieved pitch
// @Field: ThO: scaled output throttle
// @Field: RdrOut: scaled output rudder
// @Field: RdO: scaled output rudder
// @Field: ThD: demanded speed-height-controller throttle
// @Field: As: airspeed estimate (or measurement if airspeed sensor healthy and ARSPD_USE>0)
// @Field: SAs: DCM's airspeed estimate, NaN if not available
// @Field: AsT: airspeed type ( old estimate or source of new estimate)
// @FieldValueEnum: AsT: AP_AHRS::AirspeedEstimateType
// @Field: E2T: equivalent to true airspeed ratio
// @Field: GU: groundspeed undershoot when flying with minimum groundspeed
{ LOG_CTUN_MSG, sizeof(log_Control_Tuning),
"CTUN", "Qccccffffffi", "TimeUS,NavRoll,Roll,NavPitch,Pitch,ThO,RdrOut,ThD,As,SAs,E2T,GU", "sdddd---nn-n", "FBBBB---00-B" , true },
"CTUN", "QccccffffBffi", "TimeUS,NavRoll,Roll,NavPitch,Pitch,ThO,RdO,ThD,As,AsT,SAs,E2T,GU", "sdddd---n-n-n", "FBBBB---000-B" , true },
// @LoggerMessage: NTUN
// @Description: Navigation Tuning information - e.g. vehicle destination