[C] - Read GPS Coordinates on 3DR Solo from GPS sensor

Joined
Jan 20, 2020
Messages
10
Reaction score
0
Age
35
Hello everyone, I am a C programmer and I need to write a C program that will be executed on the 3DR Solo (directly on the drone, i.e. upload the object file and execute on it) that reads the GPS coordinates (Latitude, Longitude) and Altitude from the GPS sensor mounted on board the drone.

I am not sure, but I understood that the data are printed out on the UART ttymxc1.

Do you know if there is any parser that allow me to read these data easily directly on the 3DR Solo Drone?

Please don't suggest me to use python, because I need to be fast regarding the computations and the storage, but any other suggestions are welcomed.

---Update--
I discovered also that probably the GPS Module is an Ublox NEO-7N
 
Last edited:
Joined
May 9, 2017
Messages
1,612
Reaction score
651
Age
41
It's easier in python. Part of the tools already on the bird is a fetch of the GPS on a regular heartbeat.

You can claim that the python is slowing you down, but the actual bottleneck is the UART [serial port]. From what I recall the python is fetching the GPS as fast as the UART will allow.

To that end it is possible to read the UART with a program in C. I just don't think it is worth it.

Maybe you could be more explicit as to what you're trying to do?
 
Joined
Jan 20, 2020
Messages
10
Reaction score
0
Age
35
Dear just_bruce, thank you for your hints. Basically, I need to create a custom mavlink message and I need to fill it with the GPS coordinates retrieved from the GPS sensor. I tried to read the UART in C but it is a mess (the content that I see on the terminal is not printed correctly, probably due the baud-rate---and supposing that I am able to do that, I need to make a parser).
Thank you in advance for the help.
 
Joined
May 9, 2017
Messages
1,612
Reaction score
651
Age
41
There is already existing mavlink message creation capabilities on board the bird. GPS info is already packaged and sent down the link, so it's definitely possible. Look at the pymavlink*.py files
 
  • Like
Reactions: 3druser

New Threads

Members online

Forum statistics

Threads
12,798
Messages
146,039
Members
15,162
Latest member
Menotte