From bcd11701fa15ac3d1cdcc39331a93a6b800bbd62 Mon Sep 17 00:00:00 2001 From: Ryan Friedman Date: Sat, 23 Sep 2023 13:43:11 -0600 Subject: [PATCH] Tools: Add MicroStrain7 support Signed-off-by: Ryan Friedman --- Tools/autotest/ArduPlane_Tests/MicroStrainEAHRS7/ap1.txt | 7 +++++++ Tools/autotest/arduplane.py | 5 +++++ Tools/scripts/build_options.py | 1 + Tools/scripts/run_astyle.py | 9 +++++++-- 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 Tools/autotest/ArduPlane_Tests/MicroStrainEAHRS7/ap1.txt diff --git a/Tools/autotest/ArduPlane_Tests/MicroStrainEAHRS7/ap1.txt b/Tools/autotest/ArduPlane_Tests/MicroStrainEAHRS7/ap1.txt new file mode 100644 index 0000000000..ab2be0d1a4 --- /dev/null +++ b/Tools/autotest/ArduPlane_Tests/MicroStrainEAHRS7/ap1.txt @@ -0,0 +1,7 @@ +QGC WPL 110 +0 0 0 16 0.000000 0.000000 0.000000 0.000000 -35.363262 149.165237 584.090027 1 +1 0 3 22 0.000000 0.000000 0.000000 0.000000 -35.361553 149.163956 20.000000 1 +2 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.364540 149.162857 50.000000 1 +3 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.367333 149.163164 28.000000 1 +4 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.366814 149.165878 28.000000 1 +5 0 3 21 0.000000 0.000000 0.000000 1.000000 -35.362947 149.165179 0.000000 1 diff --git a/Tools/autotest/arduplane.py b/Tools/autotest/arduplane.py index 31a127f3e0..fb78e2c186 100644 --- a/Tools/autotest/arduplane.py +++ b/Tools/autotest/arduplane.py @@ -3275,6 +3275,10 @@ class AutoTestPlane(vehicle_test_suite.TestSuite): '''Test MicroStrain EAHRS series 5 support''' self.fly_external_AHRS("MicroStrain5", 2, "ap1.txt") + def MicroStrainEAHRS7(self): + '''Test MicroStrain EAHRS series 7 support''' + self.fly_external_AHRS("MicroStrain7", 7, "ap1.txt") + def get_accelvec(self, m): return Vector3(m.xacc, m.yacc, m.zacc) * 0.001 * 9.81 @@ -5353,6 +5357,7 @@ class AutoTestPlane(vehicle_test_suite.TestSuite): self.TerrainLoiter, self.VectorNavEAHRS, self.MicroStrainEAHRS5, + self.MicroStrainEAHRS7, self.Deadreckoning, self.DeadreckoningNoAirSpeed, self.EKFlaneswitch, diff --git a/Tools/scripts/build_options.py b/Tools/scripts/build_options.py index dfbef411a7..7dc8f69cfe 100644 --- a/Tools/scripts/build_options.py +++ b/Tools/scripts/build_options.py @@ -32,6 +32,7 @@ BUILD_OPTIONS = [ 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_MICROSTRAIN5', 'AP_EXTERNAL_AHRS_MICROSTRAIN5_ENABLED', 'Enable MICROSTRAIN 5-series External AHRS', 0, "AHRS_EXT"), # noqa: E501 + Feature('AHRS', 'AHRS_EXT_MICROSTRAIN7', 'AP_EXTERNAL_AHRS_MICROSTRAIN7_ENABLED', 'Enable MICROSTRAIN 7-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'), diff --git a/Tools/scripts/run_astyle.py b/Tools/scripts/run_astyle.py index bf6ff415c9..4e49599473 100755 --- a/Tools/scripts/run_astyle.py +++ b/Tools/scripts/run_astyle.py @@ -22,9 +22,14 @@ class AStyleChecker(object): self.retcode = 0 self.directories_to_check = [ 'libraries/AP_DDS', - 'libraries/AP_ExternalControl' + 'libraries/AP_ExternalControl', + ] + self.files_to_check = [ + pathlib.Path(s) for s in [ + 'libraries/AP_ExternalAHRS/AP_ExternalAHRS_MicroStrain7.cpp', + 'libraries/AP_ExternalAHRS/AP_ExternalAHRS_MicroStrain7.h', + ] ] - self.files_to_check = [] self.dry_run = dry_run def progress(self, string):