I am using DJI sample code to run a timeline mission.
The first time I run the mission it runs fine. However the second time I get a DJIMissionControlTimelineEventStartError - Navigation mode not open when a GoToAction is executed. This element is second in the list after TakeOffAction.
So I cannot run consecutive missions without restarting the app.
I cannot find any detail in the docs or online anywhere. How can I get the Timeline controller back to a good state after this happens?
- (IBAction)onStartButtonClicked:(id)sender
{
[[DJISDKManager missionControl] addListener:self
toTimelineProgressWithBlock:^(DJIMissionControlTimelineEvent event, id<DJIMissionControlTimelineElement> _Nullable element, NSError * _Nullable error, id _Nullable info)
{
if (error) {
NSLog(@"ERROR: %@", error.localizedDescription);
}
if (error) {
[[DJISDKManager missionControl] stopTimeline];
[[DJISDKManager missionControl] unscheduleEverything];
}
}];
[[DJISDKManager missionControl] startTimeline];
}
- (IBAction)onStopButtonClicked:(id)sender
{
[[DJISDKManager missionControl] stopTimeline];
[[DJISDKManager missionControl] unscheduleEverything];
[[DJISDKManager missionControl] removeListener:self];
}
Timeline Elements I have scheduled
- TakeOffAction
- GoToAction
- GimbalAttitudeAction
- ShootPhotoAction - newShootSinglePhotoAction
- GimbalAttitudeAction
- AircraftYawAction
- ShootPhotoAction - newShootSinglePhotoAction
- AircraftYawAction
- ShootPhotoAction - newShootSinglePhotoAction
- AircraftYawAction
- ShootPhotoAction - newShootSinglePhotoAction
- repeated to get 3 rows of photos at different gimbal pitches...