mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 09:28:58 +00:00
LandDetector: Fix land detection algorithm not being initialized
This commit is contained in:
@@ -8,10 +8,7 @@ LandDetector::LandDetector() :
|
||||
_taskShouldExit(false),
|
||||
_taskIsRunning(false)
|
||||
{
|
||||
//Advertise the first land detected uORB
|
||||
_landDetected.timestamp = hrt_absolute_time();
|
||||
_landDetected.landed = false;
|
||||
_landDetectedPub = orb_advertise(ORB_ID(vehicle_land_detected), &_landDetected);
|
||||
//ctor
|
||||
}
|
||||
|
||||
LandDetector::~LandDetector()
|
||||
@@ -32,6 +29,14 @@ void LandDetector::start()
|
||||
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
|
||||
_taskIsRunning = true;
|
||||
_taskShouldExit = false;
|
||||
|
||||
Reference in New Issue
Block a user