I need to be able to receive telemetry data (just GPS coordinates and a few others) in real time via Mission Planner and pass to another application I am currently working on,
does anyone have any tips as to how I would do this? Is it possible in Mission Planner?
Would I have to write something to connect directly to the USB port and decode the mavlink stream?
in MP, press control-f > then mavlink.
this will passthrough all raw traffic
Okay so I pass through all raw traffic and connect through a TCP connection with the attached code. But what exactly does the data I'm receiving represent? These strings are encrypted, correct? How do I decrypt them and translate them into something that makes sense? Specifically, all I want is current state information about the copter. Such as, longitude and latitude, current flight mode, etc. I've attached my basic windows code for receiving mavlink raw data from Mission Planner. Please Help. Thanks.
depending on what you want
you could just use http gets
from this url
when mp is running.
or you could use the microdrone output format, using control-f > microdrone.
which is a clear text format
the direct answer to your question is, the data is in MAVLink format. http://qgroundcontrol.org/mavlink/start
I've got this working using MicroDrone Output, but the format for the GPS is in ECEF. And this is alright since I've got the code to convert it to LLA from here:
However, I'm getting perfect Latitude and Longitude, but the Altitude is coming out -9400. I thought this was a problem with the code, but I verified it with 3 different online calculators and it is correct for the ECEF data that I am receiving from Mission Planner. So what does -9400 meters for Altitude refer to? I'm looking for the height from the ground. Since I already have the code for Mission Planner compiled, could you point me to the file where you do the conversions from raw data to the GUI? That way I can see what I'm missing here.
I am very pleased to thank you for your response and helpful explanations.
Please let me know that are you able to extract GPS coordinates in real time via Mission Planner?
I am having the exact same requirement for my current Project
Thanks in advance
Did you have resolved this problem? could you tele me your method?my email is:firstname.lastname@example.org
thanks you very much.
Unfortunately I could not find any solution for this issue. The MAVLINK format is very complicated and I think it is not easy for me to extract the GPS information from it, because I'm not a programmer.
But if I find a solution, I will share it with all of you.
Not sure if anyone looks at this thread anymore. But in case you're wondering. The easiest way to get GPS data is through "control-f > NMEA"
Here you can set up a serial connection to your own application, which you can pass the NMEA sentences to. NMEA protocol can be found online, well documented and it's easy.
You will have to write code for serial port communication inside your application. Again, this is usually well documented code found online.
Then, you'll need to set up 2 virtual comports using a terminal emulator. (Free software found online)
Before you run your software, start Mission Planner. Do control-f > NMEA
Open one of the virtual comports you set up with the terminal emulator.
Launch your software and configure the serial port connection for your software. Or maybe you just hardcoded it instead.
Note, you should spawn another thread in your software if you are reading a constant stream of real time GPS data. Otherwise, you'll slow your program down.
If you want more than GPS, try the same process with the microdrones protocol. However, the GPS data in microdrones was garbage data last I tried using it was way off.
Also, I can't find the Uplink Microdrones protocol, just the downlink. Let me know if any of you find the Uplink.