Mobile-SDK-Android
Mobile-SDK-Android copied to clipboard
Gimbal mode
val gimbal = DJISDKManager.getInstance().product?.gimbal
// Check if Gimbal is available
if (gimbal != null) {
val gimbalMode = GimbalMode.FPV // Set the desired gimbal mode
// Set the mode of the gimbal
gimbal.setMode(gimbalMode){}
}
I used the above code to implement update gimbal mode. But how to check the current gimbal mode for the next time open the application?
Agent comment from yating.liao in Zendesk ticket #104489:
The setStateCallback can be used to set up a status listener for the gimbal. The listener will continuously push updates on the gimbal status, which includes the gimbal mode.
https://developer.dji.com/api-reference/android-api/Components/Gimbal/DJIGimbal_GimbalState.html#djigimbal_gimbalstate_workmode_inline
°°°
I got error when set gimbal mode: Execution of this process has timed out
Agent comment from yating.liao in Zendesk ticket #104489:
Could this error occur consistently? Under what circumstances does this error typically occur?
°°°
This is the code I implemented this feature, please help me check it.
Agent comment from yating.liao in Zendesk ticket #104489:
The code is not error, but the gimbal mode may vary for different aircraft.
°°°
How to check the gimbal mode for each aircraft? My drone is: Air 2s
Most aircraft support FPV and Yaw_Follow modes, with enterprise series drones also offering Free mode as an additional feature.The DJI Air 2s you are using supports FPV and Yaw_Follow modes.
Do you encounter the same issue with your aircraft in the sample code as well?
@dji-lyt I run the sample code, but still show error message is: Execution of this process has timed out
Agent comment from yating.liao in Zendesk ticket #104489:
When you set the gimbal mode to YAW_FOLLOW, what is the current gimbal mode being used by the camera? Can you retrieve it using getMode? If the camera's current mode is YAW_FOLLOW, will setting it to FPV also result in the same error?
Could you please inform us of the MSDK version you are using?
°°°