Did you ever figure this out? I have a companion computer that sits between the telemetry radio and the PixHawk. The system also incorporates a radar unit. Note that I’m also using a standard R/C controller (2.4Ghz) connected to the PixHawk. The companion computer checks the flight MODE, and if it is in STABILIZE MODE and the radar detects an object, I want the input from the R/C controller to be ignored and the MODE changed to BRAKE, then after 4 seconds, I change the MODE to LOITER, and after 10 seconds, back to STABILIZE. The idea is that if an object is encountered, the quad will first STOP, and then wait, then allow the pilot to route the quad around the obstacle.
I have this mostly working - but there are still some things that I need to fix, and I need more information before I proceed.
Currently, when I change the MODE to BRAKE, and then to LOITER, I continuously send the MODE information to the FC at a 1 Hz rate, so that the hand-held R/C controller doesn’t regain control. Is that necessary? Is that the right way to do this? I would like the hand-held R/C controller to be able to send a RTL, LAND or DISARM command and have that acted upon immediately, but is that even possible?
I want to do something similar when in AUTO mode. When an object is detected, I want to change the MODE to BRAKE for 4 seconds, then to LOITER, and then raise the throttle to 1750uSec and the roll to 1600 uSec. This should make the quad move up and to the right. When the object is no longer sensed, I want to change the throttle to 1500 (level flight), the Roll to 1500 (straight ahead), the PITCH to 1600 (forward slowly). If no object is detected for 15 seconds, the mode is changed back to AUTO.
In this mode I want the FC to ALWAYS respond to RTL, LAND and disarm.
I have some of this working, but want to finalize it, but I need some help in understanding what the FC is expecting and what it will do in all cases. I’m trying to avoid processing the PPM input as well as handling all the Mavlink stuff. My companion computer is a TEENSY 3.5 running at 120MHz.