-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
ExternalAHRS: fixed IMU access, check origin and common logging #26329
Conversation
when we change EAHRS_SENSORS to remove use of IMU from an external AHRS we need to be able to zero the accel and gyro offsets to get prearms to pass
common logging for all EAHRS backends
allow backends to determine if we are in fixed wing flight and/or the GPS is disabled by the user
bool get_gyro(Vector3f &gyro); | ||
bool get_accel(Vector3f &accel); |
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.
bool get_gyro(Vector3f &gyro); | |
bool get_accel(Vector3f &accel); | |
bool get_gyro(Vector3f &gyro) WARN_IF_UNUSED; | |
bool get_accel(Vector3f &accel) WARN_IF_UNUSED; |
Force consumers to check the error state because otherwise, they can read garbage data.
@@ -1378,6 +1378,9 @@ bool RC_Channel::do_aux_function(const AUX_FUNC ch_option, const AuxSwitchPos ch | |||
|
|||
case AUX_FUNC::GPS_DISABLE: | |||
AP::gps().force_disable(ch_flag == AuxSwitchPos::HIGH); | |||
#if HAL_EXTERNAL_AHRS_ENABLED | |||
AP::externalAHRS().set_gnss_disable(ch_flag == AuxSwitchPos::HIGH); |
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.
Awesome to see this feature!
@@ -23,17 +23,25 @@ bool AP_AHRS_External::healthy() const { | |||
void AP_AHRS_External::get_results(AP_AHRS_Backend::Estimates &results) | |||
{ | |||
Quaternion quat; | |||
if (!AP::externalAHRS().get_quaternion(quat)) { | |||
auto &extahrs = AP::externalAHRS(); | |||
const AP_InertialSensor &_ins = AP::ins(); |
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.
More-tightly scope this?
This pulls some patches from this PR
#23267
it also allows backends to know when GPS is disabled, for dead-reckoning testing