2013-05-29 20:52:00 -03:00
|
|
|
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
2012-07-14 23:26:17 -03:00
|
|
|
|
|
|
|
/// @file limits.h
|
|
|
|
/// @brief Imposes limits on location (geofence), altitude and other parameters.
|
|
|
|
/// Each limit breach will trigger an action or set of actions to recover. Adapted from geofence.
|
|
|
|
/// @author Andrew Tridgell
|
|
|
|
/// Andreas Antonopoulos
|
|
|
|
|
2012-10-11 22:35:35 -03:00
|
|
|
#ifndef __AP_LIMIT_ALTITUDE_H__
|
|
|
|
#define __AP_LIMIT_ALTITUDE_H__
|
2012-07-14 23:26:17 -03:00
|
|
|
|
2012-10-11 22:35:35 -03:00
|
|
|
#include "AP_Limits.h"
|
|
|
|
#include "AP_Limit_Module.h"
|
|
|
|
#include <AP_Param.h>
|
2012-07-14 23:26:17 -03:00
|
|
|
|
2012-08-17 03:20:06 -03:00
|
|
|
class AP_Limit_Altitude : public AP_Limit_Module {
|
2012-07-14 23:26:17 -03:00
|
|
|
|
|
|
|
public:
|
2013-03-26 08:58:54 -03:00
|
|
|
AP_Limit_Altitude(const struct Location *current_loc);
|
2012-07-14 23:26:17 -03:00
|
|
|
|
2012-08-17 03:20:06 -03:00
|
|
|
AP_Int32 min_alt();
|
|
|
|
AP_Int32 max_alt();
|
2012-07-14 23:26:17 -03:00
|
|
|
|
2012-08-17 03:20:06 -03:00
|
|
|
bool init();
|
|
|
|
bool triggered();
|
2012-07-14 23:26:17 -03:00
|
|
|
|
2012-08-17 03:20:06 -03:00
|
|
|
static const struct AP_Param::GroupInfo var_info[];
|
2012-07-14 23:26:17 -03:00
|
|
|
|
|
|
|
protected:
|
2013-03-26 08:58:54 -03:00
|
|
|
const struct Location * _current_loc;
|
2012-08-17 03:20:06 -03:00
|
|
|
AP_Int32 _min_alt;
|
|
|
|
AP_Int32 _max_alt;
|
2012-07-14 23:26:17 -03:00
|
|
|
|
|
|
|
|
|
|
|
};
|
2012-10-11 22:35:35 -03:00
|
|
|
|
|
|
|
#endif // __AP_LIMIT_ALTITUDE_H__
|