Skip to content

Commit

Permalink
Copter: autorotation mode: simplify hover autorotation check
Browse files Browse the repository at this point in the history
  • Loading branch information
MattKear committed Jan 25, 2024
1 parent 84f317f commit 581e660
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions ArduCopter/mode_autorotate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,10 @@ void ModeAutorotate::run()
// State machine logic
//----------------------------------------------------------------

// initial check for total energy monitoring
if (initial_energy_check) {
//initial check for total energy monitoring
if ( inertial_nav.get_speed_xy_cms() < 250.0f && g2.arot.get_ground_distance() < g2.arot.get_flare_alt()) {
hover_autorotation = true;
} else {
hover_autorotation = false;
}
initial_energy_check=false;
hover_autorotation = (inertial_nav.get_speed_xy_cms() < 250.0f) && (g2.arot.get_ground_distance() < g2.arot.get_flare_alt());
initial_energy_check = false;
}

//total energy check
Expand Down

0 comments on commit 581e660

Please sign in to comment.