mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 01:53:34 +08:00
LandDetector: Fixed some typos and magic constant
This commit is contained in:
@@ -33,10 +33,9 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @file FixedwingLandDetector.h
|
* @file FixedwingLandDetector.h
|
||||||
* Land detection algorithm for multicopters
|
* Land detection algorithm for fixedwing
|
||||||
*
|
*
|
||||||
* @author Johan Jansen <jnsn.johan@gmail.com>
|
* @author Johan Jansen <jnsn.johan@gmail.com>
|
||||||
* @author Morten Lysgaard <Morten@mycptr.com>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __FIXED_WING_LAND_DETECTOR_H__
|
#ifndef __FIXED_WING_LAND_DETECTOR_H__
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ void MulticopterLandDetector::landDetectorLoop()
|
|||||||
//Check if we are moving vertically
|
//Check if we are moving vertically
|
||||||
bool verticalMovement = fabsf(_vehicleGlobalPosition.vel_d) > MC_LAND_DETECTOR_CLIMBRATE_MAX;
|
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
|
bool horizontalMovement = sqrtf(_vehicleGlobalPosition.vel_n*_vehicleGlobalPosition.vel_n
|
||||||
+ _vehicleGlobalPosition.vel_e*_vehicleGlobalPosition.vel_e) > MC_LAND_DETECTOR_VELOCITY_MAX;
|
+ _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 we have detected a landing for 2 continuous seconds
|
||||||
if(now-_landTimer > 2000000) {
|
if(now-_landTimer > MC_LAND_DETECTOR_TRIGGER_TIME) {
|
||||||
if(!_landDetected.landed)
|
if(!_landDetected.landed)
|
||||||
{
|
{
|
||||||
_landDetected.timestamp = now;
|
_landDetected.timestamp = now;
|
||||||
|
|||||||
@@ -50,7 +50,6 @@
|
|||||||
#include <uORB/topics/actuator_controls.h>
|
#include <uORB/topics/actuator_controls.h>
|
||||||
#include <uORB/topics/actuator_armed.h>
|
#include <uORB/topics/actuator_armed.h>
|
||||||
|
|
||||||
//TODO: add crash detection to this module?
|
|
||||||
class MulticopterLandDetector {
|
class MulticopterLandDetector {
|
||||||
public:
|
public:
|
||||||
MulticopterLandDetector();
|
MulticopterLandDetector();
|
||||||
|
|||||||
Reference in New Issue
Block a user