Sub btnStartMission_Click
Dim builder As DJIWaypointMissionBuilder
builder.Initialize
builder.AutoFlightSpeed = 10
builder.MaxFlightSpeed = 15
builder.AddWaypoint(CreateWaypoint(51.8373372, 6.26967794, 40))
Dim wp As DJIWaypoint = CreateWaypoint(51.83850007, 6.26828855, 30)
wp.AddAction("STAY", 3000)
wp.AddAction("GIMBAL_PITCH", -90)
wp.AddAction("START_TAKE_PHOTO", 0)
builder.AddWaypoint(wp)
wp = CreateWaypoint(51.83772032, 6.26845485, 30)
wp.AddAction("GIMBAL_PITCH", 0)
wp.AddAction("START_RECORD", 0)
builder.AddWaypoint(wp)
wp = CreateWaypoint(51.83707127, 6.26887327, 30)
wp.AddAction("STOP_RECORD", 0)
builder.AddWaypoint(wp)
builder.SetFinishAction("GO_FIRST_WAYPOINT")
WaypointOperator.LoadMission(builder)
Log(GetMissionOperatorState)
Wait For (WaypointOperator.UploadMission) WaypointOperator_Result (Success As Boolean, ErrorMessage As String)
If Success Then
Sleep(1000) '<--- required. Otherwise it will fail
Wait For (WaypointOperator.StartMission) WaypointOperator_Result (Success As Boolean, ErrorMessage As String)
Log("Start: " & Success & ", " & ErrorMessage)
MissionState(True)
Else
Log("Error uploading: " & ErrorMessage)
ToastMessageShow("Error uploading: " & ErrorMessage, True)
End If
End Sub