Custom data sending via MAVLink protocol [DEV]

Hello everyone,

I am trying to implement custom message, which I would like to send from Pixhawk via MAVLink so I will be able to see it in MAVLink inspector (?maybe) - if MAVLink inspector is not the right tool for this, please tell me which one you would use.

To understand me better, I will post steps which I have done so far to achieve my goal:

  1. I have added my custom message to common.xml (ardupilot/modules/mavlink/messsage_definitions)

  2. I have added message flag in enum ap_message (GCS.h in libraries/GCS_MAVLink)

  3. I have added function to send the message in GCS.h also

  4. I have written piece of code to send my message (which Ive declared in GCS.h) in GCS_Common.cpp -> there I used function generated by building the project (mavlink_msg_xxxxxxxx_send())

  5. Added a line in code where I want to send the message by calling: gcs().send_message(MY_DEFINED_MESSAGE) -> MY_DEFINED_MESSAGE is the one defined in 2. here

I am using APM Planner 2.0 on Linux. When I open MAVLink inspector, I am able to see bunch of information there (RAW_IMU, SCALED_PRESSURE, SERVO_OUTPUT_RAW etc.), but my packet is missing.

I wonder if I am missing something to add in the ardupilot code or if it is just something to set in mission planner.

I appreciate any help!

Have a nice day

To see the messages in APM planner 2.0 you need to recompile Mavlink inspector using the latest common.xml file that you modified.

1 Like