From eec713d039e69ffefde23ad78822cf7ddb5422c9 Mon Sep 17 00:00:00 2001 From: RexBerry <59031902+RexBerry@users.noreply.github.com> Date: Tue, 19 Nov 2024 18:19:37 -0600 Subject: [PATCH] Use gimbal rotation in camera parameters #29 --- flight/camera.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flight/camera.py b/flight/camera.py index 72fe0397..965bb906 100644 --- a/flight/camera.py +++ b/flight/camera.py @@ -316,9 +316,9 @@ async def _get_camera_parameters(self, drone: dronekit.Vehicle) -> CameraParamet location: dronekit.LocationGlobalRelative = drone.location.global_relative_frame attitude: dronekit.Attitude = drone.attitude - roll_deg: float = math.degrees(attitude.roll) - pitch_deg: float = math.degrees(attitude.pitch) - yaw_deg: float = math.degrees(attitude.yaw) + roll_deg: float = math.degrees(attitude.roll) - drone.gimbal.roll + pitch_deg: float = math.degrees(attitude.pitch) - drone.gimbal.pitch + yaw_deg: float = math.degrees(attitude.yaw) - drone.gimbal.yaw return { "focal_length": 24,