Sending a Custom Mavlink Message

Hi, so I am trying to figure out how to send a custom Mavlink message from my Raspberry Pi (which has the Navio2 attached) to my PC. I’ve searched Google for quite a while and did not find many results relevant to my problem, as 90% of the results I found were about sending a custom Mavlink message from a Ground Control PC to an Ardupilot device (I wish to send a custom Mavlink message in the opposite direction).

The official Ardupilot documentation site has an article about creating a custom Mavlink message, but the vague example they included was for sending a message from PC to Ardupilot. Plus, for Step 5, they mention extending AP_Mission’s library, but I could not find where AP_Mission or any of the other Ardupilot source files are located in the Navio2’s Raspberry Pi.

I only found 1 relevant result that matches my situation: https://github.com/mavlink/mavros/issues/574

However, the guy in the GitHub issue post above includes a line of code that includes mavlink::groupcontrol::msg::GROUP_PARAMS, which I could not find any documentation about online.

So I was wondering if one of the Emlid developers or anyone else here in the forums knows how to send a custom Mavlink message from Navio2 to PC. I would rather not resort to wasting another USB port just for sending my custom data as a non-Mavlink message.

PS. I find it unusual how there were not many results on Google about sending custom Mavlink messages from Ardupilot to a ground station. Do most people using the Navio2 not care about sending some kind of custom data from their Navio2 to their ground station PC?

Hello.

This is not easy task to create and send your own message. You will need to support if from both sides: autopilot and gcs if this message isn’t supported by common mavlink protocol and you want to create a new one.

What type of data do you want to send? Maybe there is another way to send it.

Plus, for Step 5, they mention extending AP_Mission’s library, but I could not find where AP_Mission or any of the other Ardupilot source files are located in the Navio2’s Raspberry Pi.

ArduPilot binary is also included these libraries. So you will need to get source, make your changes and after build new ardupilot.

There is also another way to realize this. You can use proxy on autopilot side. For example mavproxy. You will find how to modify it here. But this way also isn’t easy.
Also mavros can be useful, but I didn’t use it in such tasks.

The data I wish to send will be in the form of floats.

Hi Kevin,

Have you figured out what was the issue?

So actually, instead of creating a custom Mavlink message, I ended up doing something else.

May I ask you to briefly describe how you accomplished this task? Thanks!

Yeah, so basically I just sent my data normally (as strings) and then instead of using another USB port for telemetry, I just used the first set of pins on the bottom to hook up an RC module.

3 Likes

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.