New flight mode not shown in MAVLink modes list (SITL)

Hello Ardupilot community!

I have added a new flight mode to Copter, and I wanted to test it using SITL. However, although the code complied and SITL started, I couldn’t see my new mode in the modes list. I looked it up in the internet and I found many solutions… I tried to run
python setup.py build install --user
But it didn’t work. I also tried modifying mavlink/ardupilotmega.xml, and added manually the new flight mode, but still, it doesn’t appear in the modes’ list of MAVLink.
Using mode #no of new mode also didn’t work.
So what could be the issue?

Thanks!

You need to change both pymavlink, ardupilot and Mavlink.
I plan to do a code change that allows you to only change Mavlink. But you still need to recompile pymavlink and ardupilot. Would that be OK for you ?

By changing Mavlink, are you referring to editing the file ardupilotomega.xml?
I think that would be extremely useful. Just recompiling is simpler than changing the code, and would help a lot. So yeah, I guess this will be OK.

have you solved the problem??

No, my proposed change was not approved. So I did not push it. You need to change both mavlink .xml ardupilot source code and the gcs source code. Good luck.