From 35f69dfda9c63c9cee5564f126b40b75c0235a10 Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Sat, 25 May 2024 09:31:12 +0100 Subject: [PATCH] AP_AHRS: correct get_accel() to use primary accel rather than first usable for scripting --- libraries/AP_AHRS/AP_AHRS.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_AHRS/AP_AHRS.h b/libraries/AP_AHRS/AP_AHRS.h index 00988f1a0a6b9..10f9deed01df9 100644 --- a/libraries/AP_AHRS/AP_AHRS.h +++ b/libraries/AP_AHRS/AP_AHRS.h @@ -618,9 +618,9 @@ class AP_AHRS { // return current vibration vector for primary IMU Vector3f get_vibration(void) const; - // return primary accels, for lua + // return primary accels const Vector3f &get_accel(void) const { - return AP::ins().get_accel(); + return AP::ins().get_accel(_get_primary_accel_index()); } // return primary accel bias. This should be subtracted from