mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 20:41:36 +08:00
Geofence: remove GF_COUNT
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
committed by
Daniel Agar
parent
fd709e05b0
commit
563bfbf6e7
@@ -259,20 +259,8 @@ bool Geofence::checkAll(double lat, double lon, float altitude)
|
|||||||
// as they both report being inside when not enabled
|
// as they both report being inside when not enabled
|
||||||
inside_fence = inside_fence && isInsidePolygonOrCircle(lat, lon, altitude);
|
inside_fence = inside_fence && isInsidePolygonOrCircle(lat, lon, altitude);
|
||||||
|
|
||||||
if (inside_fence) {
|
return inside_fence;
|
||||||
_outside_counter = 0;
|
}
|
||||||
return inside_fence;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
_outside_counter++;
|
|
||||||
|
|
||||||
if (_outside_counter > _param_gf_count.get()) {
|
|
||||||
return inside_fence;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Geofence::check(const vehicle_global_position_s &global_position, const sensor_gps_s &gps_position)
|
bool Geofence::check(const vehicle_global_position_s &global_position, const sensor_gps_s &gps_position)
|
||||||
|
|||||||
@@ -189,7 +189,6 @@ private:
|
|||||||
MapProjection _projection_reference{}; ///< class to convert (lon, lat) to local [m]
|
MapProjection _projection_reference{}; ///< class to convert (lon, lat) to local [m]
|
||||||
|
|
||||||
|
|
||||||
int _outside_counter{0};
|
|
||||||
uint16_t _update_counter{0}; ///< dataman update counter: if it does not match, polygon data was updated
|
uint16_t _update_counter{0}; ///< dataman update counter: if it does not match, polygon data was updated
|
||||||
bool _fence_updated{true}; ///< flag indicating if fence are updated to dataman cache
|
bool _fence_updated{true}; ///< flag indicating if fence are updated to dataman cache
|
||||||
bool _initiate_fence_updated{true}; ///< flag indicating if fence updated is needed
|
bool _initiate_fence_updated{true}; ///< flag indicating if fence updated is needed
|
||||||
@@ -231,7 +230,6 @@ private:
|
|||||||
DEFINE_PARAMETERS(
|
DEFINE_PARAMETERS(
|
||||||
(ParamInt<px4::params::GF_ACTION>) _param_gf_action,
|
(ParamInt<px4::params::GF_ACTION>) _param_gf_action,
|
||||||
(ParamInt<px4::params::GF_SOURCE>) _param_gf_source,
|
(ParamInt<px4::params::GF_SOURCE>) _param_gf_source,
|
||||||
(ParamInt<px4::params::GF_COUNT>) _param_gf_count,
|
|
||||||
(ParamFloat<px4::params::GF_MAX_HOR_DIST>) _param_gf_max_hor_dist,
|
(ParamFloat<px4::params::GF_MAX_HOR_DIST>) _param_gf_max_hor_dist,
|
||||||
(ParamFloat<px4::params::GF_MAX_VER_DIST>) _param_gf_max_ver_dist,
|
(ParamFloat<px4::params::GF_MAX_VER_DIST>) _param_gf_max_ver_dist,
|
||||||
(ParamBool<px4::params::GF_PREDICT>) _param_gf_predict
|
(ParamBool<px4::params::GF_PREDICT>) _param_gf_predict
|
||||||
|
|||||||
@@ -76,17 +76,7 @@ PARAM_DEFINE_INT32(GF_ACTION, 2);
|
|||||||
*/
|
*/
|
||||||
PARAM_DEFINE_INT32(GF_SOURCE, 0);
|
PARAM_DEFINE_INT32(GF_SOURCE, 0);
|
||||||
|
|
||||||
/**
|
|
||||||
* Geofence counter limit
|
|
||||||
*
|
|
||||||
* Set how many subsequent position measurements outside of the fence are needed before geofence violation is triggered
|
|
||||||
*
|
|
||||||
* @min -1
|
|
||||||
* @max 10
|
|
||||||
* @increment 1
|
|
||||||
* @group Geofence
|
|
||||||
*/
|
|
||||||
PARAM_DEFINE_INT32(GF_COUNT, -1);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Max horizontal distance in meters.
|
* Max horizontal distance in meters.
|
||||||
|
|||||||
Reference in New Issue
Block a user