Guitarmath / arducopter

Automatically exported from code.google.com/p/arducopter
0 stars 0 forks source link

Control Mode overrides failsafe #471

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Arducoper 2.7.1 with APM 2.5
What steps will reproduce the problem?
1. Configure failsafe mode
2. Configure controller to output <975 on throttle for failsafe
3. Have a failsafe event (shut of your radio)

What is the expected output? What do you see instead?
I expect Failsafe mode to override any other settings. However, since the 
receiver (in my case, a Hitec Optima 9) continues to send a pulse on channel 5, 
the RTL failsafe command is overridden by whatever falls on the channel that 
matches with the pulse. This causes the failsafe RTL command to end and the 
Quad to perform whatever action is on that mode. If the action is stabilize, 
the APM also disarms after 20 seconds.

What version of the product are you using? On what operating system?
Planner 1.2.6 on Windows with ArduCopter 2.7.1 on APM 2.5.

Please provide any additional information below.
This can easily be fixed by checking for a failsafe event before reading the 
control board. Here is a quick patch:

diff --git a/ArduCopter/ArduCopter.pde b/ArduCopter/ArduCopter.pde
index b39e276..cfb2306 100644
--- a/ArduCopter/ArduCopter.pde
+++ b/ArduCopter/ArduCopter.pde
@@ -1330,9 +1330,11 @@ static void slow_loop()
                case 1:
                        slow_loopCounter++;

-                       // Read 3-position switch on radio
+                       // Read 3-position switch on radio only if failsafe has 
not be triggered
                        // -------------------------------
-                       read_control_switch();
+                       if (!failsafe){
+                               read_control_switch();
+                       }

                        #if MOUNT == ENABLED
                        update_aux_servo_function(&g.rc_9, &g.rc_10, &g.rc_11);

Also, what is the best method for submitting code to the project? I imagine I 
will have more patches or enhancements to submit in the future. Have you 
considered switching to Github for storage of source? The ability to do pull 
requests would make submitting patches very easy. You could also implement a 
gerrit instance pretty easily to have even more control over code review.

Original issue reported on code.google.com by bekrie...@bekit.net on 18 Aug 2012 at 11:00

GoogleCodeExporter commented 8 years ago
Also, this can be simulated. I performed most of my testing in FlightGear after 
my initial test of failsafe almost ended horribly.

Original comment by bekrie...@bekit.net on 18 Aug 2012 at 11:03

GoogleCodeExporter commented 8 years ago
Issue solved in 2.9 (Would wish I had seen this issue sooner!)

Original comment by Benny.Si...@gmail.com on 19 Jan 2013 at 10:49

GoogleCodeExporter commented 8 years ago
Issue closed. 
If you find this is an error please report it in the new issues list
https://github.com/diydrones/ardupilot/issues?labels=ArduCopter&page=1&state=ope
n

Original comment by Benny.Si...@gmail.com on 19 Jan 2013 at 10:50