From c4511406887132743ea6edf2bd90b94cd94a61aa Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 30 Sep 2023 10:32:31 +1000 Subject: [PATCH] mavextra: added RotateMag --- mavextra.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mavextra.py b/mavextra.py index 829f08609..d11afb31d 100644 --- a/mavextra.py +++ b/mavextra.py @@ -1657,3 +1657,8 @@ def mm_curr(RCOU,BAT,PWM_MIN,PWM_MAX,Mfirst,Mlast): command = voltage*max(pwm - PWM_MIN,0)/(PWM_MAX-PWM_MIN) total_curr += command**2 return total_curr + +def RotateMag(MAG,rotation): + '''rotate a MAG message by rotation enumeration''' + v = Vector3(MAG.MagX,MAG.MagY,MAG.MagZ) + return v.rotate_by_id(rotation)