Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
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 
EcefCoor_f::y
float y
in meters
Definition: pprz_geodetic_float.h:47
ltp_def_from_lla_f
void ltp_def_from_lla_f(struct LtpDef_f *def, struct LlaCoor_f *lla)
Definition: pprz_geodetic_float.c:60
LtpDef_f
definition of the local (flat earth) coordinate system
Definition: pprz_geodetic_float.h:93
NedCoor_f
vector in North East Down coordinates Units: meters
Definition: pprz_geodetic_float.h:63
pprz_geodetic.h
Paparazzi generic macros for geodetic calculations.
enu_of_lla_point_f
void enu_of_lla_point_f(struct EnuCoor_f *enu, struct LtpDef_f *def, struct LlaCoor_f *lla)
Definition: pprz_geodetic_float.c:112
UtmCoor_f::north
float north
in meters
Definition: pprz_geodetic_float.h:82
NedCoor_f::z
float z
in meters
Definition: pprz_geodetic_float.h:66
ecef_of_ned_point_f
void ecef_of_ned_point_f(struct EcefCoor_f *ecef, struct LtpDef_f *def, struct NedCoor_f *ned)
Definition: pprz_geodetic_float.c:157
ecef_of_enu_vect_f
void ecef_of_enu_vect_f(struct EcefCoor_f *ecef, struct LtpDef_f *def, struct EnuCoor_f *enu)
Definition: pprz_geodetic_float.c:164
ecef_of_enu_point_f
void ecef_of_enu_point_f(struct EcefCoor_f *ecef, struct LtpDef_f *def, struct EnuCoor_f *enu)
Definition: pprz_geodetic_float.c:129
EcefCoor_f::x
float x
in meters
Definition: pprz_geodetic_float.h:46
LlaCoor_f::lon
float lon
in radians
Definition: pprz_geodetic_float.h:56
UtmCoor_f::east
float east
in meters
Definition: pprz_geodetic_float.h:83
EcefCoor_f::z
float z
in meters
Definition: pprz_geodetic_float.h:48
enu_of_ecef_point_f
void enu_of_ecef_point_f(struct EnuCoor_f *enu, struct LtpDef_f *def, struct EcefCoor_f *ecef)
Definition: pprz_geodetic_float.c:85
pprz_algebra_float.h
Paparazzi floating point algebra.
EnuCoor_f::y
float y
in meters
Definition: pprz_geodetic_float.h:74
EnuCoor_f::z
float z
in meters
Definition: pprz_geodetic_float.h:75
ltp_def_from_ecef_f
void ltp_def_from_ecef_f(struct LtpDef_f *def, struct EcefCoor_f *ecef)
Definition: pprz_geodetic_float.c:36
LtpDef_f::lla
struct LlaCoor_f lla
origin of local frame in LLA
Definition: pprz_geodetic_float.h:95
std.h
LtpDef_f::hmsl
float hmsl
Height above mean sea level in meters.
Definition: pprz_geodetic_float.h:97
UtmCoor_f::alt
float alt
in meters (above WGS84 reference ellipsoid or above MSL)
Definition: pprz_geodetic_float.h:84
UtmCoor_f::zone
uint8_t zone
UTM zone number.
Definition: pprz_geodetic_float.h:85
LtpDef_f::ltp_of_ecef
struct FloatRMat ltp_of_ecef
rotation from ECEF to local frame
Definition: pprz_geodetic_float.h:96
lla_of_ecef_f
void lla_of_ecef_f(struct LlaCoor_f *out, struct EcefCoor_f *in)
Definition: pprz_geodetic_float.c:204
uint8_t
unsigned char uint8_t
Definition: types.h:14
EnuCoor_f
vector in East North Up coordinates Units: meters
Definition: pprz_geodetic_float.h:72
ned_of_ecef_point_f
void ned_of_ecef_point_f(struct NedCoor_f *ned, struct LtpDef_f *def, struct EcefCoor_f *ecef)
Definition: pprz_geodetic_float.c:92
utm_of_lla_f
void utm_of_lla_f(struct UtmCoor_f *utm, struct LlaCoor_f *lla)
Definition: pprz_geodetic_float.c:308
LlaCoor_f::alt
float alt
in meters (normally above WGS84 reference ellipsoid)
Definition: pprz_geodetic_float.h:57
NedCoor_f::y
float y
in meters
Definition: pprz_geodetic_float.h:65
lla_of_utm_f
void lla_of_utm_f(struct LlaCoor_f *lla, struct UtmCoor_f *utm)
Definition: pprz_geodetic_float.c:344
EcefCoor_f
vector in EarthCenteredEarthFixed coordinates
Definition: pprz_geodetic_float.h:45
ecef_of_lla_f
void ecef_of_lla_f(struct EcefCoor_f *out, struct LlaCoor_f *in)
Definition: pprz_geodetic_float.c:241
UtmCoor_f
position in UTM coordinates Units: meters
Definition: pprz_geodetic_float.h:81
ned_of_ecef_vect_f
void ned_of_ecef_vect_f(struct NedCoor_f *ned, struct LtpDef_f *def, struct EcefCoor_f *ecef)
Definition: pprz_geodetic_float.c:105
LlaCoor_f::lat
float lat
in radians
Definition: pprz_geodetic_float.h:55
FloatRMat
rotation matrix
Definition: pprz_algebra_float.h:77
NedCoor_f::x
float x
in meters
Definition: pprz_geodetic_float.h:64
EnuCoor_f::x
float x
in meters
Definition: pprz_geodetic_float.h:73
ecef_of_ned_vect_f
void ecef_of_ned_vect_f(struct EcefCoor_f *ecef, struct LtpDef_f *def, struct NedCoor_f *ned)
Definition: pprz_geodetic_float.c:192
ned_of_lla_point_f
void ned_of_lla_point_f(struct NedCoor_f *ned, struct LtpDef_f *def, struct LlaCoor_f *lla)
Definition: pprz_geodetic_float.c:119
LtpDef_f::ecef
struct EcefCoor_f ecef
origin of local frame in ECEF
Definition: pprz_geodetic_float.h:94
enu_of_ecef_vect_f
void enu_of_ecef_vect_f(struct EnuCoor_f *enu, struct LtpDef_f *def, struct EcefCoor_f *ecef)
Definition: pprz_geodetic_float.c:100
LlaCoor_f
vector in Latitude, Longitude and Altitude
Definition: pprz_geodetic_float.h:54