Skip to content

Commit

Permalink
AP_SurfaceDistance: allow for more than 327m range rangefinders
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Oct 11, 2024
1 parent 8402358 commit aba4763
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libraries/AP_SurfaceDistance/AP_SurfaceDistance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void AP_SurfaceDistance::update()
}

// tilt corrected but unfiltered, not glitch protected alt
alt_cm = tilt_correction * rangefinder->distance_cm_orient(rotation);
alt_cm = tilt_correction * rangefinder->distance_orient(rotation)*100;

// remember inertial alt to allow us to interpolate rangefinder
inertial_alt_cm = inertial_nav.get_position_z_up_cm();
Expand Down
4 changes: 2 additions & 2 deletions libraries/AP_SurfaceDistance/AP_SurfaceDistance.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class AP_SurfaceDistance {

bool enabled; // not to be confused with rangefinder enabled, this state is to be set by the vehicle.
bool alt_healthy; // true if we can trust the altitude from the rangefinder
int16_t alt_cm; // tilt compensated altitude (in cm) from rangefinder
int32_t alt_cm; // tilt compensated altitude (in cm) from rangefinder
float inertial_alt_cm; // inertial alt at time of last rangefinder sample
LowPassFilterFloat alt_cm_filt {0.5}; // altitude filter
int16_t alt_cm_glitch_protected; // last glitch protected altitude
int32_t alt_cm_glitch_protected; // last glitch protected altitude
int8_t glitch_count; // non-zero number indicates rangefinder is glitching
uint32_t glitch_cleared_ms; // system time glitch cleared
float terrain_offset_cm; // filtered terrain offset (e.g. terrain's height above EKF origin)
Expand Down

0 comments on commit aba4763

Please sign in to comment.