Comments (6)
Hi there, thanks for letting us know about this. Can you share what type of mission you're running when you get this error?
from mobile-sdk-ios.
Thanks for the quick response. Absolutely. This is code that is tied to a button press on an action sheet. It creates a simple waypoint mission, prepares it and starts it. The mission will be flown but during the start of the mission we get the callback with error saying user stopped the mission.
func actionMore() {
let googleAnalyticsAction = "Action - More"
GoogleAnalytics.sharedInstance.trackEvent(googleAnalyticsAction, label: "Open")
let actionSheet = UIAlertController(title: Constants.App.About, message: nil, preferredStyle: .ActionSheet)
actionSheet.addAction(UIAlertAction(title: "cancel".localized, style: .Cancel, handler: { (action) -> Void in
GoogleAnalytics.sharedInstance.trackEvent(googleAnalyticsAction, label: "Cancel")
}))
actionSheet.addAction(UIAlertAction(title: "Test LCMC".localized, style: .Default, handler: { (action) -> Void in
let missionManager = DJIMissionManager.sharedInstance()
let waypointMission = DJIWaypointMission()
if let aircraftLocation = FlightDirector.sharedInstance.telemetry.aircraftZLoc.value?.loc.coordinate {
let height: Float = 30.0
waypointMission.gotoFirstWaypointMode = .Safely
waypointMission.exitMissionOnRCSignalLost = false
waypointMission.removeAllWaypoints()
waypointMission.maxFlightSpeed = 10.0
waypointMission.autoFlightSpeed = 5.0
waypointMission.finishedAction = DJIWaypointMissionFinishedAction.GoHome
waypointMission.headingMode = DJIWaypointMissionHeadingMode.Auto
waypointMission.flightPathMode = DJIWaypointMissionFlightPathMode.Normal
//DJIWaypointMissionAirLineCurve
var point1: CLLocationCoordinate2D
var point2: CLLocationCoordinate2D
var point3: CLLocationCoordinate2D
var point4: CLLocationCoordinate2D
let DEGREE_OF_THIRTY_METER:Double = (0.0000899322 * 3)
point1 = CLLocationCoordinate2DMake(aircraftLocation.latitude + DEGREE_OF_THIRTY_METER, aircraftLocation.longitude)
point2 = CLLocationCoordinate2DMake(aircraftLocation.latitude, aircraftLocation.longitude + DEGREE_OF_THIRTY_METER)
point3 = CLLocationCoordinate2DMake(aircraftLocation.latitude - DEGREE_OF_THIRTY_METER, aircraftLocation.longitude)
point4 = CLLocationCoordinate2DMake(aircraftLocation.latitude, aircraftLocation.longitude - DEGREE_OF_THIRTY_METER)
let wp1: DJIWaypoint = DJIWaypoint(coordinate: point1)
wp1.altitude = height
let wp2: DJIWaypoint = DJIWaypoint(coordinate: point2)
wp2.altitude = height
let wp3: DJIWaypoint = DJIWaypoint(coordinate: point3)
wp3.altitude = height
let wp4: DJIWaypoint = DJIWaypoint(coordinate: point4)
wp4.altitude = height
waypointMission.addWaypoint(wp1)
waypointMission.addWaypoint(wp2)
// waypointMission.addWaypoint(wp3)
// waypointMission.addWaypoint(wp4)
missionManager?.delegate = self
missionManager?.prepareMission(waypointMission, withProgress: {
[weak self] (progress: Float) -> Void in
print(progress)
}, withCompletion:{[weak self] (error: NSError?) -> Void in
print("starting mission")
missionManager?.startMissionExecutionWithCompletion { (startMissionExecutionError: NSError?) in
if let startMissionExecutionErrorValid = startMissionExecutionError {
FlightDirector.sharedInstance.statusFlash.value = FlightDirectorStatus(disposition: .Danger, message: startMissionExecutionErrorValid.localizedDescription)
FlightDirector.sharedInstance.disengage(.DJIMissionManagerError)
return
}
}
})
}}))
from mobile-sdk-ios.
Hi there, thanks for that info. One more question, the SDK will sometimes return that error if the flight controller mode is manually changed while the mission is running, is it possible for you to check if this happens in your app?
One way to check this is via the flight controller delegate method, flightController:didUpdateSystemState:
, which provides a DJIFlightControllerCurrentState
that contains a property flightMode
. If you're using the iOS simulator, you can print the mode: print(\(state.flightMode))
, or if you're doing this on a live flight then compare the current mode to the previous mode and display an alert view in your app if it changes. Let us know if you have a chance to check this. We will also look into this further. Thanks again.
from mobile-sdk-ios.
Thanks for the tip. We did some logging to show the sequence of events.
DJIFlightControllerFlightModeGPSAtti = 6
DJIFlightControllerFlightModeAutoTakeOff = 11
DJIFlightControllerFlightModeGPSWaypoint = 14
DJIFlightControllerFlightModeGoHome = 15
We printed the flight mode enum as our mission uploaded, started, and encountered the error. Is it not strange that we are starting in 6, which is Atti mode? Although the error callback happens when we are in state 11 (auto take off), maybe the trigger is delayed from starting in 6. This test is done using the DJI simulator by the way.
Log:
State = 6
0 mission upload
State = 6
State = 6
0.333333 mission upload
State = 6
State = 6
0.666667 mission upload
State = 6
State = 6
1.0
starting mission
State = 6
State = 6
State = 6
State = 6
State = 6
State = 6
State = 6
State = 6
State = 6
State = 6
State = 6
State = 6
State = 6
State = 6
State = 6
State = 6
State = 6
State = 6
State = 6
State = 6
State = 6
State = 6
State = 11
State = 11
State = 11
State = 11
State = 11
State = 11
State = 11
State = 11
State = 11
State = 11
State = 11
State = 11
State = 11
State = 11
State = 11
State = 11
State = 11
State = 11
State = 11
State = 11
State = 11
didFinishMissionExecution triggered in ModesViewController - ERROR User did stop mission
State = 11
State = 11
State = 11
State = 11
...
from mobile-sdk-ios.
I too am seeing this behavior. After missionManager.startMissionExecution is successful, periodically we see missionManager(_ manager: DJIMissionManager, didFinishMissionExecution) delegate fire before the drone has lifted off. Can happen at start or in the middle of a waypoint mission.
from mobile-sdk-ios.
Mission has been refactored in 4.0.
from mobile-sdk-ios.
Related Issues (20)
- Please remove bitcode support in FFmpeg as soon as possible HOT 6
- DJIWaypointMissionOperator block Camera functions? HOT 1
- Is there a way to extend the object tracking?
- [BUG][M300] SDKCache thread - BAD_ACCESS HOT 22
- Mavic 2 Enterprise Advanced drone model isn't included in list of devices HOT 3
- DJISDKManager.startconnToProd.. doesn't work properly HOT 2
- MediaManager and playVideo function HOT 8
- How should DJIUASRemoteIDManager be used by 3d-party developers? HOT 1
- Swift demo crashes on device connection on iOS 16 HOT 5
- Cannot fetch camera serial number/firmware on M300 RTK (P1 camera) failed HOT 5
- Mavic mini 2 uploadMission error: Execution of this process has timed out HOT 2
- How to check if compass is calibrated using iOS SDK HOT 1
- Confirm gimbal attitudeInDegrees "North Pole" reference HOT 1
- Latest XCode version: Library not found for -lDJIWidget Linker command failed with exit code 1 (use -v to see invocation) HOT 6
- DJI Assistant 2 no longer works for Mac OS 11 or later? HOT 1
- DJISDK 4.16.2 + M300RTK FW 06.01.0100 Fails to recover mission HOT 2
- DJI-SDK 4.16.2 - crash when exiting our app HOT 1
- Cannot run the swift demo on M1 Macbook pro HOT 1
- Add support for privacy manifest
- How to get total distance and total time of aircraft flight? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mobile-sdk-ios.