tecs_status.msg: directly add underspeed ratio to msg instead of boolean

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer 2023-11-07 10:46:27 +01:00 committed by Thomas Stastny
parent 8741a9784d
commit a47b684fd7
3 changed files with 3 additions and 3 deletions

View File

@ -26,4 +26,4 @@ float32 throttle_sp # Current throttle setpoint [-]
float32 pitch_sp_rad # Current pitch setpoint [rad]
float32 throttle_trim # estimated throttle value [0,1] required to fly level at equivalent_airspeed_sp in the current atmospheric conditions
bool underspeed_mode_enabled # System has detected a low airspeed and takes measures to avoid stalling the plane
float32 underspeed_ratio # 0: no underspeed, 1: maximal underspeed. Controller takes measures to avoid stall proportional to ratio if >0.

View File

@ -646,7 +646,7 @@ public:
float get_throttle_setpoint() {return _control.getThrottleSetpoint();}
uint64_t timestamp() { return _update_timestamp; }
bool underspeed_detected() { return _control.getRatioUndersped() > 0.f; }
float get_underspeed_ratio() { return _control.getRatioUndersped(); }
private:
TECSControl _control; ///< Control submodule.

View File

@ -506,7 +506,7 @@ FixedwingPositionControl::tecs_status_publish(float alt_sp, float equivalent_air
tecs_status.throttle_sp = _tecs.get_throttle_setpoint();
tecs_status.pitch_sp_rad = _tecs.get_pitch_setpoint();
tecs_status.throttle_trim = throttle_trim;
tecs_status.underspeed_mode_enabled = _tecs.underspeed_detected();
tecs_status.underspeed_ratio = _tecs.get_underspeed_ratio();
tecs_status.timestamp = hrt_absolute_time();