Paparazzi UAS  v5.15_devel-81-gd13dafb
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pprz_geodetic_float.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2014 The Paparazzi Team
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
28 #ifndef PPRZ_GEODETIC_FLOAT_H
29 #define PPRZ_GEODETIC_FLOAT_H
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #include "pprz_geodetic.h"
36 #include "pprz_algebra_float.h"
37 #include "std.h"
38 
45 struct EcefCoor_f {
46  float x;
47  float y;
48  float z;
49 };
50 
54 struct LlaCoor_f {
55  float lat;
56  float lon;
57  float alt;
58 };
59 
63 struct NedCoor_f {
64  float x;
65  float y;
66  float z;
67 };
68 
72 struct EnuCoor_f {
73  float x;
74  float y;
75  float z;
76 };
77 
81 struct UtmCoor_f {
82  float north;
83  float east;
84  float alt;
86 };
87 
93 struct LtpDef_f {
94  struct EcefCoor_f ecef;
95  struct LlaCoor_f lla;
97  float hmsl;
98 };
99 
100 extern void lla_of_utm_f(struct LlaCoor_f *lla, struct UtmCoor_f *utm);
101 extern void utm_of_lla_f(struct UtmCoor_f *utm, struct LlaCoor_f *lla);
102 extern void ltp_def_from_ecef_f(struct LtpDef_f *def, struct EcefCoor_f *ecef);
103 extern void ltp_def_from_lla_f(struct LtpDef_f *def, struct LlaCoor_f *lla);
104 extern void lla_of_ecef_f(struct LlaCoor_f *out, struct EcefCoor_f *in);
105 extern void ecef_of_lla_f(struct EcefCoor_f *out, struct LlaCoor_f *in);
106 extern void enu_of_ecef_point_f(struct EnuCoor_f *enu, struct LtpDef_f *def, struct EcefCoor_f *ecef);
107 extern void ned_of_ecef_point_f(struct NedCoor_f *ned, struct LtpDef_f *def, struct EcefCoor_f *ecef);
108 extern void enu_of_ecef_vect_f(struct EnuCoor_f *enu, struct LtpDef_f *def, struct EcefCoor_f *ecef);
109 extern void ned_of_ecef_vect_f(struct NedCoor_f *ned, struct LtpDef_f *def, struct EcefCoor_f *ecef);
110 extern void enu_of_lla_point_f(struct EnuCoor_f *enu, struct LtpDef_f *def, struct LlaCoor_f *lla);
111 extern void ned_of_lla_point_f(struct NedCoor_f *ned, struct LtpDef_f *def, struct LlaCoor_f *lla);
112 
113 /* not enough precision with floats - used the double version */
114 extern void ecef_of_enu_point_f(struct EcefCoor_f *ecef, struct LtpDef_f *def, struct EnuCoor_f *enu);
115 extern void ecef_of_ned_point_f(struct EcefCoor_f *ecef, struct LtpDef_f *def, struct NedCoor_f *ned);
116 extern void ecef_of_enu_vect_f(struct EcefCoor_f *ecef, struct LtpDef_f *def, struct EnuCoor_f *enu);
117 extern void ecef_of_ned_vect_f(struct EcefCoor_f *ecef, struct LtpDef_f *def, struct NedCoor_f *ned);
118 /* end use double versions */
119 
120 #ifdef __cplusplus
121 } /* extern "C" */
122 #endif
123 
124 #endif /* PPRZ_GEODETIC_FLOAT_H */
125 
void ecef_of_ned_vect_f(struct EcefCoor_f *ecef, struct LtpDef_f *def, struct NedCoor_f *ned)
definition of the local (flat earth) coordinate system
float y
in meters
float east
in meters
float north
in meters
void lla_of_utm_f(struct LlaCoor_f *lla, struct UtmCoor_f *utm)
float alt
in meters (above WGS84 reference ellipsoid or above MSL)
vector in EarthCenteredEarthFixed coordinates
void ecef_of_lla_f(struct EcefCoor_f *out, struct LlaCoor_f *in)
vector in East North Up coordinates Units: meters
float x
in meters
void ltp_def_from_lla_f(struct LtpDef_f *def, struct LlaCoor_f *lla)
position in UTM coordinates Units: meters
void lla_of_ecef_f(struct LlaCoor_f *out, struct EcefCoor_f *in)
void ned_of_lla_point_f(struct NedCoor_f *ned, struct LtpDef_f *def, struct LlaCoor_f *lla)
float z
in meters
struct EcefCoor_f ecef
origin of local frame in ECEF
void ecef_of_enu_vect_f(struct EcefCoor_f *ecef, struct LtpDef_f *def, struct EnuCoor_f *enu)
void ecef_of_ned_point_f(struct EcefCoor_f *ecef, struct LtpDef_f *def, struct NedCoor_f *ned)
vector in Latitude, Longitude and Altitude
float z
in meters
vector in North East Down coordinates Units: meters
Paparazzi floating point algebra.
float x
in meters
float hmsl
Height above mean sea level in meters.
void enu_of_ecef_point_f(struct EnuCoor_f *enu, struct LtpDef_f *def, struct EcefCoor_f *ecef)
void ned_of_ecef_vect_f(struct NedCoor_f *ned, struct LtpDef_f *def, struct EcefCoor_f *ecef)
void enu_of_ecef_vect_f(struct EnuCoor_f *enu, struct LtpDef_f *def, struct EcefCoor_f *ecef)
uint8_t zone
UTM zone number.
float y
in meters
void ecef_of_enu_point_f(struct EcefCoor_f *ecef, struct LtpDef_f *def, struct EnuCoor_f *enu)
struct FloatRMat ltp_of_ecef
rotation from ECEF to local frame
float alt
in meters (normally above WGS84 reference ellipsoid)
void enu_of_lla_point_f(struct EnuCoor_f *enu, struct LtpDef_f *def, struct LlaCoor_f *lla)
Paparazzi generic macros for geodetic calculations.
unsigned char uint8_t
Definition: types.h:14
void ltp_def_from_ecef_f(struct LtpDef_f *def, struct EcefCoor_f *ecef)
void utm_of_lla_f(struct UtmCoor_f *utm, struct LlaCoor_f *lla)
float z
in meters
float lon
in radians
rotation matrix
float lat
in radians
void ned_of_ecef_point_f(struct NedCoor_f *ned, struct LtpDef_f *def, struct EcefCoor_f *ecef)
float y
in meters
struct LlaCoor_f lla
origin of local frame in LLA
float x
in meters