I’m currently building an application that allows the user to take a thermal photo and control the drone, however, I want to be able to move the camera on all the axis available. I saw at the camera documentation and found nothing, so I tried using gimbal but even though the camera moves it doesn’t really work properly as my camera can turn almost 180 degrees and the max gimbal value it accepts is 5 and it moves the camera on all axis.
This is how I’m trying to move the camera. I’ve tried value by value on each argument but I can’t understand how it works. I’m also doing a camera calibration as soon as I connect to the drone as well, just in case it’s needed.
This is the function we use to control the gimbal on Anafi drones. You need to issue a set_target call on the gimbal, and then wait on the attitude call until it succeeds in rotating the gimbal the desired amount.
def setGimbalPose(self, yaw_theta, pitch_theta, roll_theta):
# The Anafi does not support yaw or roll on its gimbal, thus these
# parameters are discarded without effect.
self.drone(set_target(
gimbal_id=0,
control_mode="position",
yaw_frame_of_reference="none",
yaw=yaw_theta,
pitch_frame_of_reference="absolute",
pitch=pitch_theta,
roll_frame_of_reference="none",
roll=roll_theta,
)
>> attitude(pitch_absolute=pitch_theta, _policy="wait", _float_tol=(1e-3, 1e-1))).wait().success()