LandDetector: Fix land detection algorithm not being initialized

This commit is contained in:
Johan Jansen
2015-01-14 17:41:26 +01:00
parent 73c7b44f6a
commit 1356c44f0e

View File

@@ -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;