Add custom msg using mavlink protocol

Hi, In Ardupilot code how i create a custom message by using Mavlink protocol for example in that already some of the default messages are their(Like: Heartbeat and system status and etc…) and that custom messages are added in the common.xml file i had added in that file,but i didnot get it in the console(My msg) what is the solution …anybody had created a custom msg in the Ardupilot code using mavlink…

AFAIK you need to compile pretty much everything to add new messages, please use custom.xml (IIRC it is a dedicated place for custom messages).

Unfortunately checksum validation requires frame format knowledge.

At a minimum you will have to recompile all mavlink related modules in Ardupilot and your GCS of choice.

Hi all,
it was tested successfully, I created one custom msg and that msg id was printed on my console:

  1. create a custom msg in the common.xml file and Gcs_common.cpp
  2. add the required parameter as like the Vibrator msg in the Gcs_common.cpp.
  3. include that msg in the ap_message.h and also add the msg in the Gcs_mavlink.cpp
  4. compile the build
  5. connect the flight controller to the laptop using an USB cable
  6. open putty on the laptop and the msg id you created will be printed on the screen

Here is the relevant documentation Adding a new MAVLink Message — Dev documentation

1 Like