Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start mission failed: Waypoint number should be within 2 to 65535 #435

Open
otoo-peacemaker opened this issue Oct 19, 2024 · 1 comment
Open

Comments

@otoo-peacemaker
Copy link

otoo-peacemaker commented Oct 19, 2024

I have been able to create a kmz file, pushed and upload is successfully but mission cannot start.

main err: Start mission failed: Failed to execute flight route. Waypoint number error. Waypoint number should be within 2 to 65535
device: mavic 3 enterprise
simulator: DJI Assistant 2 (Enterprise)
Log info:

CreateFromKmlFile : 1
kmzFilePath : /storage/emulated/0/Android/data/mypackagename/files/DJI/waypoint/generate_test.kmz
Save Kmz Success Path is : /storage/emulated/0/Android/data/mypackagename/files/DJI/waypoint/generate_test.kmz
::waypointFile
 /storage/emulated/0/Android/data/mypackagename/files/DJI/waypoint/generate_test.kmz
State is UPLOADING
Upload State: progress:90.0 
Upload State: progress:90.0 
Upload State: progress:100.0 
Upload State: progress:100.0 
Mission Upload Success
State is READY
Mission Upload Success
::waylineIds 0
Start mission failed: Failed to execute flight route. Waypoint number error. Waypoint number should be within 2 to 65535

this is how I created the kmz file

    private fun createWaylineTemplateObject() {
        val distance = 3.0f
        val missionInfoModel = MissionInfoModel()
        missionInfoModel.distance = distance
        val kmzOutPath = rootDir + "generate_test.kmz"
        //create wayline mission
        val waylineMission: WaylineMission = createWaylineMission(missionInfoModel)
        val missionConfig: WaylineMissionConfig = KMZTestUtil.createMissionConfig()
        //create and generate KMZ file
        println("inside::${infoModelArrayList[0].waylineWaypoint.location}")
        val template: Template = KMZTestUtil.createTemplate(infoModelArrayList)
        WPMZManager.getInstance().generateKMZFile(kmzOutPath, waylineMission, missionConfig, template)
        curMissionPath = kmzOutPath
        wayPointV3VM.setCurrentPath(curMissionPath)
        println("Save Kmz Success Path is : $kmzOutPath")
    }

onstart mission button clicked

     
btnFly.setOnClickListener {
                createWaylineTemplateObject()
                val waypointFile = File(curMissionPath)
                println("::waypointFile\n $waypointFile")
                val waylineIds = wayPointV3VM.getAvailableWaylineIDs(curMissionPath).last()
                println("::waylineIds $waylineIds")
                selectWaylines.add(waylineIds)
                if (waypointFile.exists()) {
                    wayPointV3VM.pushKMZFileToAircraft(curMissionPath)
                } else {
                   println("Mission file not found!")
                    return@setOnClickListener
                }
                //: Delay for 10 seconds
                Handler(Looper.getMainLooper()).postDelayed({
            
                    wayPointV3VM.startMission(
                        FileUtils.getFileName(curMissionPath, WAYPOINT_FILE_TAG),
                        selectWaylines,
                        object : CommonCallbacks.CompletionCallback {
                            override fun onSuccess() {
                                println("Start mission success")
                            }
                            override fun onFailure(error: IDJIError) {
                                println("Start mission failed: ${getErrorMsg(error)}")
                            }
                        }
                    )
                }, 10000)  // 10-second delay
            }
@dji-dev
Copy link
Contributor

dji-dev commented Oct 21, 2024

Agent comment from yating.liao in Zendesk ticket #119816:

This error indicates that the waypoint index has not been set or is out of range. Could you please send us the contents of waylines.wpml for analysis?

°°°

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants