diff --git a/flight/camera.py b/flight/camera.py index 899039a5..72fe0397 100644 --- a/flight/camera.py +++ b/flight/camera.py @@ -153,9 +153,9 @@ async def mapping_move_to( info: dict[str, CameraParameters] = {} drone.gimbal.rotate( - -drone.attitude.pitch - 90, - -drone.attitude.roll, - heading, # pitch and roll are relative to the drone + round(-drone.attitude.pitch - 90), # must use integers + round(-drone.attitude.roll), + round(heading), # pitch and roll are relative to the drone ) await asyncio.sleep(1.0) @@ -185,7 +185,9 @@ async def mapping_move_to( next_interval_count: int = 1 while not goto_task.done(): # Keep gimbal pointed straight down - drone.gimbal.rotate(-drone.attitude.pitch - 90, -drone.attitude.roll, heading) + drone.gimbal.rotate( + round(-drone.attitude.pitch - 90), round(-drone.attitude.roll), round(heading) + ) position: dronekit.LocationGlobalRelative = drone.location.global_relative_frame @@ -206,7 +208,9 @@ async def mapping_move_to( await asyncio.sleep(0.25) - drone.gimbal.rotate(-drone.attitude.pitch - 90, -drone.attitude.roll, heading) + drone.gimbal.rotate( + round(-drone.attitude.pitch - 90), round(-drone.attitude.roll), round(heading) + ) await asyncio.sleep(1.0) camera_parameters = await self._get_camera_parameters(drone) @@ -268,9 +272,9 @@ async def odlc_move_to( if take_photos: # Point the gimbal straight down drone.gimbal.rotate( - -drone.gimbal.pitch - 90, # pitch is relative to the drone - -drone.gimbal.roll, - heading, + round(-drone.gimbal.pitch - 90), + round(-drone.gimbal.roll), + round(heading), ) await asyncio.sleep(2)