Creating Custom MAVLink message

Hello,

I’m trying to create a custom MAVLink message by following the Adding a new MAVLink Message page.
I’m stuck at step #4 which says add functions to the main vehicle code to handle sending/receiving the command to/from the GCS. A bit confused as what the functions look like and the procedure following it?
Want to send some float values through the MAVLink message.
I’m new to MAVLink and any kind of help is appreciated.

Thanks

Maybe this Mav message is ideal for you so:
https://mavlink.io/en/messages/common.html#NAMED_VALUE_FLOAT
Using this, you will have no need to touch mavlink code nor your GCS side, you will be able to see your message at MAVLink Inspector that most popular GCS supports.

Search the code for this message, probably somewhere you will see its usage and it is pretty straightforward, simply create a function to handle sending this data where appropriate and you are ready to go.

Let me know if you need further advice.

2 Likes

Thank you for the reply. My issue is solved.

Used a similar MAVLink message as given in How to send a string from a PC to RaspberryPI with telemetry over Pixhawk

1 Like

Hello,

Asking from a scalability point of view, I want to communicate with 2 different components from a single ground station (single telemetry) using system and component ids. How should I do it as this MAVLink message does not contain the id fields.

Thanks

Nice to hear man!

Unfortunately, I don’t know… I never tried this kind of architecture.