Mobile-SDK-Android icon indicating copy to clipboard operation
Mobile-SDK-Android copied to clipboard

Gimbal mode

Open huongta157 opened this issue 10 months ago • 9 comments

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?

huongta157 avatar Apr 08 '24 08:04 huongta157

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

°°°

dji-dev avatar Apr 09 '24 11:04 dji-dev

I got error when set gimbal mode: Execution of this process has timed out

huongta157 avatar Apr 10 '24 07:04 huongta157

Agent comment from yating.liao in Zendesk ticket #104489:

Could this error occur consistently? Under what circumstances does this error typically occur?

°°°

dji-dev avatar Apr 10 '24 12:04 dji-dev

Screenshot 2024-04-26 at 11 46 10 This is the code I implemented this feature, please help me check it.

huongta157 avatar Apr 26 '24 04:04 huongta157

Agent comment from yating.liao in Zendesk ticket #104489:

The code is not error, but the gimbal mode may vary for different aircraft.

°°°

dji-dev avatar Apr 26 '24 10:04 dji-dev

How to check the gimbal mode for each aircraft? My drone is: Air 2s

huongta157 avatar Apr 29 '24 01:04 huongta157

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? image

dji-lyt avatar Apr 29 '24 07:04 dji-lyt

@dji-lyt I run the sample code, but still show error message is: Execution of this process has timed out

huongta157 avatar May 13 '24 04:05 huongta157

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?

°°°

dji-dev avatar May 13 '24 10:05 dji-dev