mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 00:53:33 +08:00
Fixed wing land detector: Use control state, use horizontal acceleration for takeoff detect
This commit is contained in:
@@ -57,14 +57,14 @@ _work{} {
|
||||
|
||||
LandDetector::~LandDetector()
|
||||
{
|
||||
work_cancel(LPWORK, &_work);
|
||||
work_cancel(HPWORK, &_work);
|
||||
_taskShouldExit = true;
|
||||
}
|
||||
|
||||
int LandDetector::start()
|
||||
{
|
||||
/* schedule a cycle to start things */
|
||||
work_queue(LPWORK, &_work, (worker_t)&LandDetector::cycle_trampoline, this, 0);
|
||||
work_queue(HPWORK, &_work, (worker_t)&LandDetector::cycle_trampoline, this, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -107,10 +107,11 @@ void LandDetector::cycle()
|
||||
|
||||
// publish the land detected broadcast
|
||||
orb_publish(ORB_ID(vehicle_land_detected), (orb_advert_t)_landDetectedPub, &_landDetected);
|
||||
//warnx("in air status changed: %s", (_landDetected.landed) ? "LANDED" : "TAKEOFF");
|
||||
}
|
||||
|
||||
if (!_taskShouldExit) {
|
||||
work_queue(LPWORK, &_work, (worker_t)&LandDetector::cycle_trampoline, this,
|
||||
work_queue(HPWORK, &_work, (worker_t)&LandDetector::cycle_trampoline, this,
|
||||
USEC2TICK(1000000 / LAND_DETECTOR_UPDATE_RATE));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user