Custom mavlink messages lost in SITL

Hey all,

I’ve been getting the SITL for Copter up and running with a build of Copter which includes a custom Mavlink message. My code at first was causing the link to dropout and I noticed that I was experiencing a packet loss of around 4.1% when this happened. I was able to figure out that issue had something to do with too frequent calls to the SITL HAL(at least that’s what fixed the problem) but now I’m still seeing the packet loss and I believe it’s my costum messages that aren’t being sent over MAVPROXY. My intuition is that I need to update message definitions in the Mavproxy, however I can’t find where the .xml files would be in the system.

If I’m going down the wrong path to solve this advice would be appreciated or any insight as to what causes loss of links in the SITL HAL.

If there is a .xml I need to adjust in my Ubuntu box for custom messages where would it be located such that I can actually modify it?

Much appreciated

Hello,

Yes Mavproxy will discard unknown message. If you haven’t update message at system level, it is surely the cause of message lose you see.
Currently, I use pymavlink installer to do this update :
get pymavlink with git clone. put your message xml somewhere. Then

sudo MDEF="PATH_TO_message_definitions" pip2 install . -v -U

it should regenerate all header for mavproxy.
There may be a simplier solution. I will update the wiki when I get it

Okay thanks,

If I’m running the Simulator from the ardupilot directory, where do I need to run this command, I’m getting the following error.

Directory ‘.’ is not installable. File ‘setup.py’ not found.
Exception information:
Traceback (most recent call last):
File “/usr/lib/python2.7/dist-packages/pip/basecommand.py”, line 122, in main
status = self.run(options, args)
File “/usr/lib/python2.7/dist-packages/pip/commands/install.py”, line 283, in run
InstallRequirement.from_line(name, None))
File “/usr/lib/python2.7/dist-packages/pip/req.py”, line 147, in from_line
raise InstallationError(“Directory %r is not installable. File ‘setup.py’ not found.” % name)
InstallationError: Directory ‘.’ is not installable. File ‘setup.py’ not found.

I suppose I need to be where the pymavlink is in my ardupilot directory.

I found the proper location to run the command in my modules/mavlink/pymavlink folder, I don’t know why my previous find didn’t show that. Now I’m getting another error running that command.

Can’t roll back lxml; was not uninstalled

higher up I saw the following

** make sure the development packages of libxml2 and libxslt are installed **

so I did the following

sudo apt-get install libxml2-dev libxslt1-dev
sudo pip install lxml

but I’m still getting the same error.