dji-sdk / Mobile-SDK-Android

DJI Mobile SDK for Android: http://developer.dji.com/mobile-sdk/
Other
972 stars 580 forks source link

Gimbal mode #1283

Closed huongta157 closed 1 month ago

huongta157 commented 2 months ago
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?

dji-dev commented 2 months ago

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

°°°

huongta157 commented 2 months ago

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

dji-dev commented 2 months ago

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

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

°°°

huongta157 commented 2 months ago

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

dji-dev commented 2 months ago

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

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

°°°

huongta157 commented 2 months ago

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

dji-lyt commented 2 months ago

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

huongta157 commented 1 month ago

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

dji-dev commented 1 month ago

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?

°°°