Updated commander to take free-fall into account

Added free-fall status in vehicle_status topic
This commit is contained in:
Emmanuel Roussel
2016-04-18 22:27:11 +02:00
committed by Roman
parent 98d51179ad
commit 776c7f5d60
3 changed files with 8 additions and 5 deletions
@@ -126,7 +126,7 @@ bool MulticopterLandDetector::get_freefall_state()
}
acc_norm = sqrtf(acc_norm); //norm of specific force
int32_t elapsed_time_ms = (now - _freefallTimer)/1000;
int32_t elapsed_time_ms = (now - _freefallTimer) / 1000;
bool freefall = (acc_norm < _params.acc_threshold_m_s2);
if (!freefall || _freefallTimer == 0) { //reset timer if uav not falling
_freefallTimer = now;
@@ -105,7 +105,7 @@ PARAM_DEFINE_FLOAT(LNDMC_FFALL_THR, 2.0f);
*
* @group Land Detector
*/
PARAM_DEFINE_INT32(LNDMC_FFALL_TRIG, 200); //minimal value is limited by LAND_DETECTOR_UPDATE_RATE=50Hz in landDetector.h
PARAM_DEFINE_INT32(LNDMC_FFALL_TRIG, 300); //minimal value is limited by LAND_DETECTOR_UPDATE_RATE=50Hz in landDetector.h
/**
* Fixedwing max horizontal velocity