dji-sdk / Mobile-SDK-Android

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

Gimbal state listener and Rotation not working with Air 2S #1156

Open Padreco-lbr opened 2 years ago

Padreco-lbr commented 2 years ago

SDK Version: 4.16.1

Following bugs have been found using Mavic Air 2S, same code workson Mavic 2 Zoom:

dji-dev commented 2 years ago

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

Could you tell me how to reproduce this problem?We have not encountered this problem before.

°°°

Padreco-lbr commented 2 years ago

Just move the gimbal with Air 2S using the same code with RotationMode.REALTIVE_ANGLE, then try to reset it with RotationMode.ABSOLUTE_ANGLE.

In Kotlin, with :

val rotation = Rotation.Builder()
        .mode(RotationMode.ABSOLUTE_ANGLE)
        .pitch(0).roll(0).yaw(0).time(.5)
        .build()

Both:

val gimbalKey = GimbalKey.create(GimbalKey.ROTATE)
keyManager?.performAction(
    gimbalKey,
    someLogActionCallback,
    rotation
)

And:

aircraft.gimbals[0].rotate(rotation, someLogCallback)

None of the Gimbal::reset methods work as well. They return as success but does not move the gimbal.

Using RotationMode.RElaTIVE_ANGLE works but makes it impossible to reset the gimbal, even if trying to track GimbalState, which is not possible since Gimbal::setStateCallback does not trigger as well.

dji-dev commented 2 years ago

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

What GimbalMode are you using? In fact, we will change the logic of the head rotation in 4.16.2. In YAW_FOLLOW mode, the fuselage will rotate together with the gimbal. in FPV mode, the gimbal will rotate independently of the fuselage.

Version 4.16.2 is expected to be released in just these two weeks, so maybe you can try to check if this problem still occurs in version 4.16.2.

°°°