dji-sdk / Mobile-SDK-iOS

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

M300 RTK not support waypointMission? #416

Closed dingpwen closed 3 years ago

dingpwen commented 3 years ago

When loadMission, it tell me: This feature is not supported in the SDK(code:-1000)

My code similiar as :

and then:

NSError *error = [[DJISDKManager missionControl].waypointMissionOperator loadMission:_waypointMission]; if (error) { [ZQLog bLogI:[NSString stringWithFormat:@"load mission fail:%@", error.description]]; return errorBlock(error.description); }

and some other: //接下来要飞行区域的安全点 DJIWaypoint *waypoint = [self createWaypoint:second safePoint:YES];

double yaw = [self obtainHeadingAngle:second];
[waypoint addAction:[[DJIWaypointAction alloc] initWithActionType:DJIWaypointActionTypeRotateAircraft param:yaw]];
[self.waypointMission addWaypoint:waypoint];

//接下来要飞行区域的中心点
DJIWaypoint *centerWaypoint = [self createWaypoint:second safePoint:NO];
[centerWaypoint addAction:[[DJIWaypointAction alloc] initWithActionType:DJIWaypointActionTypeStay param:1000]];
[self.waypointMission addWaypoint:centerWaypoint];

MY sdk: use_frameworks! pod 'DJI-SDK-iOS','~> 4.13.1' pod 'DJI-UXSDK-iOS', '~> 4.13' pod 'DJIWidget', '~> 1.6.3'

dingpwen commented 3 years ago

I will try WaypointV2MissionOperator tomorrow.

Matheus193dn commented 3 years ago

Hi, I have tried with WaypointV2Mission, it worked but once drone started, app crashed too.

dji-dev commented 3 years ago

Agent comment from William Wong in Zendesk ticket #42311:

Dear Client Thank you for contacting DJI.

Please use WaypointV2Mission for M300RTK.

Hopefully our solution can help you. Kindly Regards, DJI Developer Support

dingpwen commented 3 years ago

Dear DJI: When use WaypointV2Mission , and when trying to uploadWaypointActions: __weak typeof(self) weakSelf = self; [self.missionOperator uploadWaypointActions:self.actionList withCompletion:^(NSError * _Nullable error) { if(error) { [ZQLog bLogI:[NSString stringWithFormat:@"upload mission action fail:%@", error.description]]; return errorBlock(error.description); } else { [ZQLog bLogI:@"upload actions success"]; weakSelf.missionState = BRWaypointMissionStateUploadAction; [weakSelf startWaypointMissionWithSuccess:successBlock error:errorBlock]; } }];

It tell me:Unknown Error!(code -1999)

and when i am trying to ignore action and rederect to startMissionWithCompletion :

[self.missionOperator startMissionWithCompletion:^(NSError * _Nullable error) {
    if (error) {
        [ZQLog bLogI:[NSString stringWithFormat:@"start mission fail with eror:%@", error.description]];
        return errorBlock(error.description);
    }
    else {
        weakSelf.isReachPoint = NO;
        return successBlock();
    }
}];

It also tells me: Unknown Error!(code -1999)

what‘s mean of this?

Matheus193dn commented 3 years ago

Did you update all devices and M300 to latest firmware? I used to have the same error as you until I updated latest firmware. ONLY my app crashed when I call start function, I still see my drone do mission on assistant app.

dingpwen commented 3 years ago

Did you update all devices and M300 to latest firmware? I used to have the same error as you until I updated latest firmware. ONLY my app crashed when I call start function, I still see my drone do mission on assistant app.

I update the firmware yestoday.

dingpwen commented 3 years ago

Did you update all devices and M300 to latest firmware? I used to have the same error as you until I updated latest firmware. ONLY my app crashed when I call start function, I still see my drone do mission on assistant app.

Dear sir, your sdk version is the newest?

Matheus193dn commented 3 years ago

Did you update all devices and M300 to latest firmware? I used to have the same error as you until I updated latest firmware. ONLY my app crashed when I call start function, I still see my drone do mission on assistant app.

Dear sir, your sdk version is the newest?

Yes, I'm using the latest version 4.14

Matheus193dn commented 3 years ago

@dingpwen if you need sample code for WaypointV2, I can help BUT once I call startMission function, my app crashed too.

dingpwen commented 3 years ago

wrong to close it!

edupazpix4d commented 3 years ago

I have WaypointV2 missions working. With different actuators, triggers, and waypoints. I still see some issues when executing several actions in the same waypoint.

My recommendation is to use all the listeners available to track the upload of the waypoints and actions successfully.

Matheus193dn commented 3 years ago

@edupazpix4d You are using Swift or Obj-C? I wrote my app in Swift, it crashed once i call startMission, BUT when i observe drone via assistant app(for Matrice), i saw it do exactly what i uploaded to mission's actions.

edupazpix4d commented 3 years ago

@Matheus193dn I'm using ObjC. By using MobileSDK 4.14-trial1 I have observed many features are not being implemented or they work as they should be.

What about the listeners? They should tell you when the mission is going to start.

Matheus193dn commented 3 years ago

@edupazpix4d Of course, i implement all listeners right after i call operator.loadmission. From DJIWaypointV2MissionExecutionEvent, the event.progress prints to console "Mission is executing" then my app crashed.

edupazpix4d commented 3 years ago

Are you doing anything else with the drone? Like live feed, camera settings?

I have experience some crashes when using some of the new functions to set up the camera.

Matheus193dn commented 3 years ago

@edupazpix4d I have done FPV with M300 here my code https://github.com/dji-sdk/Mobile-SDK-iOS/issues/413. If you are using drone (not M300), plz use older version of SDK, the others settings of camera still work fine(EV, IsoThermal, Zoom, Focus..). My app also crashed if i use new DecodeLogic & VideoAdapter in FPV (not M300).

edupazpix4d commented 3 years ago

Oh, I have seen your code before. I have live feed working with Zenmuse H20T. But there are some features not being very well supported. I opened several issues #422 #421 #417

Matheus193dn commented 3 years ago

Haha, you can try your luck in CN forum. My code for live FPV was found there but from an android guy not iOS.

dingpwen commented 3 years ago

After update sdk to 4.14-trial1, it always tell me: The aircraft home point is not recorded yet,(code:9039)

The true is that, I have set the home location using current location by RC.

Matheus193dn commented 3 years ago

@dingpwen you must use function of remote controller to disable RTK

dingpwen commented 3 years ago

@dingpwen you must use function of remote controller to disable RTK

3ks, when close RTK, and without any actions upload, my drone fly successfully. and app not crashed. I will try actions next.

Matheus193dn commented 3 years ago

@dingpwen Are you coding on Swift?

dingpwen commented 3 years ago

@dingpwen Are you coding on Swift?

OC

Matheus193dn commented 3 years ago

@dingpwen Are you coding on Swift?

OC

oh, i’m writting on Swift, seems i need to make a clean project to test the mission

dingpwen commented 3 years ago

@dingpwen Are you coding on Swift?

OC

oh, i’m writting on Swift, seems i need to make a clean project to test the mission

When I add some actions, it show me: Unkown Error!(Code:-1999) now. My codes:

pragma mark create a reach trigger

-(DJIWaypointV2Trigger)reachTriger:(NSInteger)startIndex endWith:(NSInteger)endIndex{ DJIWaypointV2Trigger trigger = [[DJIWaypointV2Trigger alloc]init]; trigger.actionTriggerType = DJIWaypointV2ActionTriggerTypeReachPoint; DJIWaypointV2ReachPointTriggerParam *param = [[DJIWaypointV2ReachPointTriggerParam alloc]init]; param.startIndex = startIndex; param.waypointCountToTerminate = endIndex; trigger.reachPointTriggerParam = param; return trigger; }

pragma mark add rotate action of M300

-(void)addRotateAircraftAction:(NSInteger)startIndex endWith:(NSInteger)endIndex withAngle:(double)yaw{ DJIWaypointV2Action *action = [[DJIWaypointV2Action alloc]init]; action.trigger = [self reachTriger:startIndex endWith:endIndex];

action.actuator = [[DJIWaypointV2Actuator alloc]init];
action.actuator.type = DJIWaypointV2ActionActuatorTypeAircraftControl;
DJIWaypointV2AircraftControlParam *acParam = [[DJIWaypointV2AircraftControlParam alloc]init];
acParam.operationType = DJIWaypointV2ActionActuatorAircraftControlOperationTypeRotateYaw;
DJIWaypointV2AircraftControlRotateHeadingParam *hParam = [[DJIWaypointV2AircraftControlRotateHeadingParam alloc]init];
hParam.heading = yaw;
acParam.yawRotatingParam = hParam;
[self.actionList addObject:action];

}

and startIndex = 0, when called.

mission follow: load success --> upload success -> upload actions success -> start mission fail!

edupazpix4d commented 3 years ago

I don't see action.actuator.aircraftControlActuatorParam = acParam;

dingpwen commented 3 years ago

I don't see action.actuator.aircraftControlActuatorParam = acParam;

Oh, my god!

dingpwen commented 3 years ago

I don't see action.actuator.aircraftControlActuatorParam = acParam;

When add this code, start mission with the same problem, but when i start mission again, drone fly successfully! It means some delay need when upload actions?

dingpwen commented 3 years ago

I don't see action.actuator.aircraftControlActuatorParam = acParam;

Thank you very much. I find the reason, start mission should be running in main thread!

dingpwen commented 3 years ago

@Matheus193dn @edupazpix4d

I really don't know how to thank you for your help, and only to say, you are all super-man!

edupazpix4d commented 3 years ago

@dingpwen 不客气

Matheus193dn commented 3 years ago

@dingpwen you're welcome

dingpwen commented 3 years ago

When RTK is closed, WaypointV2Mission is ok.

Matheus193dn commented 3 years ago

@dingpwen plz remember to enable it when you flight outside

aidinism commented 2 years ago

So waypointMissionV2 works outside with RTK enabled?

Matheus193dn commented 2 years ago

So waypointMissionV2 works outside with RTK enabled?

Hi, i no longer work with DJI Drone, but as I remembered plz enabled(must be) it when you fly outside.