Front camera control without custom guidance mode

Is it possible to set the front camera attitude (yaw, pitch, zoom) without creating a custom guidance mode?
I want to change the camera attitude while the Anafi AI is in Hover mode.
Can the command set_reference for the AxesCamController (Messages list - 7.7) be used to achieve that?
I tried to use this command but maybe I am using it the wrong way.

Hi @_fisian,

Yes, it is possible to set the front camera attitude wihtout creating a custom guidance mode and send a set_reference for the AxesCamController is one way of doing this. Have you tried sending a set_config command before a set_reference command ? This is an important parameter that locks the axes or not. Make sure this parameter is set to false.

An other way is to use libairsdk in an Air SDK mission to send command to the drone. Take a look at our move mission. You can send a set_target command with this function :

int ControlInterface::cmdGimbalSetTarget(float yaw, float pitch, float roll)
{
	arsdk_cmd cmdGimbalSetTarget;
	arsdk_cmd_init(&cmdGimbalSetTarget);
	ULOGN("### SET Gimbal Target yaw:%lf pitch:%lf roll:%lf",
	      yaw,
	      pitch,
	      roll);
	arsdk_cmd_enc_Gimbal_Set_target(
		&cmdGimbalSetTarget,
		ARSDK_GIMBAL_MODEL_MAIN,
		ARSDK_GIMBAL_CONTROL_MODE_POSITION,
		ARSDK_GIMBAL_FRAME_OF_REFERENCE_ABSOLUTE,
		yaw,
		ARSDK_GIMBAL_FRAME_OF_REFERENCE_ABSOLUTE,
		pitch,
		ARSDK_GIMBAL_FRAME_OF_REFERENCE_ABSOLUTE,
		roll);
	mControlItf.send(&cmdGimbalSetTarget);
	arsdk_cmd_clear(&cmdGimbalSetTarget);
	return 0;
}

Regards,
Axel

Hi @Axelm ,

thanks for the details.
Using set_config now I can change the gimbal position.

I have a question about the frame of reference in the set_reference command:
From the documentation it is not clear to me, what the BASE and RELATIVE frames do exactly.
I want to set the yaw relative to the drone body (so the gimbal doesn’t rotate/compensate when the drone turns).
Which frame of reference would be used for that?

I tried out RELATIVE but that is not what I want to use.
When trying to use BASE for yaw (and NED for pitch) the camera does not move at all (not even the pitch, which was working before).

Hi @_fisian,

Sorry for the delay. You cannot control axes with different reference frames. All axes must have the same reference frame.

  • The frame of reference Base : The drone body-fixed frame of reference.
  • The frame of reference Relative : accumulation of new orders on the existing position.

Regards,
Axel

This topic was automatically opened after 7 days.