mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 04:33:34 +08:00
drivers/differential_pressure: remove lib/drivers/airspeed dependency and cleanup
- split ms4525_airspeed into separate ms4515 and ms4525 drivers
This commit is contained in:
@@ -161,8 +161,6 @@ private:
|
||||
|
||||
static Simulator *_instance;
|
||||
|
||||
static constexpr float hPa2Pa = 100.0f; // hectopascal to pascal multiplier
|
||||
|
||||
// simulated sensor instances
|
||||
static constexpr uint8_t ACCEL_COUNT_MAX = 3;
|
||||
PX4Accelerometer _px4_accel[ACCEL_COUNT_MAX] {
|
||||
|
||||
@@ -328,7 +328,7 @@ void Simulator::update_sensors(const hrt_abstime &time, const mavlink_hil_sensor
|
||||
if ((sensors.fields_updated & SensorSource::BARO) == SensorSource::BARO && !_baro_blocked) {
|
||||
|
||||
if (!_baro_stuck) {
|
||||
_last_baro_pressure = sensors.abs_pressure * hPa2Pa; // convert hPa to Pa
|
||||
_last_baro_pressure = sensors.abs_pressure * 100.f; // hPa to Pa
|
||||
_last_baro_temperature = sensors.temperature;
|
||||
}
|
||||
|
||||
@@ -353,8 +353,8 @@ void Simulator::update_sensors(const hrt_abstime &time, const mavlink_hil_sensor
|
||||
if ((sensors.fields_updated & SensorSource::DIFF_PRESS) == SensorSource::DIFF_PRESS && !_airspeed_blocked) {
|
||||
differential_pressure_s report{};
|
||||
report.timestamp_sample = time;
|
||||
report.device_id = 0; // TODO
|
||||
report.differential_pressure_pa = sensors.diff_pressure * hPa2Pa; // convert hPa to Pa;
|
||||
report.device_id = 1377548; // 1377548: DRV_DIFF_PRESS_DEVTYPE_SIM, BUS: 1, ADDR: 5, TYPE: SIMULATION
|
||||
report.differential_pressure_pa = sensors.diff_pressure * 100.f; // hPa to Pa;
|
||||
report.temperature = _sensors_temperature;
|
||||
report.timestamp = hrt_absolute_time();
|
||||
_differential_pressure_pub.publish(report);
|
||||
|
||||
Reference in New Issue
Block a user