diff options
author | Johan Jansen <jnsn.johan@gmail.com> | 2015-01-14 17:41:26 +0100 |
---|---|---|
committer | Johan Jansen <jnsn.johan@gmail.com> | 2015-01-15 14:37:51 +0100 |
commit | 1356c44f0e27e9ab4d1c2df4cccbe4ac6fb2f1c4 (patch) | |
tree | 107e345082cb2a427608c9d3a5578c074e19edbc /src/modules/land_detector/LandDetector.cpp | |
parent | 73c7b44f6a684df80b550a4ce52c883348684045 (diff) | |
download | px4-firmware-1356c44f0e27e9ab4d1c2df4cccbe4ac6fb2f1c4.tar.gz px4-firmware-1356c44f0e27e9ab4d1c2df4cccbe4ac6fb2f1c4.tar.bz2 px4-firmware-1356c44f0e27e9ab4d1c2df4cccbe4ac6fb2f1c4.zip |
LandDetector: Fix land detection algorithm not being initialized
Diffstat (limited to 'src/modules/land_detector/LandDetector.cpp')
-rw-r--r-- | src/modules/land_detector/LandDetector.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/modules/land_detector/LandDetector.cpp b/src/modules/land_detector/LandDetector.cpp index 5029ce185..2f1310cab 100644 --- a/src/modules/land_detector/LandDetector.cpp +++ b/src/modules/land_detector/LandDetector.cpp @@ -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; |