-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
Check mag sensor for consistency before flight #8039
Conversation
Testing on a pixracer with external GPS and compass showed that this prevented checks passing when the external compass orientation was set incorrectly to 90 deg yaw. Messaging to users needs further work to reduce frustration. |
|
||
float mag_diff_sum_sq = 0.0f; // sum of differences squared for a single sensor comparison against the primary | ||
|
||
// calculate gyro_diff_sum_sq for the specified sensor against the primary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gyro comment
Thanks, this will help catch some of these sensor issues. Beyond user frustration I'm not sure there's actually enough in a default log to further investigate when there is a problem. For example the pixhawk 2.1 I was using today has 4 mags (1 external, 3 internal). One of the internal mpu9250s reports as external because it's using the same bus that was external on a pixhawk 1. For per mag disabling what do you think about handling it alongside the calibration parameters? Then if we had some simple messages about the specific problematic mag it would map back to params. The actual threshold check and error reporting could move to the sensors module and the publication used by commander could simply be a high level sensor status message. |
Fixed gyro comment. |
Many vehicle have multiple magnetometers fitted which are all calibrated by default and which can all be used by the sensor selection logic. Checking the sensors for consistency will prevent takeoff if one of the sensors has an invalid calibration or if the orientation is set incorrectly.
Potential issues with this solution that need resolving are:
Ground based magnetic anomalies will cause this check to fail when sensors are not co-located. We need a way to inform the user that the first cation is to pick up the vehicle to clear the check. This will require the pass to latch.
One sensor may have issues that prevent it being successfully calibrated or used. We need to provide a way that users can prevent a problem sensor being used by this and the selection algorithm.