Browse Source

Copter: tidy invocation of precland.update

Setting the altitude to home-relative is misleading/wasteful in this method as
the alt is unused in precland unless it is marked as "OK" with the
second parameter
gps-1.3.1
Peter Barker 4 years ago committed by Peter Barker
parent
commit
2da88263e6
  1. 11
      ArduCopter/precision_landing.cpp

11
ArduCopter/precision_landing.cpp

@ -13,13 +13,8 @@ void Copter::init_precland() @@ -13,13 +13,8 @@ void Copter::init_precland()
void Copter::update_precland()
{
int32_t height_above_ground_cm = current_loc.alt;
// use range finder altitude if it is valid, otherwise use home alt
if (rangefinder_alt_ok()) {
height_above_ground_cm = rangefinder_state.alt_cm_glitch_protected;
}
precland.update(height_above_ground_cm, rangefinder_alt_ok());
// alt will be unused if we pass false through as the second parameter:
return precland.update(rangefinder_state.alt_cm_glitch_protected,
rangefinder_alt_ok());
}
#endif

Loading…
Cancel
Save