aboutsummaryrefslogtreecommitdiff
path: root/src/lib/geo/geo.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/geo/geo.h')
-rw-r--r--src/lib/geo/geo.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/geo/geo.h b/src/lib/geo/geo.h
index 123ff80f1..6bce9309b 100644
--- a/src/lib/geo/geo.h
+++ b/src/lib/geo/geo.h
@@ -47,6 +47,9 @@
#pragma once
+#include "uORB/topics/fence.h"
+#include "uORB/topics/vehicle_global_position.h"
+
__BEGIN_DECLS
#include <stdbool.h>
@@ -126,4 +129,15 @@ __EXPORT float _wrap_360(float bearing);
__EXPORT float _wrap_pi(float bearing);
__EXPORT float _wrap_2pi(float bearing);
+/**
+ * Return whether craft is inside geofence.
+ *
+ * Calculate whether point is inside arbitrary polygon
+ * @param craft pointer craft coordinates
+ * @param fence pointer to array of coordinates, one per vertex. First and last vertex are assumed connected
+ * @return true: craft is inside fence, false:craft is outside fence
+ */
+__EXPORT bool inside_geofence(const struct vehicle_global_position_s *craft, const struct fence_s *fence);
+
+
__END_DECLS