New mavlink Message (sensor)

I trying to add a custom mavlink message to send GCS , I added a new_message in common.xml file

Empty Message Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. I also add the message in ap_message.h and GCS_mavlink.cpp file as MSG_NEW_MESSAGE.

but when I run the STIL simulator copter I getting an error link1 down and PANIC: Sending unknown ap_message 20

It’s documentation on ardupilot to add custom message is not so clear, please share a useful resource, if you have any…

Do you really have to create a new message? I would prefer to use NAMED_INT or NAMED_FLOAT messages for this:
https://mavlink.io/en/messages/common.html#NAMED_VALUE_FLOAT
https://mavlink.io/en/messages/common.html#NAMED_VALUE_INT

2 Likes