Closed tongzahub closed 8 years ago
the listener passed to startGimbalControl
and updateGimbalOrientation
must be non-null. You should start control before you attempt to update the orientation, the listener you use to startGimbalControl
must be the same listener you use for all other communication with the GimbalApi until you stopGimbalControl
. Also you may want to store the GimbalApi in a variable so that you don't have to get a new one everytime you make an Api call.
could you show me some example for this case? thank you
You can take a look at this class https://github.com/DroidPlanner/Tower/blob/b47ef5305e5e91f9291bdb347a0462fc1524d49d/Android/src/org/droidplanner/android/fragments/widget/video/FullWidgetSoloLinkVideo.kt
It's in Kotlin but you should be able to figure out what it's doing. Essentially, the gimbal is manually controlled when the user touches the video stream view
how to set GimbalApi on button OnClick
GimbalApi.getApi(dpApp.getDrone()).updateGimbalOrientation(90,90,90,null); GimbalApi.getApi(dpApp.getDrone()).startGimbalControl(null);