land_detector: use user-defined literals for time constants

This commit is contained in:
Beat Küng
2018-04-14 13:45:57 +02:00
committed by Lorenz Meier
parent e98919cf3c
commit 123f11fcdd
4 changed files with 22 additions and 15 deletions
@@ -42,12 +42,15 @@
#pragma once
#include <drivers/drv_hrt.h>
#include <uORB/topics/airspeed.h>
#include <uORB/topics/sensor_bias.h>
#include <uORB/topics/vehicle_local_position.h>
#include "LandDetector.h"
using namespace time_literals;
namespace land_detector
{
@@ -67,8 +70,8 @@ protected:
private:
/** Time in us that landing conditions have to hold before triggering a land. */
static constexpr uint64_t LANDED_TRIGGER_TIME_US = 2000000;
static constexpr uint64_t FLYING_TRIGGER_TIME_US = 0;
static constexpr hrt_abstime LANDED_TRIGGER_TIME_US = 2_s;
static constexpr hrt_abstime FLYING_TRIGGER_TIME_US = 0_us;
struct {
param_t maxVelocity;