thecognifly / YAMSPy

Yet Another Multiwii Serial Protocol Python Interface... for Betaflight, iNAV, etc...
https://thecognifly.github.io/
GNU General Public License v3.0
94 stars 31 forks source link

Switch between RC and MSP drone contrling on flight #22

Open clashpunk opened 1 year ago

clashpunk commented 1 year ago

I have succefully started simpleUI.py on my SpeedyBee f405 FC via USB cable. My question, is it possible to start manual flight using RC controller and then switch for autonomus controlling with Rasberry PI + YASMPy during flight?

ricardodeazambuja commented 1 year ago

@clashpunk, I've been away from inav for a while, so I am not super aware of the bleeding edge, but I know it now has SITL and HITL, maybe they even have a new flight mode more like arducopter where you can enable autonomous control as you want. What we have been doing is to control everything from the on-board computer (RPI or other). When we want manual control, we send the commands to the on-board computer and it sends the commands to the FC as if it was an MSP-based RC. Our safety is based on the failsafe mode because as soon as the on-board computer stops sending commands to the FC, the FC will enter into failsafe. You can also have a look at the msp_override_channels, it may be useful if you want to keep control of certain things (I haven't tried it yet).

devnim commented 8 months ago

@ricardodeazambuja, what can be done to have a betaflight flight controller accept BOTH the output of the user's transmitter (manual flight) and the on-board computer (e.g. PI) during flight? If the PI unexpectedly freezes or shuts down mid-flight, then the user can take over and likewise via manual remote and likewise if a user loses a signal, the PI will take over.

If this is not possible, can the PI boot up in midflight and take over and then give back control to the user and shut down. Or will the drone crash when this is attempted mid-flight?

Also, you said once the on-board computer stops sending commands to the FC, the FC will enter into failsafe. What will happen to the drone if it enters failsafe mid-flight? Is it possible to configure this failsafe to switch the receiver from MSP to the default one (one used by the user)?

Thank you for your work on this.

ricardodeazambuja commented 8 months ago

Have a look at this (old) discussion: https://github.com/betaflight/betaflight/issues/8292