Browse Source

Copter: increase sonar timeout to 1sec

Contributed by Julien Dubois.
mission-4.1.18
Randy Mackay 11 years ago
parent
commit
6fc5014a84
  1. 2
      ArduCopter/Attitude.pde
  2. 4
      ArduCopter/config.h

2
ArduCopter/Attitude.pde

@ -234,7 +234,7 @@ static float get_throttle_surface_tracking(int16_t target_rate, float current_al @@ -234,7 +234,7 @@ static float get_throttle_surface_tracking(int16_t target_rate, float current_al
uint32_t now = millis();
// reset target altitude if this controller has just been engaged
if( now - last_call_ms > 200 ) {
if (now - last_call_ms > SONAR_TIMEOUT_MS) {
target_sonar_alt = sonar_alt + current_alt_target - current_loc.alt;
}
last_call_ms = now;

4
ArduCopter/config.h

@ -199,6 +199,10 @@ @@ -199,6 +199,10 @@
# define THR_SURFACE_TRACKING_VELZ_MAX 150 // max vertical speed change while surface tracking with sonar
#endif
#ifndef SONAR_TIMEOUT_MS
# define SONAR_TIMEOUT_MS 1000 // desired sonar alt will reset to current sonar alt after this many milliseconds without a good sonar alt
#endif
//////////////////////////////////////////////////////////////////////////////
// Channel 7 and 8 default options
//

Loading…
Cancel
Save