Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SYS_STATUS: fill correct attitude, horizontal position flags #23500

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

MaEtUgR
Copy link
Member

@MaEtUgR MaEtUgR commented Aug 6, 2024

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

  1. Map health_component_t::local_position_estimate to MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL because with a local position estimate position control is possible
  2. Map health_component_t::attitude_estimate to MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION because with a valid attitude estimate attitude stabilization is possible
  3. Don't set the MAV_SYS_STATUS_AHRS flags due to unclear definition.

Changelog Entry

Improvement: fill MAVLink's SYS_STATUS flags for horizontal position and attitude estimate

Test coverage

This was not tested yet. @cmic0 could you provide feedback after you tried?

@MaEtUgR MaEtUgR requested a review from bkueng August 6, 2024 11:28
@MaEtUgR MaEtUgR self-assigned this Aug 6, 2024
bkueng
bkueng previously approved these changes Aug 7, 2024
Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me, its definition is too unclear to map to any specific EKF2 estimator state.

That was also my thinking, so I mapped it to local pos. Certainly not ideal, so removing it works too.

@bresch
Copy link
Member

bresch commented Aug 7, 2024

AHRS is by definition an attitude estimate, why not mapping it to health_component_t::attitude_estimate as well?
Screenshot from 2024-08-07 10-04-20

(source: https://www.vectornav.com/resources/inertial-navigation-primer/theory-of-operation/theory-inertial )

@MaEtUgR
Copy link
Member Author

MaEtUgR commented Aug 9, 2024

why not mapping it to health_component_t::attitude_estimate as well?

Not sure if this helps any use case, but it's the definition I'd guess from the name as well.

@MaEtUgR MaEtUgR force-pushed the maetugr/correct-system-status-flags branch from 080337b to f6e6671 Compare August 9, 2024 13:17
@MaEtUgR
Copy link
Member Author

MaEtUgR commented Aug 9, 2024

ok, I rebased and readded the AHRS to also report about the health_component_t::attitude_estimate

@MaEtUgR MaEtUgR enabled auto-merge (rebase) August 9, 2024 13:57
@MaEtUgR MaEtUgR merged commit 64056fc into main Aug 9, 2024
95 checks passed
@MaEtUgR MaEtUgR deleted the maetugr/correct-system-status-flags branch August 9, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants