mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 19:03:35 +08:00
Allow negative differential pressure if parameter enabled (#24434)
This commit is contained in:
@@ -69,8 +69,15 @@ void UavcanDifferentialPressureBridge::air_sub_cb(const
|
||||
|
||||
_device_id.devid_s.devtype = DRV_DIFF_PRESS_DEVTYPE_UAVCAN;
|
||||
_device_id.devid_s.address = msg.getSrcNodeID().get() & 0xFF;
|
||||
|
||||
float diff_press_pa = msg.differential_pressure;
|
||||
int32_t differential_press_rev = 0;
|
||||
param_get(param_find("SENS_DPRES_REV"), &differential_press_rev);
|
||||
|
||||
//If differential pressure reverse param set, swap positive and negative
|
||||
if (differential_press_rev == 1) {
|
||||
diff_press_pa = -1.0f * msg.differential_pressure;
|
||||
}
|
||||
|
||||
float temperature_c = msg.static_air_temperature + atmosphere::kAbsoluteNullCelsius;
|
||||
|
||||
differential_pressure_s report{};
|
||||
|
||||
Reference in New Issue
Block a user