How do i rotate the gimbal pitch?

Viewed 144

I want to move my gimbal pitch to move between two angles, one at 0 degrees and one at - 90 degrees, im really new at android studio and dji-msdk, and it cant seem to figure how to make the gimbal rotate.

the dji API reference only confuses me more as they dont really elaborate on how some parts of the code would be able to contribute towards making the gimbal rotate.

the API reference recommends me to use this as a method to make the gimbal rotate

void rotate(@NonNull final Rotation rotation, @Nullable final CommonCallbacks.CompletionCallback callback) {}

Link to API: https://developer.dji.com/api-reference/android-api/Components/Gimbal/DJIGimbal.html#djigimbal_rotategimbalwithrotation_inline

1 Answers
public static void setGimbalPitch(float pitch, double time) {
    Rotation.Builder builder = new Rotation.Builder().mode(RotationMode.ABSOLUTE_ANGLE).time(time);
    builder.pitch(pitch);
    getAircraftInstance().getGimbal().getGimbal().rotate(builder.build(), (x) -> {
        if (x != null) Log.d("getGimbal().rotate", x.toString());
    });
}
Related