Skip to content

Commit

Permalink
mavextra: added RotateMag
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Sep 30, 2023
1 parent 19e385c commit a12744c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mavextra.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit a12744c

Please sign in to comment.