mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
Convert geofence distance params to float (#5435)
This commit is contained in:
committed by
Daniel Agar
parent
ced33e982b
commit
686fd5b125
@@ -134,8 +134,8 @@ bool Geofence::inside(const struct vehicle_global_position_s &global_position,
|
|||||||
|
|
||||||
bool Geofence::inside(double lat, double lon, float altitude)
|
bool Geofence::inside(double lat, double lon, float altitude)
|
||||||
{
|
{
|
||||||
int32_t max_horizontal_distance = _param_max_hor_distance.get();
|
float max_horizontal_distance = _param_max_hor_distance.get();
|
||||||
int32_t max_vertical_distance = _param_max_ver_distance.get();
|
float max_vertical_distance = _param_max_ver_distance.get();
|
||||||
|
|
||||||
if (max_horizontal_distance > 0 || max_vertical_distance > 0) {
|
if (max_horizontal_distance > 0 || max_vertical_distance > 0) {
|
||||||
if (_home_pos_set) {
|
if (_home_pos_set) {
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ PARAM_DEFINE_INT32(GF_COUNT, -1);
|
|||||||
* @increment 1
|
* @increment 1
|
||||||
* @group Geofence
|
* @group Geofence
|
||||||
*/
|
*/
|
||||||
PARAM_DEFINE_INT32(GF_MAX_HOR_DIST, -1);
|
PARAM_DEFINE_FLOAT(GF_MAX_HOR_DIST, -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Max vertical distance in meters.
|
* Max vertical distance in meters.
|
||||||
@@ -126,4 +126,4 @@ PARAM_DEFINE_INT32(GF_MAX_HOR_DIST, -1);
|
|||||||
* @increment 1
|
* @increment 1
|
||||||
* @group Geofence
|
* @group Geofence
|
||||||
*/
|
*/
|
||||||
PARAM_DEFINE_INT32(GF_MAX_VER_DIST, -1);
|
PARAM_DEFINE_FLOAT(GF_MAX_VER_DIST, -1);
|
||||||
|
|||||||
Reference in New Issue
Block a user