From 8326eb5124fb4d87060fef446e8f5e2214678675 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 26 Sep 2024 10:56:24 +1000 Subject: [PATCH] Scripting: added Lat,Lon to aerobatics POSM/POST this makes "map POSM POST" work on aerobatic scripts --- .../applets/Aerobatics/FixedWing/plane_aerobatics.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Scripting/applets/Aerobatics/FixedWing/plane_aerobatics.lua b/libraries/AP_Scripting/applets/Aerobatics/FixedWing/plane_aerobatics.lua index f98be87a34e86..9dee1d007e037 100644 --- a/libraries/AP_Scripting/applets/Aerobatics/FixedWing/plane_aerobatics.lua +++ b/libraries/AP_Scripting/applets/Aerobatics/FixedWing/plane_aerobatics.lua @@ -2124,7 +2124,9 @@ end -- log a pose from position and quaternion attitude function log_pose(logname, pos, quat) - logger.write(logname, 'px,py,pz,q1,q2,q3,q4,r,p,y', 'ffffffffff', + local loc = ahrs:get_origin():copy() + loc:offset(pos:x(),pos:y()) + logger.write(logname, 'px,py,pz,q1,q2,q3,q4,r,p,y,Lat,Lon', 'ffffffffffLL', pos:x(), pos:y(), pos:z(), @@ -2134,7 +2136,9 @@ function log_pose(logname, pos, quat) quat:q4(), math.deg(quat:get_euler_roll()), math.deg(quat:get_euler_pitch()), - math.deg(quat:get_euler_yaw())) + math.deg(quat:get_euler_yaw()), + loc:lat(), + loc:lng()) end --[[