Ground Control Station For Excel. Almost Finished, Need Help

I am working with a research group out of Humboldt State University looking for the world’s tallest trees using UAVs for topographic height banding of forest canopies. Generating dense tree canopy point clouds is easy using photo-bursting. Point cloud scale is the hard part. Current area of search is Olympic National Park. One of my projects is having a 2nd APM mechanically linked to a laser ranging module where the data stream is download directly into Excel using the Windows API command set with visual basic. I prefer the Excel/VBA environment for processing the APM data stream mostly for Excel’s superior organizing and graphing of Mavlink data and I am I have much more experience programming with visual basic than C.

So far I can decode all the data stream packets and also send command packets back to the APM in Hex format. I am using visual basic code. I did not make a CRC16 or seed generator for the last 32 bytes of the Mavlink packet. Instead I used a serial port sniffer to monitor the communication between Mission Planner and the APM2.6 to sniff out the correct command packets along with its CRC/Seed bytes. I found this easier to program (and lazier ?) since I am only using a few commands.

For example. The pitch, roll and yaw data stream I need to register the laser shots in 3CD space are in packet #21(#33decimal), which looks like:
fe 1c 96 01 01 1e 55 a7 66 00 68 14 ef 3b 7f 59 de bc 5e fd fa 3f d6 15 05 39 80 31 61 b8 58 f9 f8 b9 11 04
If using Arducopter you need to issue a command to start the data stream. To initiate the pitch, roll and yaw stream I send this command back to the APM from Excel.

FE 06 6C FF BE 42 03 00 01 01 06 01 26 AE

The “26” and “AE” CRC-16 and Seed bytes were not generated with software but captured with serial port sniffer between Mission Planner to APM.

So far everything has gone well in the programming until I tried to decode the GPS stream. From hex#18 (ID#24 from Common.xml) and Hex#21(ID#33 from Common.xml) . The units are expressed at InT32 1xE7.
The common.xml says these units are fused with the accelerometers. Says the format is GPS world frame.

I can capture both Hex18 and Hex21 which have the GPS data.

Example of APM data streams from last mission.

fe 1e 84 01 01 18 e8 02 f6 90 01 00 00 00 a3 48 35 18 75 0a 69 b6 28 77 06 00 b1 00 ff ff 06 00 d4 86 03 08 5f e7

and

fe 1c 86 01 01 21 61 a5 66 00 a6 48 35 18 72 0a 69 b6 28 77 06 00 4a 06 00 00 fd ff 04 00 fa ff e4 2b d5 fd

The GPS Latitude from packet#18 is: a3 48 35 18 …reverse order in Little Endian…18 35 48 a3
this works out in INT32 1xE7 format as: 40.6145187 …okay looks good. This matches up with the Mission Planner Screen latitude in decimal format.

Now for the Longitude: 75 0a 69 b6 … b6 69 0a 75 … 306.0337269
This is not the same format as the -123.46dd longitude as seen on Mission Planner and what I was expecting. After looking through the C code I am unable to find the proper translation. What type of coordinates are these ? how do I translate 306.0337269 degrees to the expected 123.46 W ? What is the nature of this306.0337269 unit ? See attached Excel Ground Control Station. You can see the gap where I am unable to decode the GPS Longitude. I am so close to being finished. I do not understand the C code well enough to see it the translation. Is this a 4x4 matrix translation of reference frames ?

If anyone can help me with this final piece of the puzzle they will get a free tour (if they want one) to the tallest tree on Earth , which now stands over 380 feet.

Michael Taylor
landmarktrees.net

The latitude and longitude are in the stated format. I just put together a APM “reader” in VB that seems to work but I had to fiddle with the word order a little to get it to work. I can send you what I have if you still need it.