Adding new mavlink message to APM Planner 2 breaks the EKF status report message

I have added a new message to APM Planner 2 which transmits data that is collected by an Arduino and transmitted to a Pixhawk via I2C. I regenerated all the messages and placed them into their proper directories. The code compiles correctly after changing line 1966 in src/uas/UAS.cc from

mavlink_finalize_message_chan(&message, systemId, componentId, link->getId(), message.len, messageKeys[message.msgid]);

to

mavlink_finalize_message_chan(&message, systemId, componentId, link->getId(), 0, message.len, messageKeys[message.msgid]);

However, either adding these new message definitions or editing the UAS.cc file breaks the EKF status report message. It shows up as a message entitled “empty” and contains only a char[0] with no name. This message shows up fine in an unedited version of APM Planner 2, but I need the new messages. How do I fix this broken message?

Thanks

Edit: my code is here https://github.com/uzgit/apm_planner

Sorry for the delay in replying. I just updated MAVLink 1.0 that APM Planner 2.0 uses and fixed the slight change in the finalize method

if you add you custom message now to the xml you should be able to generate new code that you can drop in a nit easier and make it work.

I used

$ cd <path_to_mavlink_ARCrepo>/mavlink
$ python -m pymavlink.tools.mavgen --lang C --wire-protocol 1.0 message_definitions/v1.0/ardupilotmega.xml 

My plan is to add this as a submodule and compile it fresh on build to make changes easier and to support updates