jaspreeth / ardupilot-mega

Automatically exported from code.google.com/p/ardupilot-mega
0 stars 0 forks source link

When in failsafe mode, the mode switch channel is still read and acted on #402

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When failsafe mode has been triggered because the RX no longer has signal, or 
in a manual failsafe mode test for example moving throttle to sub-low value, 
the code is still reading the mode switch channel and will possibly change 
flight modes based on whatever reading is on that channel.

This is unexpected, and can cause - after failsafe begins -, a mode switch to 
some undesirable mode or even manual mode (crash), depending on the value 
received on the mode channel. The most likely value is Mode 0, for many users 
this will be the mode they bind the RX and TX in. If the RX goes into and out 
of failsafe it is possibly like flicking the mode switch back and forward 
between two positions.

ArduPilotMega.cpp

                case 1:
                        slow_loopCounter++;

                        // Read 3-position switch on radio
                        // -------------------------------
                        read_control_switch();

read_control_switch() does not first verify the state of the radio (is not in 
failsafe).

Original issue reported on code.google.com by justinbe...@gmail.com on 5 Sep 2011 at 2:26

GoogleCodeExporter commented 8 years ago
Reading the mode switch is the primary exit from a long failsafe condition.  
Once a long failsafe is established due to loss of signal the failsafe is not 
cleared when the RX signal is again received as this also presents a crash risk 
as the user will not know exactly when this will happen and may be unprepared.  
Receivers (generally) continue to output the last value, in which case there is 
no toggling of mode possible, or can be programmed to output a particular 
value.  In the latter case the user should program the mode channel failsafe to 
something sensible like RTL.

Original comment by dewei...@gmail.com on 12 Sep 2011 at 1:16