SYS_STATUS: fill correct attitude, horizontal position flags #23500
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solved Problem
In #23001 the correct health components are updated to reflect the system state. However, during testing, I found that this causes the wrong or unexpected MAVLink system status flag to be set.
The AHRS flag should in my understanding indicate IMU and magnetometer health and be unrelated to position estimates. Since there are separate flags for gyroscope, accelerometer, and magnetometer, it seems the AHRS flag was meant to represent an estimator in ArduPilot (see mavlink/mavlink@66c4190). To me, its definition is too unclear to map to any specific EKF2 estimator state.
Solution
health_component_t::local_position_estimate
toMAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL
because with a local position estimate position control is possiblehealth_component_t::attitude_estimate
toMAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION
because with a valid attitude estimate attitude stabilization is possibleMAV_SYS_STATUS_AHRS
flags due to unclear definition.Changelog Entry
Test coverage
This was not tested yet. @cmic0 could you provide feedback after you tried?