Mavlink to VB.net (C++ or C#)

Joined
May 9, 2016
Messages
6
Reaction score
1
Age
33
Hello, I am new to the coding for drones. I have a 3dr solo drone. I am simply trying to convert messages from mavproxy protocol or mavlink messages to vb.net. All I need is anything talking about coordinates and gps location. I can get the raw data whenever I type the command 'status' (when I am already connected to the solos wifi and talking to it via UDP). I just want to know if its a way I can call this information via VB.net, thanks!
 
i'm not sure of your current implementation but if i wanted to get vehicle location in a .net app i would use IronPython or Python for .net. With those libraries you can call python code or scripts from within a .net app with full flow control as well as return values.

using dronekit-python, just connect to the vehicle, get the location with vehicle.location.global_frame and return it.
 
Ok cool, I have Python on my computer, but I don't know how to include that library within .net. I have seen mavlink libraries and tried to do the #include<mavlink>, but I couldn't call any of those functions
 
Yes, I will take either one of them
Right now the code exists as a "plugin" to my larger data acquisition system - a DLL, not an exe. If you want a standalone example, I'd have to split that part out and make you a separate project.
It sounds like you already have a socket connection. Do you just need help breaking apart the messages?
 
  • Like
Reactions: Steven Ackerman
Right now the code exists as a "plugin" to my larger data acquisition system - a DLL, not an exe. If you want a standalone example, I'd have to split that part out and make you a separate project.
It sounds like you already have a socket connection. Do you just need help breaking apart the messages?

Also interested in this code...
 
Couldn't you just use the raw mavlink protocol?
  • C
  • C#
  • Java
  • JavaScript
  • Lua
  • Python, version 2.7+
GitHub - mavlink/mavlink: MAVLink micro air vehicle marshalling / communication library

This has a lot of what you would need but from what I recall the examples are more for sending commands and less for parsing messages. It's not hard to figure out how to do that but it's not explicitly spelled out either and it's not "already ingested" into .NET. They might want Visual Studio projects that they can compile and readily step through. [shrug] I already have the code. I don't mind repackaging it.

But Steven Ackermann and bmann33, if the marshalling library above suits your needs, I won't bother.
 
Right now the code exists as a "plugin" to my larger data acquisition system - a DLL, not an exe. If you want a standalone example, I'd have to split that part out and make you a separate project.
It sounds like you already have a socket connection. Do you just need help breaking apart the messages?
Yes, I do need help breaking apart the messages. I can't, for the life of me, get anything going
 
This has a lot of what you would need but from what I recall the examples are more for sending commands and less for parsing messages. It's not hard to figure out how to do that but it's not explicitly spelled out either and it's not "already ingested" into .NET. They might want Visual Studio projects that they can compile and readily step through. [shrug] I already have the code. I don't mind repackaging it.

But Steven Ackermann and bmann33, if the marshalling library above suits your needs, I won't bother.
Yes, I would greatly appreciate it if you repackaged it
 
Thanks so much! You've been a big help! So just to clarify, once I'm connected to the drone via UDP connection, and I give it a flight plan via mission planner and execute it, I can run this code in C# and it'll produce the gps coordinates upon a given command or will it be like live tracking?
 
  • Like
Reactions: KathyRo
Thanks so much! You've been a big help! So just to clarify, once I'm connected to the drone via UDP connection, and I give it a flight plan via mission planner and execute it, I can run this code in C# and it'll produce the gps coordinates upon a given command or will it be like live tracking?
The data streams continuously as soon as your PC joins Solo's WiFi network so as soon as you run the example, it's dumping out GPS coordinates.
A word of caution : because the controller is sending in unicast ( not multicast ) mode, only 1 application (per NIC) can bind to that port. So either you are connected via the example application or via Mission Planner. Not both.
 

Members online

No members online now.

Forum statistics

Threads
13,093
Messages
147,741
Members
16,047
Latest member
pvt solo