aboutsummaryrefslogtreecommitdiff
path: root/apps/systemlib/geo/geo.h
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2012-11-20 15:19:22 +0100
committerLorenz Meier <lm@inf.ethz.ch>2012-11-20 15:19:51 +0100
commit6ff4520904daef1fa441fd467f048c42d286f2ac (patch)
treecc2f3f58bab0627354801f973da0690a2d8f81cc /apps/systemlib/geo/geo.h
parent129e6d73debca5653911867e9db54990c02591bb (diff)
downloadpx4-firmware-6ff4520904daef1fa441fd467f048c42d286f2ac.tar.gz
px4-firmware-6ff4520904daef1fa441fd467f048c42d286f2ac.tar.bz2
px4-firmware-6ff4520904daef1fa441fd467f048c42d286f2ac.zip
Cleaned up PI wrapping code, still subject to testing
Diffstat (limited to 'apps/systemlib/geo/geo.h')
-rw-r--r--apps/systemlib/geo/geo.h38
1 files changed, 29 insertions, 9 deletions
diff --git a/apps/systemlib/geo/geo.h b/apps/systemlib/geo/geo.h
index 7aad79a8c..0c0b5c533 100644
--- a/apps/systemlib/geo/geo.h
+++ b/apps/systemlib/geo/geo.h
@@ -54,24 +54,44 @@ struct crosstrack_error_s {
float bearing; // Bearing in radians to closest point on line/arc
} ;
-__EXPORT static void map_projection_init(double lat_0, double lon_0);
+/**
+ * Initializes the map transformation.
+ *
+ * Initializes the transformation between the geographic coordinate system and the azimuthal equidistant plane
+ * @param lat in degrees (47.1234567°, not 471234567°)
+ * @param lon in degrees (8.1234567°, not 81234567°)
+ */
+__EXPORT void map_projection_init(double lat_0, double lon_0);
-__EXPORT static void map_projection_project(double lat, double lon, float *x, float *y);
+/**
+ * Transforms a point in the geographic coordinate system to the local azimuthal equidistant plane
+ * @param x north
+ * @param y east
+ * @param lat in degrees (47.1234567°, not 471234567°)
+ * @param lon in degrees (8.1234567°, not 81234567°)
+ */
+__EXPORT void map_projection_project(double lat, double lon, float *x, float *y);
-__EXPORT static void map_projection_reproject(float x, float y, double *lat, double *lon);
+/**
+ * Transforms a point in the local azimuthal equidistant plane to the geographic coordinate system
+ *
+ * @param x north
+ * @param y east
+ * @param lat in degrees (47.1234567°, not 471234567°)
+ * @param lon in degrees (8.1234567°, not 81234567°)
+ */
+__EXPORT void map_projection_reproject(float x, float y, double *lat, double *lon);
__EXPORT float get_distance_to_next_waypoint(double lat_now, double lon_now, double lat_next, double lon_next);
__EXPORT float get_bearing_to_next_waypoint(double lat_now, double lon_now, double lat_next, double lon_next);
-//
-
__EXPORT int get_distance_to_line(struct crosstrack_error_s * crosstrack_error, double lat_now, double lon_now, double lat_start, double lon_start, double lat_end, double lon_end);
__EXPORT int get_distance_to_arc(struct crosstrack_error_s * crosstrack_error, double lat_now, double lon_now, double lat_center, double lon_center,
float radius, float arc_start_bearing, float arc_sweep);
-float _wrap180(float bearing);
-float _wrap360(float bearing);
-float _wrapPI(float bearing);
-float _wrap2PI(float bearing);
+__EXPORT float _wrap_180(float bearing);
+__EXPORT float _wrap_360(float bearing);
+__EXPORT float _wrap_pi(float bearing);
+__EXPORT float _wrap_2pi(float bearing);