Drone My Roof Part 2

So in the last blog post I left off with wanting to do some manual editing of the waypoint file. The first thing I had to do was grab the KMZ file from the controller. The controller is an Android device, and I have two programs that are supposed to allow you to connect to Android devices on your Mac. I’ve had inconsistent results getting these connections to work. One of the programs, OpenMTP, warns you to close the background tasks from Google Drive and Dropbox and Android File Manager before it will be able to connect. And by trying various combinations of doing that, rebooting the computer, rebooting the controller, I was able to connect a few times.

The waypoint file is a KMZ file, which is actually a zip file containing two files, template.kml and waylines.kml. They’re both relatively straight forward XML files. You can figure out most of the syntax just by looking at one of the files you’ve downloaded from the controller. So after I got a connection to my controller, I grabbed one of the KMZ files, extracted the waylines.kml file to copy the first “<Placemark>” to the end of the “<Folder>” and change the “<wpml:index>” tag from 0 to 17. I refreshed the file in the KMZ file and uploaded it to the controller.

This gave me a full circle that returned to the start, which made it much closer to what I wanted. I still get a little bobble when I restart – even though it’s moving from point A to point A, it still has to turn the drone about 45 degrees and then back, for some reason. Also I decided that since I’d decided to change from shooting a hyperlapse to a sped-up video, the drone was moving too slowly. Also it looked like the gimbal angle was down too far, so the roof was not the center of the video. I made the changes to the waylines.kml file to support that – I changed all the “<wpml:waypointSpeed>" from 0.213… to 0.852 (meters/second). and I changed all the “<wpml:waypointPoiPoint>” so the third argument (the height) changed from 3.0 to 5.0 (meters above ground). But then I had a multi-hour long struggle to try to get the damn controller connected to my Mac. Eventually I gave up, and tried my ancient Windows laptop. I don’t know why, but I thought Windows had native support for Android. But before I could even try, I discovered that since the last time I used it, it’s decided that it no longer has any drivers for the WiFi or Ethernet controllers. I presume that’s something to do with the fact that it’s Windows 10, and it’s ineligible for upgrade to Windows 11. Not that I could, without a network connection. So I guess it’s going off to electronic recycling. Pity.

But as I was coming to terms with the fact that the laptop I “borrowed” from a former employer is no longer working, I glimpsed a USB A to USB C port handing off one of the front USB ports on my Linux box. I use the Linux box from the command line all the time, but I figured for this I’d probably need to be in the GUI. So I logged into KDE, and plugged the controller in. And it immediately popped up a Dolphin file manager window showing all the files in the controller. So I was able to do those changes. What a change to find something that’s easier in Linux than on the Mac.

I did a couple of test flights this morning. At first, the one bit of XML I wasn’t sure about, the command for what to do at the end of the waypoint flight, wasn’t set right. Fortunately you can do that easily on the controller. After those first two flights, I wasn’t happy with where the drone was pointing. I decided to edit the POI on the controller, and did two more circles and I think it came out just about perfect. I suppose I could make another edit and duplicate “<Placemark>“s 2-16 at the end so it can do two circles without having to restart, but I’m kind of running out of time. And what I’ve got now is pretty good, especially after I speed it up in Final Cut Pro X.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.