dji-sdk / Mobile-SDK-Android

DJI Mobile SDK for Android: http://developer.dji.com/mobile-sdk/
Other
978 stars 579 forks source link

WaypointMissionOperator checkParameters never returns with Matrice 100 / 600 #454

Open rabbishuki opened 4 years ago

rabbishuki commented 4 years ago

The same code works perfectly on the P4A but fails on the Matrice 100.

Here are the relevant parts of my code in Kotlin.

  1. Create a list of waypoints.

    val waypointList: List<Waypoint> = data.points.map {
    val waypoint = Waypoint(it.latitude, it.longitude, it.altitude)
    waypoint.speed = 3
    waypoint.heading = 0
    waypoint.gimbalPitch = 0
    waypoint.turnMode = WaypointTurnMode.CLOCKWISE
    
    waypoint.actionRepeatTimes = 1
    waypoint.actionTimeoutInSeconds = 3
    waypoint.cornerRadiusInMeters = 1
    waypoint
    }
  2. Create a WaypointMission.Builder Object

    val mission = WaypointMission.Builder()
    .waypointList(waypointList)
    .waypointCount(waypointList.size)
    .autoFlightSpeed(10)
    .repeatTimes(1)
    .setGimbalPitchRotationEnabled(false)
    .setExitMissionOnRCSignalLostEnabled(false)
    .finishedAction(WaypointMissionFinishedAction.NO_ACTION)
    .maxFlightSpeed(13)
    .flightPathMode(WaypointMissionFlightPathMode.CURVED)
    .headingMode(WaypointMissionHeadingMode.AUTO)
    .gotoFirstWaypointMode(WaypointMissionGotoWaypointMode.POINT_TO_POINT)
  3. mission.checkParameters()

  4. WaypointOperator.loadMission(mission.build())

  5. WaypointOperator.uploadMission()

With the P4A: the code continues with no error, and goes off to the waypoint mission. With Matrice 100, the checkParameters function in step 3 returns no result and the code just stalls here with the WaypointOperator.currentState staying at READY_TO_UPLOAD

I have tried everything in the last 2 days, and the only thing I can guess is that I am missing some parameter that the Matrice 100 needs, but I have no clue what that might be, and can't find anything in the documentation about it.

rabbishuki commented 4 years ago

Just checked the Matrice 600, and it also doesn't work.

rabbishuki commented 4 years ago

Apparently this is a bug with version 4.11

Prerequisites:

Steps to reproduce:

  1. Open the sample SDK
  2. Click "Open" after the drone connects
  3. Click "New Waypoint Mission Operator"
  4. Click "Load"
  5. App crashes with the following stack
    com.dji.sdk.sample E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.dji.sdk.sample, PID: 14107
    java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object java.util.Map.get(java.lang.Object)' on a null object reference
    at dji.common.mission.waypoint.Waypoint.checkParameters(Unknown Source:15)
    at dji.common.mission.MissionUtils.checkEachWaypointValid(Unknown Source:18)
    at dji.common.mission.MissionUtils.checkWaypointMissionParameters(Unknown Source:44)
    at dji.common.mission.waypoint.WaypointMission$Builder.checkParameters(Unknown Source:10)
    at dji.internal.mission.abstraction.waypoint.WaypointMissionAbstraction.a(Unknown Source:0)
    at dji.sdk.mission.waypoint.WaypointMissionOperator.loadMission(Unknown Source:32)
    at com.dji.sdk.sample.demo.missionoperator.WaypointMissionOperatorView.onClick(:107)
    at android.view.View.performClick(View.java:6310)
    at android.view.View$PerformClick.run(View.java:24970)
    at android.os.Handler.handleCallback(Handler.java:794)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:176)
    at android.app.ActivityThread.main(ActivityThread.java:6662)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
dji-dev commented 4 years ago

Public comment from Luce Luo in Zendesk ticket #29940:

Dear Customer,

Thank you for contacting DJI. Sorry, this issue has been reported to the engineer. Please pay attention to the next release and use a lower version such as v4.10 for the being time.

Thanks,

Luce Luo DJI Dev Team

dji-dev commented 4 years ago

Public comment from Luce Luo in Zendesk ticket #29940:

Dear Customer,

Thank you for contacting DJI. Great to tell you this good news. After confirming, this problem only occurs when your aircraft is not mounting the camera. So, for the temporary workaround, you can mount a camera on your drone when you using v4.11. Also, this issue will be fixed in the coming v4.11.1 official release.

Thanks,

Luce Luo DJI Dev Team