-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
pprz_geodetic_double.h
126 lines (107 loc) · 4.12 KB
/
pprz_geodetic_double.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/*
* Copyright (C) 2008-2014 The Paparazzi Team
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*/
/**
* @file pprz_geodetic_double.h
* @brief Paparazzi double-precision floating point math for geodetic calculations.
*
*
*/
#ifndef PPRZ_GEODETIC_DOUBLE_H
#define PPRZ_GEODETIC_DOUBLE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "pprz_geodetic.h"
#include "pprz_algebra_double.h"
#include "std.h"
/**
* @brief vector in EarthCenteredEarthFixed coordinates
* @details Origin at center of mass of the Earth. Z-axis is pointing north,
* the x-axis intersects the sphere of the earth at 0° latitude (Equator)
* and 0° longitude (Greenwich). Y-axis completes it to right-hand system.
* Units: meters */
struct EcefCoor_d {
double x; ///< in meters
double y; ///< in meters
double z; ///< in meters
};
/**
* @brief vector in Latitude, Longitude and Altitude
*/
struct LlaCoor_d {
double lon; ///< in radians
double lat; ///< in radians
double alt; ///< in meters above WGS84 reference ellipsoid
};
/**
* @brief vector in North East Down coordinates
* Units: meters */
struct NedCoor_d {
double x; ///< in meters
double y; ///< in meters
double z; ///< in meters
};
/**
* @brief vector in East North Up coordinates
* Units: meters */
struct EnuCoor_d {
double x; ///< in meters
double y; ///< in meters
double z; ///< in meters
};
/**
* @brief position in UTM coordinates
* Units: meters */
struct UtmCoor_d {
double north; ///< in meters
double east; ///< in meters
double alt; ///< in meters above WGS84 reference ellipsoid
uint8_t zone; ///< UTM zone number
};
/**
* @brief definition of the local (flat earth) coordinate system
* @details Defines the origin of the local coordinate system
* in ECEF and LLA coordinates and the roation matrix from
* ECEF to local frame */
struct LtpDef_d {
struct EcefCoor_d ecef; ///< origin of local frame in ECEF
struct LlaCoor_d lla; ///< origin of local frame in LLA
struct DoubleRMat ltp_of_ecef; ///< rotation from ECEF to local frame
double hmsl; ///< height in meters above mean sea level
};
extern void lla_of_utm_d(struct LlaCoor_d* out, struct UtmCoor_d* in);
extern void ltp_def_from_ecef_d(struct LtpDef_d* def, struct EcefCoor_d* ecef);
extern void lla_of_ecef_d(struct LlaCoor_d* out, struct EcefCoor_d* in);
extern void ecef_of_lla_d(struct EcefCoor_d* out, struct LlaCoor_d* in);
extern void enu_of_ecef_point_d(struct EnuCoor_d* ned, struct LtpDef_d* def, struct EcefCoor_d* ecef);
extern void ned_of_ecef_point_d(struct NedCoor_d* ned, struct LtpDef_d* def, struct EcefCoor_d* ecef);
extern void enu_of_ecef_vect_d(struct EnuCoor_d* ned, struct LtpDef_d* def, struct EcefCoor_d* ecef);
extern void ned_of_ecef_vect_d(struct NedCoor_d* ned, struct LtpDef_d* def, struct EcefCoor_d* ecef);
extern void ecef_of_enu_point_d(struct EcefCoor_d* ecef, struct LtpDef_d* def, struct EnuCoor_d* enu);
extern void ecef_of_ned_point_d(struct EcefCoor_d* ecef, struct LtpDef_d* def, struct NedCoor_d* ned);
extern void ecef_of_enu_vect_d(struct EcefCoor_d* ecef, struct LtpDef_d* def, struct EnuCoor_d* enu);
extern void ecef_of_ned_vect_d(struct EcefCoor_d* ecef, struct LtpDef_d* def, struct NedCoor_d* ned);
extern void enu_of_lla_point_d(struct EnuCoor_d* enu, struct LtpDef_d* def, struct LlaCoor_d* lla);
extern void ned_of_lla_point_d(struct NedCoor_d* ned, struct LtpDef_d* def, struct LlaCoor_d* lla);
extern double gc_of_gd_lat_d(double gd_lat, double hmsl);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* PPRZ_GEODETIC_DOUBLE_H */