mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 06:43:34 +08:00
Land detector: fix code style
This commit is contained in:
@@ -51,11 +51,10 @@ namespace landdetection
|
|||||||
LandDetector::LandDetector() :
|
LandDetector::LandDetector() :
|
||||||
_landDetectedPub(0),
|
_landDetectedPub(0),
|
||||||
_landDetected( {0, false}),
|
_landDetected( {0, false}),
|
||||||
_arming_time(0),
|
_arming_time(0),
|
||||||
_taskShouldExit(false),
|
_taskShouldExit(false),
|
||||||
_taskIsRunning(false),
|
_taskIsRunning(false),
|
||||||
_work{}
|
_work{} {
|
||||||
{
|
|
||||||
// ctor
|
// ctor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -165,6 +165,7 @@ bool MulticopterLandDetector::get_landed_state()
|
|||||||
|
|
||||||
if (minimalThrust && _min_trust_start == 0) {
|
if (minimalThrust && _min_trust_start == 0) {
|
||||||
_min_trust_start = now;
|
_min_trust_start = now;
|
||||||
|
|
||||||
} else if (!minimalThrust) {
|
} else if (!minimalThrust) {
|
||||||
_min_trust_start = 0;
|
_min_trust_start = 0;
|
||||||
}
|
}
|
||||||
@@ -197,8 +198,9 @@ bool MulticopterLandDetector::get_landed_state()
|
|||||||
// falling consider it to be landed. This should even sustain
|
// falling consider it to be landed. This should even sustain
|
||||||
// quite acrobatic flight.
|
// quite acrobatic flight.
|
||||||
if ((_min_trust_start > 0) &&
|
if ((_min_trust_start > 0) &&
|
||||||
(hrt_elapsed_time(&_min_trust_start) > 8 * 1000 * 1000)) {
|
(hrt_elapsed_time(&_min_trust_start) > 8 * 1000 * 1000)) {
|
||||||
return !get_freefall_state();
|
return !get_freefall_state();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user