Skip to content
Snippets Groups Projects
Commit 505d2d68 authored by Jonathan Challinger's avatar Jonathan Challinger Committed by Randy Mackay
Browse files

Copter: protect loiter controller from bad inputs during failsafe

parent ca0652fe
No related branches found
No related tags found
No related merge requests found
...@@ -1719,8 +1719,13 @@ void update_roll_pitch_mode(void) ...@@ -1719,8 +1719,13 @@ void update_roll_pitch_mode(void)
control_roll = g.rc_1.control_in; control_roll = g.rc_1.control_in;
control_pitch = g.rc_2.control_in; control_pitch = g.rc_2.control_in;
// update loiter target from user controls if(failsafe.radio) {
wp_nav.move_loiter_target(control_roll, control_pitch,0.01f); // don't allow loiter target to move during failsafe
wp_nav.move_loiter_target(0.0f, 0.0f, 0.01f);
} else {
// update loiter target from user controls
wp_nav.move_loiter_target(g.rc_1.control_in, g.rc_2.control_in, 0.01f);
}
// copy latest output from nav controller to stabilize controller // copy latest output from nav controller to stabilize controller
nav_roll = wp_nav.get_desired_roll(); nav_roll = wp_nav.get_desired_roll();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment