mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 06:31:36 +08:00
LandDetector: Fix land detection algorithm not being initialized
This commit is contained in:
@@ -8,10 +8,7 @@ LandDetector::LandDetector() :
|
|||||||
_taskShouldExit(false),
|
_taskShouldExit(false),
|
||||||
_taskIsRunning(false)
|
_taskIsRunning(false)
|
||||||
{
|
{
|
||||||
//Advertise the first land detected uORB
|
//ctor
|
||||||
_landDetected.timestamp = hrt_absolute_time();
|
|
||||||
_landDetected.landed = false;
|
|
||||||
_landDetectedPub = orb_advertise(ORB_ID(vehicle_land_detected), &_landDetected);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LandDetector::~LandDetector()
|
LandDetector::~LandDetector()
|
||||||
@@ -32,6 +29,14 @@ void LandDetector::start()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Advertise the first land detected uORB
|
||||||
|
_landDetected.timestamp = hrt_absolute_time();
|
||||||
|
_landDetected.landed = false;
|
||||||
|
_landDetectedPub = orb_advertise(ORB_ID(vehicle_land_detected), &_landDetected);
|
||||||
|
|
||||||
|
//Initialize land detection algorithm
|
||||||
|
initialize();
|
||||||
|
|
||||||
//Task is now running, keep doing so until shutdown() has been called
|
//Task is now running, keep doing so until shutdown() has been called
|
||||||
_taskIsRunning = true;
|
_taskIsRunning = true;
|
||||||
_taskShouldExit = false;
|
_taskShouldExit = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user