apm_planner icon indicating copy to clipboard operation
apm_planner copied to clipboard

WIP: modify KML exporter to facilitate analysis of aerobatic maneuvers

Open kd0aij opened this issue 6 years ago • 17 comments

This PR automatically segments the flight path into "maneuvers" bounded by straight and level flight. GE can animate this flightpath using a feature called "tours", and that might prove useful for log analysis. Sample screencapture of the animation: https://youtu.be/yAhzkvxIJVs

Example KMZ file is here: https://drive.google.com/open?id=1DXqYigl2Eek_ZoIoXqK3eNfPJBOrbrEU

Download the file and open it in Google Earth, set the touring options as shown below: touring_options

then select the "tour" named maneuvers (leave the checkboxes as they were) and click the "play tour" button at the bottom of the "Places" sidebar: places_sidebar

Also, clicking on the flightpath will pop up info including RPY angles, AOA, and speeds (exported at 5Hz): mdisplay

kd0aij avatar Apr 01 '18 16:04 kd0aij

For me it sounds like a intresting feature - but usage should be explained somewhere cause I do not think someone would expect such a feature. Otherwise it could happen that nobody will use it cause nobody knows about?!

Arne-W avatar Apr 09 '18 12:04 Arne-W

@Arne-W Thanks for looking at this. I've always wondered whether anyone else is using the KML export feature... I'll post a question on discuss to see if there's any interest.

kd0aij avatar Apr 09 '18 16:04 kd0aij

Please go ahead with this @kd0aij

And we need to have it on the wiki, and also a Blog post ;)

lvale avatar Apr 09 '18 16:04 lvale

@lvale https://discuss.ardupilot.org/t/fun-with-df-logs-apm-planner2-kml-and-google-earth/27515

kd0aij avatar Apr 09 '18 16:04 kd0aij

I like it. :) It would make it even easier to understand some events.

AndKe avatar Apr 09 '18 21:04 AndKe

here is what I see .. https://youtu.be/2n0eM7CG85E

do you have any suggestions as to what may be wrong ?

AndKe avatar Apr 19 '18 17:04 AndKe

That's disappointing. Google Earth Pro doesn't even run properly on my Ubuntu 16.04 machine though. I used Google Earth 7.1.8.3036 (64-bit) with OpenGL. For some reason, you're seeing huge icons (they shouldn't overlap at 2 meter spacing). And the KML animation demos that I've tried recently don't work properly for me either, so I'm reluctant to invest a lot of effort in something that flaky.

Maybe it would be more worthwhile to switch to Cesium for this? The PX4 guys recently added Cesium animations to their log analyzer, and that is closer to what I wanted to achieve anyway: https://review.px4.io/3d?log=54f72ade-68f5-40b7-97e0-f51dcb95b7d2

Perhaps there is someone on the team who knows how to use Cesium?

kd0aij avatar Apr 19 '18 18:04 kd0aij

@kd0aij Yes, Also - I have both Google Earth 7.1.x and this Pro one I just installed ... Also: the plane icon fly sideways...

I agree, using Cesium would solve a lot of this weird things, not to mention Google's sloppy Linux compatibility (I know others that had to hop thru a lot of rings to make Google Earth run on Linus) I guess you wish to integrate it to https://github.com/goodrobots/MAVCesium ? - or just use some Cesium and add it directly to apmplanner ? (that would be even more awesome.. ) :)

AndKe avatar Apr 19 '18 18:04 AndKe

@AndKe Thanks, I had forgotten that there was a mavproxy module for Cesium. That looks like a better way to go, and it might be easy to add an export from apmplanner.

kd0aij avatar Apr 19 '18 18:04 kd0aij

Cool - if you are convinced that Cesium is the better way to go we should do it. Adding a new log exporter should be easy (not taking into account the complexity of the exporter itself). But for long term we should decide which format we will support and which format will not be maintained anymore. If we can support most of the KML features with cesium and add more cool features it would be perfect, but ending up in 2 export formats where none can substitute the other would be annoying. Don't get me wrong - we do not have to make a perfect solution on first shot - it may take a while until we are able to remove, or at least stop maintainig one solution, but we should decide which way to go.

@billbonney As our chief mainatiner :wink: - what do you think?

@kd0aij If you want to start making a proof of concept be aware that the Logformat will support scaled data in the near future - don't know if it has an impact for such an exporter. If you need further information you should look here #1089. If you need further information let me know (implementation is nearly completed - exporter do not support it until now)

Arne-W avatar Apr 20 '18 11:04 Arne-W

An idea; What if AP2 did not export to mavcesium ? - not export a file or a static pile of data. What if; mavcesium got a "slave mode", where it just accepted a data stream from AP2 and just displayed it, regardless of timestamps or other checks.

The data from AP2 could then be sent to mavcesium as a "playback" that could be started, stopped, , reversed , moved step by step... using controls in AP2

Think of it: one could "playback" the moment of a failure based on finding it in log, and step thru it, watching a graph cursor move as mavcesium would show it ... every moment would be visible in graph with lots more related data from the same moment as cesium dislpayed it.. THAT would be totally awesome ! :)

AndKe avatar Apr 20 '18 12:04 AndKe

Nice Idea - BUT at the moment the log export works on dataflash logs not on Mavlink logs and there is no support in AP2 to convert dataflash to mavlink. Moreover it looks like a LOT of work and - to be honest - at the moment there are not enough developers supprting AP2 to implement such a cool big new feature....

But you are right - That would be awesome!

Arne-W avatar Apr 20 '18 13:04 Arne-W

I did not mean to convert it to mavlink.. only send attitude, altitude, position heading... And basic data for PFD . And I do see it's a pile of work, but maybe less than inventing an export plus import solution.

On Fri, 20 Apr 2018, 15:34 Arne Wischmann, [email protected] wrote:

Nice Idea - BUT at the moment the log export works on dataflash logs not on Mavlink logs and there is no support in AP2 to convert dataflash to mavlink. Moreover it looks like a LOT of work and - to be honest - at the moment there are not enough developers supprting AP2 to implement such a cool big new feature....

But you are right - That would be awesome!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ArduPilot/apm_planner/pull/1115#issuecomment-383097469, or mute the thread https://github.com/notifications/unsubscribe-auth/ABZpqrlzYNs7t5fgAc2mcbMlOtUeDU3sks5tqePbgaJpZM4TC5OI .

AndKe avatar Apr 20 '18 15:04 AndKe

@AndKe Lately I've been using GEpro on Win10 to analyze KML files generated in APM2, and the model scales are OK for me. Maybe you're seeing a bug in the Linux implementation? Here's an image capture from GEpro: outside_loop_apm2_kml The KMZ file and image are available here: https://drive.google.com/open?id=1Tf1z2o3WEpvyjXvtVmudd8SxZK3xxgzq

kd0aij avatar Oct 30 '18 15:10 kd0aij

Yes, that is how it should work, the plane icon is HUGE on Linux version, I notified Google, but can't count on it being fixed anytime soon ... I assume the plane symbol is a native part of Google Earth ? - not something that can be changed ?

AndKe avatar Oct 30 '18 17:10 AndKe

No, the plane is a Collada model which is copied into the KMZ file from here: https://github.com/ArduPilot/apm_planner/blob/262c6d2bdeb02d9ff9ad1d21260aff6eb64e3ccf/files/vehicles/block_plane/block_plane_0.dae You could try changing the scaling factors in the KML, but I don't think that will fix the problem with GE.

kd0aij avatar Oct 30 '18 18:10 kd0aij

seems ok on MacOS GGL Earth Pro screenshot 2018-10-31 at 13 59 38

lvale avatar Oct 31 '18 14:10 lvale