AP_Soaring: allow compilation with HAL_LOGGING_ENABLED false

This commit is contained in:
Peter Barker 2023-07-14 10:58:08 +10:00 committed by Andrew Tridgell
parent 5bb3e0aa18
commit 7d798943fc
2 changed files with 9 additions and 1 deletions

View File

@ -337,6 +337,7 @@ void SoaringController::update_thermalling()
_position_x_filter.apply(_ekf.X[2], deltaT);
_position_y_filter.apply(_ekf.X[3], deltaT);
#if HAL_LOGGING_ENABLED
// write log - save the data.
// @LoggerMessage: SOAR
// @Vehicles: Plane
@ -367,6 +368,7 @@ void SoaringController::update_thermalling()
(double)wind_drift.x,
(double)wind_drift.y,
(double)_thermalability);
#endif
}
void SoaringController::update_cruising()
@ -388,6 +390,7 @@ void SoaringController::update_cruising()
// Update the calculation.
_speedToFly.update(wx, wz, thermal_vspeed, CLmin, CLmax);
#if HAL_LOGGING_ENABLED
AP::logger().WriteStreaming("SORC", "TimeUS,wx,wz,wexp,CLmin,CLmax,Vopt", "Qffffff",
AP_HAL::micros64(),
(double)wx,
@ -396,6 +399,7 @@ void SoaringController::update_cruising()
(double)CLmin,
(double)CLmax,
(double)_speedToFly.speed_to_fly());
#endif
}
void SoaringController::update_vario()

View File

@ -79,6 +79,7 @@ void Variometer::update(const float thermal_bank)
_expected_thermalling_sink = calculate_aircraft_sinkrate(radians(thermal_bank));
#if HAL_LOGGING_ENABLED
// @LoggerMessage: VAR
// @Vehicles: Plane
// @Description: Variometer data
@ -107,9 +108,12 @@ void Variometer::update(const float thermal_bank)
(double)_expected_thermalling_sink,
(double)dsp,
(double)dsp_bias);
#else
(void)filtered_reading;
(void)smoothed_climb_rate;
#endif
}
float Variometer::calculate_aircraft_sinkrate(float phi) const
{
// Remove aircraft sink rate