Geofence defaults (#5534)

* geofence messages too frequent

* geofence horz/vert disable with 0 instead of -1

-closes #5430
This commit is contained in:
Daniel Agar
2016-09-26 22:50:36 +02:00
committed by Lorenz Meier
parent 0eca86443d
commit 1d0a667826
2 changed files with 10 additions and 9 deletions
+2 -2
View File
@@ -54,7 +54,7 @@
#include <drivers/drv_hrt.h>
#include "navigator.h"
#define GEOFENCE_RANGE_WARNING_LIMIT 3000000
#define GEOFENCE_RANGE_WARNING_LIMIT 5000000
/* Oddly, ERROR is not defined for C++ */
#ifdef ERROR
@@ -137,7 +137,7 @@ bool Geofence::inside(double lat, double lon, float altitude)
float max_horizontal_distance = _param_max_hor_distance.get();
float max_vertical_distance = _param_max_ver_distance.get();
if (max_horizontal_distance > 0 || max_vertical_distance > 0) {
if (max_horizontal_distance > 1 || max_vertical_distance > 1) {
if (_home_pos_set) {
float dist_xy = -1.0f;
float dist_z = -1.0f;
+8 -7
View File
@@ -106,24 +106,25 @@ PARAM_DEFINE_INT32(GF_COUNT, -1);
/**
* Max horizontal distance in meters.
*
* Set to > 0 to activate a geofence action if horizontal distance to home exceeds this value.
* Maximum horizontal distance in meters the vehicle can be from home before triggering a geofence action. Disabled if 0.
*
* @unit m
* @min -1
* @max 5000
* @min 0
* @max 10000
* @increment 1
* @group Geofence
*/
PARAM_DEFINE_FLOAT(GF_MAX_HOR_DIST, -1);
PARAM_DEFINE_FLOAT(GF_MAX_HOR_DIST, 0);
/**
* Max vertical distance in meters.
*
* Set to > 0 to activate a geofence action if vertical distance to home exceeds this value.
* Maximum vertical distance in meters the vehicle can be from home before triggering a geofence action. Disabled if 0.
*
* @unit m
* @min -1
* @min 0
* @max 10000
* @increment 1
* @group Geofence
*/
PARAM_DEFINE_FLOAT(GF_MAX_VER_DIST, -1);
PARAM_DEFINE_FLOAT(GF_MAX_VER_DIST, 0);