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

Refactor microstrain to common library #24723

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Tools/autotest/arduplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -3082,9 +3082,9 @@ def VectorNavEAHRS(self):
'''Test VectorNav EAHRS support'''
self.fly_external_AHRS("VectorNav", 1, "ap1.txt")

def MicroStrainEAHRS(self):
'''Test MicroStrain EAHRS support'''
self.fly_external_AHRS("MicroStrain", 2, "ap1.txt")
def MicroStrainEAHRS5(self):
'''Test MicroStrain EAHRS series 5 support'''
self.fly_external_AHRS("MicroStrain5", 2, "ap1.txt")

def get_accelvec(self, m):
return Vector3(m.xacc, m.yacc, m.zacc) * 0.001 * 9.81
Expand Down Expand Up @@ -4725,7 +4725,7 @@ def tests(self):
self.TerrainMission,
self.TerrainLoiter,
self.VectorNavEAHRS,
self.MicroStrainEAHRS,
self.MicroStrainEAHRS5,
self.Deadreckoning,
self.DeadreckoningNoAirSpeed,
self.EKFlaneswitch,
Expand Down
2 changes: 1 addition & 1 deletion Tools/scripts/build_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self,
Feature('AHRS', 'EKF3', 'HAL_NAVEKF3_AVAILABLE', 'Enable EKF3', 1, None),
Feature('AHRS', 'EKF2', 'HAL_NAVEKF2_AVAILABLE', 'Enable EKF2', 0, None),
Feature('AHRS', 'AHRS_EXT', 'HAL_EXTERNAL_AHRS_ENABLED', 'Enable External AHRS', 0, None),
Feature('AHRS', 'AHRS_EXT_MICROSTRAIN', 'AP_EXTERNAL_AHRS_MICROSTRAIN_ENABLED', 'Enable MICROSTRAIN External AHRS', 0, "AHRS_EXT"), # noqa: E501
Feature('AHRS', 'AHRS_EXT_MICROSTRAIN5', 'AP_EXTERNAL_AHRS_MICROSTRAIN5_ENABLED', 'Enable MICROSTRAIN 5-series External AHRS', 0, "AHRS_EXT"), # noqa: E501
Feature('AHRS', 'AHRS_EXT_VECTORNAV', 'AP_EXTERNAL_AHRS_VECTORNAV_ENABLED', 'Enable VectorNav External AHRS', 0, "AHRS_EXT"), # noqa
Feature('AHRS', 'TEMPCAL', 'HAL_INS_TEMPERATURE_CAL_ENABLE', 'Enable IMU Temperature Calibration', 0, None),
Feature('AHRS', 'VISUALODOM', 'HAL_VISUALODOM_ENABLED', 'Enable Visual Odometry', 0, 'EKF3_EXTNAV'),
Expand Down
8 changes: 4 additions & 4 deletions libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "AP_ExternalAHRS.h"
#include "AP_ExternalAHRS_backend.h"
#include "AP_ExternalAHRS_VectorNav.h"
#include "AP_ExternalAHRS_MicroStrain.h"
#include "AP_ExternalAHRS_MicroStrain5.h"

#include <GCS_MAVLink/GCS.h>

Expand Down Expand Up @@ -98,9 +98,9 @@ void AP_ExternalAHRS::init(void)
backend = new AP_ExternalAHRS_VectorNav(this, state);
break;
#endif
#if AP_EXTERNAL_AHRS_MICROSTRAIN_ENABLED
case DevType::MicroStrain:
backend = new AP_ExternalAHRS_MicroStrain(this, state);
#if AP_EXTERNAL_AHRS_MICROSTRAIN5_ENABLED
case DevType::MicroStrain5:
backend = new AP_ExternalAHRS_MicroStrain5(this, state);
break;
default:
#endif
Expand Down
4 changes: 2 additions & 2 deletions libraries/AP_ExternalAHRS/AP_ExternalAHRS.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class AP_ExternalAHRS {
#if AP_EXTERNAL_AHRS_VECTORNAV_ENABLED
VecNav = 1,
#endif
#if AP_EXTERNAL_AHRS_MICROSTRAIN_ENABLED
MicroStrain = 2,
#if AP_EXTERNAL_AHRS_MICROSTRAIN5_ENABLED
MicroStrain5 = 2,
#endif
};

Expand Down
Loading
Loading