Can I change the yaw of the aircraft using GimbalAngleRotation?
CompletedI would like for my Mavic3E drone to turn 90 degrees when something I codded happens. Can I change the gimbal mode to Yaw_Follow and the aircraft will move with the yaw parameter in GimbalAngleRotation or is there a easier way to just rotate the aircraft?
My yaw rotation code for reference, as things are, passing 90.0 will throw the DJI error code: 24580 'SDK_SERVICE_GIMBAL_ROTATE_YAW_OUT_OF_RANGE', innerCode='
fun rodarDrone(yaw : Double){
gimbalAngleRotation.mode = GimbalAngleRotationMode.RELATIVE_ANGLE
gimbalAngleRotation.yaw = yaw
gimbalAngleRotation.duration = 2.0
keyManager.performAction(
KeyTools.createKey(GimbalKey.KeyRotateByAngle),
gimbalAngleRotation,
object : CommonCallbacks.CompletionCallbackWithParam<EmptyMsg>{
override fun onSuccess(p0: EmptyMsg?) {
println("Sucesso ao rodar")
}
override fun onFailure(p0: IDJIError) {
println("Falha ao rodar: $p0")
}
})
}
-
The Yaw_Follow is a gimbal rotation mode, which means the gimbal will follow the aircraft's movement. I believe it cannot achieve the aircraft following the gimbal's rotation. The message "SDK_SERVICE_GIMBAL_ROTATE_YAW_OUT_OF_RANGE" indicates that the parameter exceeds the valid range. If you need to achieve aircraft rotation, you might consider using the advanced virtual joystick feature. Here is an introduction. Chapter 7: The virtual stick(https://sdk-forum.dji.net/hc/en-us/articles/8697869415577-Chapter-7-The-virtual-stick) https://sdk-forum.dji.net/hc/en-us/articles/360024396953-How-to-rotate-the-aircraft-to-a-specified-angle
Please sign in to leave a comment.
Comments
1 comment