From 5e9be2a6d50427d2a185c56955fcde1ed5668166 Mon Sep 17 00:00:00 2001 From: Beniamino Pozzan Date: Wed, 25 Nov 2026 09:11:13 +0000 Subject: [PATCH] fix(sensor_airspeed_sim): use vehicle_attitude_groudtruth (#29878) * fix(sensor_airspeed_sim): use vehicle_attitude_groudtruth Don't use the EKF estimated attitude. Use the groundtruth one like with the other inputs: - local pos - global pos Signed-off-by: Beniamino Pozzan * chore(sih): rename SensorAirspeedSim groundtruth subscribers Signed-off-by: Beniamino Pozzan --------- Signed-off-by: Beniamino Pozzan --- .../sensor_airspeed_sim/SensorAirspeedSim.cpp | 10 +++++----- .../sensor_airspeed_sim/SensorAirspeedSim.hpp | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/modules/simulation/sensor_airspeed_sim/SensorAirspeedSim.cpp b/src/modules/simulation/sensor_airspeed_sim/SensorAirspeedSim.cpp index 65c3f6db349..7497887e795 100644 --- a/src/modules/simulation/sensor_airspeed_sim/SensorAirspeedSim.cpp +++ b/src/modules/simulation/sensor_airspeed_sim/SensorAirspeedSim.cpp @@ -77,19 +77,19 @@ void SensorAirspeedSim::Run() updateParams(); } - if (_vehicle_local_position_sub.updated() && _vehicle_global_position_sub.updated() - && _vehicle_attitude_sub.updated()) { + if (_vehicle_local_position_groundtruth_sub.updated() && _vehicle_global_position_groundtruth_sub.updated() + && _vehicle_attitude_groundtruth_sub.updated()) { _failure_config.update(); vehicle_local_position_s lpos{}; - _vehicle_local_position_sub.copy(&lpos); + _vehicle_local_position_groundtruth_sub.copy(&lpos); vehicle_global_position_s gpos{}; - _vehicle_global_position_sub.copy(&gpos); + _vehicle_global_position_groundtruth_sub.copy(&gpos); vehicle_attitude_s attitude{}; - _vehicle_attitude_sub.copy(&attitude); + _vehicle_attitude_groundtruth_sub.copy(&attitude); Vector3f local_velocity = Vector3f{lpos.vx, lpos.vy, lpos.vz}; Vector3f body_velocity = Dcmf{Quatf{attitude.q}} .transpose() * local_velocity; diff --git a/src/modules/simulation/sensor_airspeed_sim/SensorAirspeedSim.hpp b/src/modules/simulation/sensor_airspeed_sim/SensorAirspeedSim.hpp index daa742c21bf..963d72d2dfd 100644 --- a/src/modules/simulation/sensor_airspeed_sim/SensorAirspeedSim.hpp +++ b/src/modules/simulation/sensor_airspeed_sim/SensorAirspeedSim.hpp @@ -84,9 +84,9 @@ private: void Run() override; uORB::SubscriptionInterval _parameter_update_sub{ORB_ID(parameter_update), 1_s}; - uORB::Subscription _vehicle_attitude_sub{ORB_ID(vehicle_attitude)}; - uORB::Subscription _vehicle_global_position_sub{ORB_ID(vehicle_global_position_groundtruth)}; - uORB::Subscription _vehicle_local_position_sub{ORB_ID(vehicle_local_position_groundtruth)}; + uORB::Subscription _vehicle_attitude_groundtruth_sub{ORB_ID(vehicle_attitude_groundtruth)}; + uORB::Subscription _vehicle_global_position_groundtruth_sub{ORB_ID(vehicle_global_position_groundtruth)}; + uORB::Subscription _vehicle_local_position_groundtruth_sub{ORB_ID(vehicle_local_position_groundtruth)}; uORB::PublicationMulti _differential_pressure_pub{ORB_ID(differential_pressure)};