Browse Source

Copter: consider flight to be dynamic at greater than 2m above ground

use rangefinder to switch to dynamic flight if possible
mission-4.1.18
Andrew Tridgell 10 years ago
parent
commit
94eb23ef56
  1. 6
      ArduCopter/heli.cpp

6
ArduCopter/heli.cpp

@ -71,6 +71,12 @@ void Copter::check_dynamic_flight(void) @@ -71,6 +71,12 @@ void Copter::check_dynamic_flight(void)
moving = (motors.get_throttle() > 800.0f || ahrs.pitch_sensor < -1500);
}
if (!moving && sonar_enabled && sonar.status() == RangeFinder::RangeFinder_Good) {
// when we are more than 2m from the ground with good
// rangefinder lock consider it to be dynamic flight
moving = (sonar.distance_cm() > 200);
}
if (moving) {
// if moving for 2 seconds, set the dynamic flight flag
if (!heli_flags.dynamic_flight) {

Loading…
Cancel
Save