In my DJI Mobile app, I want to rotate the gimbal in the roll axis, so I can level the horizon.
I'm trying to do this with a JavaObject.
I dimention my JavaObject in Process_Globals, and assign them values in Activity_Create,
since I figure I'm going to be using them a lot in my program.
I want to have a sub that rotates the gimbal like this:
Sub RotateGimbal(direction,degrees)
GimbalInstance.RunMethod("rotate",Array(??????))
this is the java method void rotate(@NonNull final Rotation rotation, @Nullable final CompletionCallback callback)
' Rotation is a class
End Sub
But I don't know how to pass rotate's parameters to it with java object?
How do these parameters (@NonNull final Rotation rotation, @Nullable final CompletionCallback callback) go in Array(??????)
Steve
I'm trying to do this with a JavaObject.
I dimention my JavaObject in Process_Globals, and assign them values in Activity_Create,
since I figure I'm going to be using them a lot in my program.
B4X:
Sub Process_Globals
Dim AircraftInstance As JavaObject
Dim AirlinkInstance As JavaObject
Dim GimbalInstance As JavaObject
sub AfterAircraftConnected
AircraftInstance=aircraft
GimbalInstance=AircraftInstance.RunMethod("getGimbal", Null)
AirlinkInstance=AircraftInstance.RunMethod("getAirLink", Null)
I want to have a sub that rotates the gimbal like this:
Sub RotateGimbal(direction,degrees)
GimbalInstance.RunMethod("rotate",Array(??????))
this is the java method void rotate(@NonNull final Rotation rotation, @Nullable final CompletionCallback callback)
' Rotation is a class
End Sub
But I don't know how to pass rotate's parameters to it with java object?
How do these parameters (@NonNull final Rotation rotation, @Nullable final CompletionCallback callback) go in Array(??????)
Steve
Last edited: