mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 09:21:35 +08:00
vehicle_status_flags: cleanup message, move non-failsafe flags to vehicle_status
This commit is contained in:
@@ -101,6 +101,16 @@ void MagBiasEstimator::Run()
|
||||
ScheduleOnInterval(20_ms);
|
||||
}
|
||||
}
|
||||
|
||||
bool system_calibrating = vehicle_status.calibration_enabled;
|
||||
|
||||
if (system_calibrating != _system_calibrating) {
|
||||
_system_calibrating = system_calibrating;
|
||||
|
||||
for (auto &reset : _reset_field_estimator) {
|
||||
reset = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,22 +140,6 @@ void MagBiasEstimator::Run()
|
||||
}
|
||||
}
|
||||
|
||||
if (_vehicle_status_flags_sub.updated()) {
|
||||
vehicle_status_flags_s vehicle_status_flags;
|
||||
|
||||
if (_vehicle_status_flags_sub.copy(&vehicle_status_flags)) {
|
||||
bool system_calibrating = vehicle_status_flags.calibration_enabled;
|
||||
|
||||
if (system_calibrating != _system_calibrating) {
|
||||
_system_calibrating = system_calibrating;
|
||||
|
||||
for (auto &reset : _reset_field_estimator) {
|
||||
reset = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// do nothing during regular sensor calibration
|
||||
if (_system_calibrating) {
|
||||
return;
|
||||
|
||||
@@ -51,7 +51,6 @@
|
||||
#include <uORB/topics/sensor_mag.h>
|
||||
#include <uORB/topics/vehicle_angular_velocity.h>
|
||||
#include <uORB/topics/vehicle_status.h>
|
||||
#include <uORB/topics/vehicle_status_flags.h>
|
||||
|
||||
namespace mag_bias_estimator
|
||||
{
|
||||
@@ -91,7 +90,6 @@ private:
|
||||
uORB::Subscription _parameter_update_sub{ORB_ID(parameter_update)};
|
||||
uORB::Subscription _vehicle_angular_velocity_sub{ORB_ID(vehicle_angular_velocity)};
|
||||
uORB::Subscription _vehicle_status_sub{ORB_ID(vehicle_status)};
|
||||
uORB::Subscription _vehicle_status_flags_sub{ORB_ID(vehicle_status_flags)};
|
||||
|
||||
uORB::Publication<magnetometer_bias_estimate_s> _magnetometer_bias_estimate_pub{ORB_ID(magnetometer_bias_estimate)};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user