Skip to content

Commit

Permalink
repurpose wind estimator module into airspeed module and add airspeed…
Browse files Browse the repository at this point in the history
…_validated topic

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
  • Loading branch information
sfuhrer committed Jul 1, 2019
1 parent 3f72b72 commit 745254c
Show file tree
Hide file tree
Showing 6 changed files with 392 additions and 115 deletions.
1 change: 1 addition & 0 deletions msg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ set(msg_files
actuator_outputs.msg
adc_report.msg
airspeed.msg
airspeed_validated.msg
battery_status.msg
camera_capture.msg
camera_trigger.msg
Expand Down
15 changes: 15 additions & 0 deletions msg/airspeed_validated.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
uint64 timestamp # time since system start (microseconds)

float32 indicated_airspeed_m_s # indicated airspeed in m/s (IAS)

float32 equivalent_airspeed_m_s # equivalent airspeed in m/s (accounts for instrumentation errors) (EAS)

float32 true_airspeed_m_s # true filtered airspeed in m/s (TAS)

float32 ground_minus_wind # TAS calculated from groundspeed - windspeed

bool airspeed_sensor_measurement_valid # true if airspeed measurement from (one or multiple) pitot is valid

bool airspeed_valid # true if airspeed_sensor_measurement_valid or groundspeed-windspeed is valid

int64 selected_airspeed_index # 0-2: airspeed sensor index, -1: groundspeed-windspeed, -2: airspeed invalid
1 change: 1 addition & 0 deletions src/modules/logger/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ void Logger::add_default_topics()
add_topic("actuator_controls_1", 100);
add_topic("actuator_outputs", 100);
add_topic("airspeed", 200);
add_topic("airspeed_validated", 200);
add_topic("battery_status", 500);
add_topic("camera_capture");
add_topic("camera_trigger");
Expand Down
6 changes: 3 additions & 3 deletions src/modules/sensors/sensors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,14 +330,14 @@ Sensors::diff_pres_poll(const vehicle_air_data_s &raw)
}

/* don't risk to feed negative airspeed into the system */
airspeed.indicated_airspeed_m_s = calc_indicated_airspeed_corrected((enum AIRSPEED_COMPENSATION_MODEL)
airspeed.indicated_airspeed_m_s = calc_IAS_corrected((enum AIRSPEED_COMPENSATION_MODEL)
_parameters.air_cmodel,
smodel, _parameters.air_tube_length, _parameters.air_tube_diameter_mm,
diff_pres.differential_pressure_filtered_pa, raw.baro_pressure_pa,
air_temperature_celsius);

airspeed.true_airspeed_m_s = calc_true_airspeed_from_indicated(airspeed.indicated_airspeed_m_s, raw.baro_pressure_pa,
air_temperature_celsius);
airspeed.true_airspeed_m_s = calc_TAS_from_EAS(airspeed.indicated_airspeed_m_s, raw.baro_pressure_pa,
air_temperature_celsius); // assume that EAS = IAS as we don't have an EAS-scale here

airspeed.air_temperature_celsius = air_temperature_celsius;

Expand Down
3 changes: 1 addition & 2 deletions src/modules/wind_estimator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@
px4_add_module(
MODULE modules__wind_estimator
MAIN wind_estimator
INCLUDES
${PX4_SOURCE_DIR}/src/lib/ecl
SRCS
wind_estimator_main.cpp
DEPENDS
git_ecl
ecl_airdata
AirspeedValidator
)
Loading

0 comments on commit 745254c

Please sign in to comment.