-
Notifications
You must be signed in to change notification settings - Fork 13.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
commander: prevent potential disarms in-air #12557
Conversation
Looks good, although I'm wondering about capturing more of these details in the state machine. I don't suppose the magic number (21196) is accessible through the mavlink spec? |
I wonder too but that's one we know.
It's just in the description of that message. I'm glad you're back @dagar! :) |
@ItsTimmy yay, the rover CI check prevented me from merging something that could break rover. |
This fixes the terrifying case where the drone disarms in-air just because it receives a MAVLink disarm command. We now check param2 for a magic number which enforces arming/disarming. This is added to the mavlink protocol in: mavlink/mavlink#1162
We have to ignore the landed flag for rovers, it doesn't really apply for them.
f36ba42
to
a8d5413
Compare
@julianoes Thanks for the hotfix! Just to be safe I tested the exact problem we had and it prevents disarming like expected. What I still don't like and only makes this a hotfix for me is that RC and joystick are not handled by the same code path and checks and there arise other unexpected corner cases. One of them I found is that if you disarm in manual mode by RC it's allowed. By MAVLink command it's not. |
That's the scenario I was thinking about above and why I'd like to pull most of this scattered logic together into a state machine. |
I don't disagree. |
This fixes the terrifying case where the drone disarms in-air just because it receives a MAVLink disarm command. We now check param2 for a magic number which enforces arming/disarming.
This is added to the mavlink protocol in:
mavlink/mavlink#1162
Testing done using MAVSDK mavlink/MAVSDK#817.
If you want to reproduce the test: