At Waypoint mission, Upload Mission is finished incompletely.
ajy720 opened this issue · 5 comments
I want to execute Waypoint Mission.
So I'm running the method and checking the error message in the following order.
Init Mission -> SetGroundStationMode -> LoadMission -> GetLoadedMission -> UploadMission -> StartMission
There was no problem until LoadMission, but there was a problem with UploadMission.
The waypoint is uploaded one by one, uploaded to the last mission and returned to the "READY_TO_UPLOAD" state, or the "UPLOADING" state is maintained.
The code used is the one that successfully executed Waypoint Mission in MAVIC 2 ENTERPRISE.
code:
private async void Mission_execute(object sender, RoutedEventArgs a)
{
BoolMsg yn = new BoolMsg();
yn.value = true;
SDKError err = await DJISDKManager.Instance.ComponentManager.GetFlightControllerHandler(0, 0).SetGroundStationModeEnabledAsync(yn);
Debug.WriteLine("GSM err : " + err.ToString());
DJISDKManager.Instance.WaypointMissionManager.GetWaypointMissionHandler(0).StateChanged += Waypoint_Mission_State;
err = DJISDKManager.Instance.WaypointMissionManager.GetWaypointMissionHandler(0).LoadMission(this.WaypointMission);
if (err != SDKError.NO_ERROR)
{
String dialogMsg = "Failed to Load => " + err.ToString();
Debug.WriteLine(dialogMsg);
return;
}
else Debug.WriteLine("Success to Load");
err = await DJISDKManager.Instance.WaypointMissionManager.GetWaypointMissionHandler(0).UploadMission();
if (err != SDKError.NO_ERROR)
{
String dialogMsg = "Failed to upload => " + err.ToString();
Debug.WriteLine(dialogMsg);
return;
}
else
{
Debug.WriteLine("Success to Upload");
DJISDKManager.Instance.WaypointMissionManager.GetWaypointMissionHandler(0).UploadStateChanged += Upload_State;
}
err = await DJISDKManager.Instance.WaypointMissionManager.GetWaypointMissionHandler(0).StartMission();
if (err != SDKError.NO_ERROR)
{
String dialogMsg = "Failed to start mission => " + err.ToString();
Debug.WriteLine(dialogMsg);
return;
}
else Debug.WriteLine("Success to Start");
}
My development environment is like this:
OS : Windows 10
IDE : Visual Studio 2019
Development Language: C#
Drone: MAVIC 2 ZOOM (Firmware: V01.00.0510(latest firware)) & MAVIC AIR
SDK Version: 0.3.1
Public comment from Hummels Lei in Zendesk ticket #29206:
Hi, you say "The code used is the one that successfully executed Waypoint Mission in MAVIC 2 ENTERPRISE". Do you mean this code doesn't work well in Mavic air and Mavic 2 ZOOM? Can you provide more information about waypoint parameters?
Yes. That's right.
Above code doesn't work in Mavic air and Mavic 2 ZOOM.
Here is my Waypoint Mission parameters.
And I tested it both in the simulator at DJI Assistant 2 for Mavic and in the real world.
private void Init_Mission(object sender, RoutedEventArgs e)
{
double nowLat = Convert.ToDouble(DD.Location().Latitude());
double nowLng = Convert.ToDouble(DD.Location().Longitude());
WaypointMission = new WaypointMission()
{
waypointCount = 3,
maxFlightSpeed = 15,
autoFlightSpeed = 10,
finishedAction = WaypointMissionFinishedAction.NO_ACTION,
headingMode = WaypointMissionHeadingMode.AUTO,
flightPathMode = WaypointMissionFlightPathMode.NORMAL,
gotoFirstWaypointMode = WaypointMissionGotoFirstWaypointMode.SAFELY,
exitMissionOnRCSignalLostEnabled = false,
pointOfInterest = new LocationCoordinate2D()
{
latitude = 0,
longitude = 0
},
gimbalPitchRotationEnabled = true,
repeatTimes = 0,
missionID = 0,
waypoints = new List<Waypoint>()
{
InitDumpWaypoint(nowLat+0.001, nowLng+0.0015),
InitDumpWaypoint(nowLat+0.001, nowLng-0.0015)/*,
InitDumpWaypoint(nowLat-0.001, nowLng-0.0015),
InitDumpWaypoint(nowLat-0.001, nowLng+0.0015)*/
}
};
}
private Waypoint InitDumpWaypoint(double latitude, double longitude)
{
Waypoint waypoint = new Waypoint()
{
location = new LocationCoordinate2D() { latitude = latitude, longitude = longitude },
altitude = 20,
turnMode = WaypointTurnMode.CLOCKWISE,
heading = 0,
gimbalPitch = -30,
actionRepeatTimes = 1,
actionTimeoutInSeconds = 60,
cornerRadiusInMeters = 0.2,
speed = 0,
shootPhotoTimeInterval = -1,
shootPhotoDistanceInterval = -1,
waypointActions = new List<WaypointAction>()
{
InitDumpWaypointAction(1000, WaypointActionType.STAY)
}
};
return waypoint;
}
private WaypointAction InitDumpWaypointAction(int Param, WaypointActionType actiontype)
{
WaypointAction action = new WaypointAction()
{
actionType = actiontype,
actionParam = Param
};
return action;
}
Thank you for reply.
Public comment from Hummels Lei in Zendesk ticket #29206:
Hi, Mavic air and Mavic 2 ZOOM can't execute a waypoint mission. I want to know if you can see the FPV image of Mavic air and Mavic 2 ZOOM on windows SDK program.
Yes, I can't see the FPV image of Mavic 2 ZOOM on windows SDK program.
What should I do?
Public comment from Hummels Lei in Zendesk ticket #29206:
Hi please check:
1 You are using the latest version of the Windows SDK(0.3.2).
2 The remote control you are using is not Smart Controller(https://www.dji.com/smart-controller?site=brandsite&from=insite_search).
3 You have already installed the driver follow the instructions on https://developer.dji.com/windows-sdk/documentation/connection/Mavic2.html.
And I think this issue(#32) may help you.