diff options
author | Johan Jansen <jnsn.johan@gmail.com> | 2015-01-06 12:16:07 +0100 |
---|---|---|
committer | Johan Jansen <jnsn.johan@gmail.com> | 2015-01-15 14:37:51 +0100 |
commit | eefbf366fbc2bef58f0bc283f7d02fb49023faa6 (patch) | |
tree | a8132eb20e214e05a8666a229fa36bddeb0a602d /src/modules | |
parent | b5c7c6a15b4badf56c335746b32ef138afaca539 (diff) | |
download | px4-firmware-eefbf366fbc2bef58f0bc283f7d02fb49023faa6.tar.gz px4-firmware-eefbf366fbc2bef58f0bc283f7d02fb49023faa6.tar.bz2 px4-firmware-eefbf366fbc2bef58f0bc283f7d02fb49023faa6.zip |
LandDetector: Fixed some typos and magic constant
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/fw_land_detector/FixedwingLandDetector.h | 3 | ||||
-rw-r--r-- | src/modules/mc_land_detector/MulticopterLandDetector.cpp | 5 | ||||
-rw-r--r-- | src/modules/mc_land_detector/MulticopterLandDetector.h | 1 |
3 files changed, 4 insertions, 5 deletions
diff --git a/src/modules/fw_land_detector/FixedwingLandDetector.h b/src/modules/fw_land_detector/FixedwingLandDetector.h index 6a0f951dd..900445740 100644 --- a/src/modules/fw_land_detector/FixedwingLandDetector.h +++ b/src/modules/fw_land_detector/FixedwingLandDetector.h @@ -33,10 +33,9 @@ /** * @file FixedwingLandDetector.h - * Land detection algorithm for multicopters + * Land detection algorithm for fixedwing * * @author Johan Jansen <jnsn.johan@gmail.com> - * @author Morten Lysgaard <Morten@mycptr.com> */ #ifndef __FIXED_WING_LAND_DETECTOR_H__ diff --git a/src/modules/mc_land_detector/MulticopterLandDetector.cpp b/src/modules/mc_land_detector/MulticopterLandDetector.cpp index 63dc54d5e..90b36a795 100644 --- a/src/modules/mc_land_detector/MulticopterLandDetector.cpp +++ b/src/modules/mc_land_detector/MulticopterLandDetector.cpp @@ -147,6 +147,7 @@ void MulticopterLandDetector::landDetectorLoop() //Check if we are moving vertically bool verticalMovement = fabsf(_vehicleGlobalPosition.vel_d) > MC_LAND_DETECTOR_CLIMBRATE_MAX; + //Check if we are moving horizontally bool horizontalMovement = sqrtf(_vehicleGlobalPosition.vel_n*_vehicleGlobalPosition.vel_n + _vehicleGlobalPosition.vel_e*_vehicleGlobalPosition.vel_e) > MC_LAND_DETECTOR_VELOCITY_MAX; @@ -165,8 +166,8 @@ void MulticopterLandDetector::landDetectorLoop() } - // if we have detected a landing for 2 continious seconds - if(now-_landTimer > 2000000) { + // if we have detected a landing for 2 continuous seconds + if(now-_landTimer > MC_LAND_DETECTOR_TRIGGER_TIME) { if(!_landDetected.landed) { _landDetected.timestamp = now; diff --git a/src/modules/mc_land_detector/MulticopterLandDetector.h b/src/modules/mc_land_detector/MulticopterLandDetector.h index 7421898c1..1aeaa0d62 100644 --- a/src/modules/mc_land_detector/MulticopterLandDetector.h +++ b/src/modules/mc_land_detector/MulticopterLandDetector.h @@ -50,7 +50,6 @@ #include <uORB/topics/actuator_controls.h> #include <uORB/topics/actuator_armed.h> -//TODO: add crash detection to this module? class MulticopterLandDetector { public: MulticopterLandDetector(); |