Onboard-SDK-ROS icon indicating copy to clipboard operation
Onboard-SDK-ROS copied to clipboard

WaypointsV2 Error with Latitude/Longitude

Open lueninb opened this issue 5 years ago • 1 comments

I believe there is a serious error in how latitude and longitude are being handled in waypointV2.

Planning simple missions causes the drone to fly in the wrong direction. This has been verified by running the sample waypointV2_node.

For example, if I upload a simple mission consisting of two waypoints headed North. 47.924232, -97.020416 47.924323, -97.020412

The drone actually moves West. Downloading the uploaded mission to confirm and printing the mission shows this: [ INFO] [1598918565.799890823]: Init mission setting successfully!

[ INFO] [1598918566.820303709]: Upload waypoint v2 mission successfully!

[ INFO] [1598918566.839945764]: Download waypoint v2 mission successfully!

[ INFO] [1598918566.840322760]: 47.924232, -97.020416, 4.504700

[ INFO] [1598918566.840631307]: 47.924323, -97.020412, 4.504700

So the mission is uploaded correctly and the drone should fly North, but instead it flies West.

This error is also present in the sample waypointV2_node. The drone should start flying West according to the source code:

// Iterative algorithm for (int i = 0; i < polygonNum; i++) { float32_t angle = i * 2 * M_PI / polygonNum; setWaypointV2Defaults(waypointV2); float32_t X = radius * cos(angle); float32_t Y = radius * sin(angle); waypointV2.latitude = Y/EARTH_RADIUS + startPoint.latitude; waypointV2.longitude = X/(EARTH_RADIUS * cos(startPoint.latitude)) + startPoint.longitude; waypointV2.relativeHeight = startPoint.relativeHeight ; waypointList.push_back(waypointV2); ROS_INFO("%f, %f \n", waypointV2.latitude * 180/C_PI, waypointV2.longitude * 180/C_PI); }`

Printing the above waypoints produces (for me): [ INFO] [1598920517.480388291]: 47.924331, -97.020410, 15.000000 [ INFO] [1598920517.480912847]: 47.924331, -97.020330, 15.000000 [ INFO] [1598920517.481141653]: 47.924377, -97.020370, 15.000000 [ INFO] [1598920517.481942216]: 47.924377, -97.020451, 15.000000 [ INFO] [1598920517.482614967]: 47.924331, -97.020491, 15.000000 [ INFO] [1598920517.482838269]: 47.924284, -97.020451, 15.000000 [ INFO] [1598920517.483300455]: 47.924284, -97.020370, 15.000000 [ INFO] [1598920517.483516748]: 47.924331, -97.020410, 15.000000

Which shows that the drone should first move West according to the second waypoint lla. But that does not happen. It actually flies North.

Please address and fix this issue. Thank you

lueninb avatar Sep 01 '20 04:09 lueninb

Agent comment from kyle.cai in Zendesk ticket #38714:

Dear developer ,

Thank you for contacting DJI.

About waypointV2 errors with Latitude/Longitude, we have noticed this issue and submitted for further comfirmation. This issue relates to the OSDK, and about the error, you can refer to https://github.com/dji-sdk/Onboard-SDK/issues/586 .

And then about this issue fixed, suggest you continue to follow the code updates. Sorry for the inconvience to you.

Thank you for your understanding and support, hope you have a nice day.

Best Regards, DJI SDK Support Team

dji-dev avatar Sep 01 '20 07:09 dji-dev