Mavlink packet help

670 views
Skip to first unread message

Jason Gillikin

unread,
Sep 24, 2013, 3:25:06 PM9/24/13
to drones-...@googlegroups.com
I am making a GCS that implements mavlink.  The language I am writing in is C#. I am creating a packet of bytes with the protocol and sending them via serial connection.  So far, I can send message #21 param_list.  I get a list of parameters back, but the byte order is different than the documentation found at https://pixhawk.ethz.ch/mavlink/

according to this link, the paramID(char[16]) should come first, but it comes last over the line (and not in reverse order, so its not an Endian Issue)  I have noticed other messages have the same issue.

Is there a better documentation source for the messages? I am using ArduPilot.  

also, when I send other messages (such as Command_long (#76)  I don't get any type of acknowlegement. 

If anyone has any suggestions, please help.

Thanks again,

Jason


Kevin Hester

unread,
Sep 24, 2013, 3:53:41 PM9/24/13
to drones-discuss
Hi Jason,

Re: making a C# mavlink client
Rather than going from the html docs (which I bet tend to get stale) it is probably best to make your classes by machine generating them from the master xml files that define the APM's messages (look for .xml in the APM source).  You can feed those messages into the tools in git://github.com/mavlink/mavlink.git to generate stubs for your language.

In fact, I think there is already a C# generator in mavlink/pymavlink/generator.  But if that one is old or isn't what you want it is pretty easy to take one of the existing generators and customizing it.

Kevin



--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Michael Oborne

unread,
Sep 24, 2013, 7:45:59 PM9/24/13
to drones-...@googlegroups.com
Jason,
 
have a look at MissionPlanner source code. MP is written in c#.
 
 
Michael

Meier Lorenz

unread,
Sep 25, 2013, 1:39:58 AM9/25/13
to <drones-discuss@googlegroups.com>
Hi Jason,

Last time I checked the C# generator for MAVLink was operational. Michael O, correct me if I'm wrong, but you're not using that one yet?

If you're not using it, I think it would be beneficial for new users to point them to the official C# generator, because it makes maintenance a lot easier / reliable.

-Lorenz


On 25 Sep 2013, at 01:45, Michael Oborne <mic...@oborne.me<mailto:mic...@oborne.me>> wrote:

Jason,

have a look at MissionPlanner source code. MP is written in c#.
https://github.com/diydrones/MissionPlanner


Michael

From: Jason Gillikin<mailto:jlg...@uncw.edu>
Sent: Wednesday, September 25, 2013 3:25 AM
To: drones-...@googlegroups.com<mailto:drones-...@googlegroups.com>
Subject: [drones-discuss] Mavlink packet help

I am making a GCS that implements mavlink. The language I am writing in is C#. I am creating a packet of bytes with the protocol and sending them via serial connection. So far, I can send message #21 param_list. I get a list of parameters back, but the byte order is different than the documentation found at https://pixhawk.ethz.ch/mavlink/

according to this link, the paramID(char[16]) should come first, but it comes last over the line (and not in reverse order, so its not an Endian Issue) I have noticed other messages have the same issue.

Is there a better documentation source for the messages? I am using ArduPilot.

also, when I send other messages (such as Command_long (#76) I don't get any type of acknowlegement.

If anyone has any suggestions, please help.

Thanks again,

Jason


--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com<mailto:drones-discus...@googlegroups.com>.
--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com<mailto:drones-discus...@googlegroups.com>.

Jason Gillikin

unread,
Sep 25, 2013, 3:07:29 PM9/25/13
to drones-...@googlegroups.com
@ everybody,

Thank you so much for your help, I am working through the responses today,

@kevinh,

when I went to the github, it says I can run generator.py for a gui, but there is no generator.py   and when I run mavgen_CS.py... nothing happens.  No error, it just gives me another line on the command prompt. 

I also tried mavgenerate.py... but it gives me errors.  I have both python 2.7 and python 3.3 installed on my computer.

@ michael

I have been using MP for operations so far, it is a great program.  I started a c# project and added the c# files from MP-Master\mavlink\  ... but in the mavlink.cs file, it says MavlinkMessage, MavlinkSerializer, and MavlinkSettings do not exist in this context.  where do I find these Classes?




Meier Lorenz

unread,
Sep 25, 2013, 4:55:46 PM9/25/13
to <drones-discuss@googlegroups.com>
Hi Jason,

Run in the mavlink directory:

python mavgenerate.py

I did not play with the C# implementation yet, so if you have further issues, please post on the MAVLink mailing list - this is the right place to ask protocol questions.
https://groups.google.com/forum/#!forum/mavlink

-Lorenz

------------------------------------------------------
Lorenz Meier
Computer Vision and Geometry Group
Institute for Visual Computing
ETH Zurich
http://www.inf.ethz.ch/personal/lomeier/
Reply all
Reply to author
Forward
0 new messages