dji-sdk / Mobile-SDK-iOS

DJI Mobile SDK for iOS: http://developer.dji.com/mobile-sdk/
Other
576 stars 254 forks source link

Error: 'Navigation mode not open' running Timeline #357

Open brien-crean opened 4 years ago

brien-crean commented 4 years ago

I am using the sample code from the Objective C example TimelineMissionViewController.m as a reference 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. So I cannot run consecutive missions without restarting the app.

What does this error mean? I cannot find any detail in the docs or online anywhere. How can I get the Timeline back to a good state after this happens?

My code:

- (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];
}

MSDK version: 4.11.1 Drone: Mavic Pro Firmware version: 01.04.0500

Thanks!

dji-dev commented 4 years ago

Public comment from Luce Luo in Zendesk ticket #32588:

Dear Customer,

Thank you for contacting DJI. I need to escalate this issue to the engineer to confirm first. Can you tell me which specific task/step the error occurs?

Thanks,

Luce Luo DJI Dev Team

brien-crean commented 4 years ago

Thanks for the reply @dji-dev

It happens when [[DJISDKManager missionControl] startTimeline]; is executed. I see the error come through the event listener addListenertoTimelineProgressWithBlock.

I also checked to see that prior to my onStartButtonClicked being called that elements have successfully been scheduled in the timeline through a separate function. Let me know if you need more information.

dji-dev commented 4 years ago

Public comment from Luce Luo in Zendesk ticket #32588:

Dear Customer,

Thank you for contacting DJI. Does it always occur in a specific element such as 'takeoff', 'Hotpoint', etc or random? Can you tell me what elements you have scheduled?

Thanks,

Luce Luo DJI Dev Team

brien-crean commented 4 years ago

@dji-dev It always happens at the very beginning of the timeline which is a GoToAction. It runs fine on the first run. I also tried adding a TakeOffAction before the GoToAction and noticed that this action always succeeds. Then it fails on the GoToAction which is second in the list of timeline elements scheduled

DJIGoToAction* action = [[DJIGoToAction alloc] initWithCoordinate:CLLocationCoordinate2DMake(coordinate.latitude, coordinate.longitude) altitude:altitude];

I am running a timeline mission to capture a panorama. Here is a subset of the action types scheduled

List of elements scheduled TakeOffAction GoToAction GimbalAttitudeAction ShootPhotoAction - newShootSinglePhotoAction GimbalAttitudeAction AircraftYawAction ShootPhotoAction - newShootSinglePhotoAction repeated to get 3 rows of photos at different gimbal pitches...

dji-dev commented 4 years ago

Public comment from Luce Luo in Zendesk ticket #32588:

Dear Customer,

Thank you for contacting DJI. Ok, this issue has been escalated to the engineer. It will cost some time and we will contact you again once any update.

Thanks,

Luce Luo DJI Dev Team

lleoncinicds commented 4 years ago

We have the same issue, it happens using the TimeLine or with the standalone waypoint mission methods. This is a problem because we can't reprogramate the mission during the flight.

dji-dev commented 4 years ago

Agent comment from Luce Luo in Zendesk ticket #32588:

Dear Customer,

Thank you for contacting DJI. Sorry for the late reply. I'm here just want to inform you that this error will be fixed in the 4.12 version. I can't give you the exact date and please pay attention to the official release.

Thanks,

Luce Luo DJI Dev Team