I was testing the behavior of the BRAKE flight mode in SITL, and I’m not sure I understand what’s going on.
If you take a look at the figure below, you can see that the vehicle moves from GUIDED into STABILIZE flight mode while the throttle is at 0% and begins to fall. Shortly thereafter, I switch the vehicle into BRAKE flight mode, but rather than braking, CTUN.DAlt begins to track CTUN.Alt exactly, and the vehicle falls as if BRAKE mode was not active.
I’ve made the log file available if anyone wants to take a look. I’m confused by this behavior and would appreciate your help figuring out what is going on. Thanks!
So what you’re seeing there is a result of the ap.auto_armed flag. This flag acts like a latch stopping the motors from spinning up unless the pilot has raised the throttle stick above zero or a take-off command has been issued. It’s a long standing safety measure to stop vehicles from flying up into people’s faces (and it’s worked!).
This wasn’t it (if you look at the log, the throttle was raised above zero)…
…but this was the problem here. I was zeroing the throttle in STABILIZED mode. Thanks for the pointers; that helped out tremendously!
I’ve been testing in simulation a simple dronekit-python-based script that implements a “safety net” feature: putting the vehicle into BRAKE mode if it loses altitude too quickly, and optionally enforcing a minimum altitude for manual flight modes.