Geofence: Param update fix (#5812)

This commit is contained in:
Michal Stasiak
2016-11-06 20:31:59 +01:00
committed by Daniel Agar
parent 8ac4dd04ae
commit 9180268a17
+7 -9
View File
@@ -58,7 +58,7 @@
#define GEOFENCE_RANGE_WARNING_LIMIT 5000000
Geofence::Geofence(Navigator *navigator) :
SuperBlock(NULL, "GF"),
SuperBlock(navigator, "GF"),
_navigator(navigator),
_fence_pub(nullptr),
_home_pos{},
@@ -68,12 +68,12 @@ Geofence::Geofence(Navigator *navigator) :
_altitude_min(0),
_altitude_max(0),
_vertices_count(0),
_param_action(this, "ACTION"),
_param_altitude_mode(this, "ALTMODE"),
_param_source(this, "SOURCE"),
_param_counter_threshold(this, "COUNT"),
_param_max_hor_distance(this, "MAX_HOR_DIST"),
_param_max_ver_distance(this, "MAX_VER_DIST"),
_param_action(this, "GF_ACTION", false),
_param_altitude_mode(this, "GF_ALTMODE", false),
_param_source(this, "GF_SOURCE", false),
_param_counter_threshold(this, "GF_COUNT", false),
_param_max_hor_distance(this, "GF_MAX_HOR_DIST", false),
_param_max_ver_distance(this, "GF_MAX_VER_DIST", false),
_outside_counter(0)
{
/* Load initial params */
@@ -101,8 +101,6 @@ bool Geofence::inside(const struct vehicle_global_position_s &global_position,
const struct vehicle_gps_position_s &gps_position, float baro_altitude_amsl,
const struct home_position_s home_pos, bool home_position_set)
{
updateParams();
_home_pos = home_pos;
_home_pos_set = home_position_set;