land_detector : use INFINITY when altitude limiting is not needed

This commit is contained in:
Mohammed Kabir
2018-05-21 21:42:33 -04:00
committed by Lorenz Meier
parent 31aa1cbf01
commit 1a2f9dd37a

View File

@@ -109,7 +109,7 @@ void LandDetector::_cycle()
const bool freefallDetected = (_state == LandDetectionState::FREEFALL); const bool freefallDetected = (_state == LandDetectionState::FREEFALL);
const bool maybe_landedDetected = (_state == LandDetectionState::MAYBE_LANDED); const bool maybe_landedDetected = (_state == LandDetectionState::MAYBE_LANDED);
const bool ground_contactDetected = (_state == LandDetectionState::GROUND_CONTACT); const bool ground_contactDetected = (_state == LandDetectionState::GROUND_CONTACT);
const float alt_max = _get_max_altitude(); const float alt_max = _get_max_altitude() > 0.0f ? _get_max_altitude() : INFINITY;
const hrt_abstime now = hrt_absolute_time(); const hrt_abstime now = hrt_absolute_time();