Skip to content

Commit

Permalink
replace IAS with EAS in FW attitude controller (#14868)
Browse files Browse the repository at this point in the history
The EAS is the calibrated airspeed corrected with a scaling factor to account for sensor error/placement of pitot.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
  • Loading branch information
sfuhrer authored May 8, 2020
1 parent 678c3fe commit 0c75385
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/fw_att_control/FixedwingAttitudeControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,15 @@ FixedwingAttitudeControl::vehicle_land_detected_poll()
float FixedwingAttitudeControl::get_airspeed_and_update_scaling()
{
_airspeed_validated_sub.update();
const bool airspeed_valid = PX4_ISFINITE(_airspeed_validated_sub.get().indicated_airspeed_m_s)
const bool airspeed_valid = PX4_ISFINITE(_airspeed_validated_sub.get().equivalent_airspeed_m_s)
&& (hrt_elapsed_time(&_airspeed_validated_sub.get().timestamp) < 1_s);

// if no airspeed measurement is available out best guess is to use the trim airspeed
float airspeed = _param_fw_airspd_trim.get();

if ((_param_fw_arsp_mode.get() == 0) && airspeed_valid) {
/* prevent numerical drama by requiring 0.5 m/s minimal speed */
airspeed = math::max(0.5f, _airspeed_validated_sub.get().indicated_airspeed_m_s);
airspeed = math::max(0.5f, _airspeed_validated_sub.get().equivalent_airspeed_m_s);

} else {
// VTOL: if we have no airspeed available and we are in hover mode then assume the lowest airspeed possible
Expand Down

0 comments on commit 0c75385

Please sign in to comment.