Dim aircraftjo As JavaObject = aircraft
Dim gimbal As JavaObject = aircraftjo.RunMethod("getGimbal", Null)
If gimbal.IsInitialized Then
Dim cc As Object = gimbal.CreateEventFromUI("dji.common.gimbal.GimbalState$Callback", "callback", Null)
gimbal.RunMethod("setStateCallback", Array As Object(cc))
Wait For (gimbal) callback_Event (MethodName As String, Args() As Object)
Dim gimbalstate As JavaObject= Args(0)
Dim attitude As JavaObject = gimbalstate.RunMethod("getAttitudeInDegrees", Null)
Dim Pitch As Float = attitude.RunMethod("getPitch", Null)
Log("GimbalPitch:" & Pitch)
Else
Log("Gimbal not available.")
End If