mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-06 06:43:21 +08:00
DF_MS5611_Wrapper: convert baro pressure to mbar
Temperature compensation in sensors.cpp calculates Baro Altitude assuming baro pressure is stored as mbar.
This commit is contained in:
committed by
Lorenz Meier
parent
128f726cd9
commit
2322a4d232
@@ -151,7 +151,7 @@ int DfMS5611Wrapper::_publish(struct baro_sensor_data &data)
|
|||||||
baro_report baro_report = {};
|
baro_report baro_report = {};
|
||||||
baro_report.timestamp = hrt_absolute_time();
|
baro_report.timestamp = hrt_absolute_time();
|
||||||
|
|
||||||
baro_report.pressure = data.pressure_pa;
|
baro_report.pressure = data.pressure_pa / 100.0f; // convert to mbar
|
||||||
baro_report.temperature = data.temperature_c;
|
baro_report.temperature = data.temperature_c;
|
||||||
|
|
||||||
// TODO: verify this, it's just copied from the MS5611 driver.
|
// TODO: verify this, it's just copied from the MS5611 driver.
|
||||||
|
|||||||
Reference in New Issue
Block a user