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

ExternalAHRS: fixed IMU access, check origin and common logging #26329

Merged
merged 7 commits into from
Feb 27, 2024

Conversation

tridge
Copy link
Contributor

@tridge tridge commented Feb 26, 2024

This pulls some patches from this PR
#23267
it also allows backends to know when GPS is disabled, for dead-reckoning testing

Comment on lines +118 to +119
bool get_gyro(Vector3f &gyro);
bool get_accel(Vector3f &accel);
Copy link
Collaborator

@Ryanf55 Ryanf55 Feb 27, 2024

Choose a reason for hiding this comment

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

Suggested change
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);
Copy link
Collaborator

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();
Copy link
Contributor

@peterbarker peterbarker Feb 27, 2024

Choose a reason for hiding this comment

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

More-tightly scope this?

@peterbarker peterbarker merged commit 0aee2a4 into ArduPilot:master Feb 27, 2024
92 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 4.5.0-beta3
Development

Successfully merging this pull request may close these issues.

4 participants