Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
pprz_geodetic.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
34
#ifndef PPRZ_GEODETIC_H
35
#define PPRZ_GEODETIC_H
36
37
#ifdef __cplusplus
38
extern
"C"
{
39
#endif
40
41
#define ENU_OF_TO_NED(_po, _pi) { \
42
(_po).x = (_pi).y; \
43
(_po).y = (_pi).x; \
44
(_po).z = -(_pi).z; \
45
}
46
47
#define VECT2_ENU_OF_TO_NED(_po, _pi) { \
48
(_po).x = (_pi).y; \
49
(_po).y = (_pi).x; \
50
}
51
52
#define LLA_ASSIGN(_pos,_lat,_lon,_alt){ \
53
(_pos).lat = (_lat); \
54
(_pos).lon = (_lon); \
55
(_pos).alt = (_alt); \
56
}
57
58
#define LLA_COPY(_pos1,_pos2){ \
59
(_pos1).lat = (_pos2).lat; \
60
(_pos1).lon = (_pos2).lon; \
61
(_pos1).alt = (_pos2).alt; \
62
}
63
64
#define LTP_DEF_COPY(_def1,_def2){ \
65
LLA_COPY((_def1).lla, (_def2).lla); \
66
VECT3_COPY((_def1).ecef, (_def2).ecef); \
67
RMAT_COPY((_def1).ltp_of_ecef, (_def2).ltp_of_ecef); \
68
(_def1).hmsl = (_def2).hmsl; \
69
}
70
71
#define UTM_COPY(_u1, _u2) { \
72
(_u1).north = (_u2).north; \
73
(_u1).east = (_u2).east; \
74
(_u1).alt = (_u2).alt; \
75
(_u1).zone = (_u2).zone; \
76
}
77
78
#define ENU_OF_UTM_DIFF(_pos, _utm1, _utm2) { \
79
(_pos).x = (_utm1).east - (_utm2).east; \
80
(_pos).y = (_utm1).north - (_utm2).north; \
81
(_pos).z = (_utm1).alt - (_utm2).alt; \
82
}
83
84
#define NED_OF_UTM_DIFF(_pos, _utm1, _utm2) { \
85
(_pos).x = (_utm1).north - (_utm2).north; \
86
(_pos).y = (_utm1).east - (_utm2).east; \
87
(_pos).z = -(_utm1).alt + (_utm2).alt; \
88
}
89
90
#define UTM_OF_ENU_ADD(_utm, _pos, _utm0) { \
91
(_utm).east = (_utm0).east + (_pos).x; \
92
(_utm).north = (_utm0).north + (_pos).y; \
93
(_utm).alt = (_utm0).alt + (_pos).z; \
94
}
95
96
#define UTM_OF_NED_ADD(_utm, _pos, _utm0) { \
97
(_utm).east = (_utm0).east + (_pos).y; \
98
(_utm).north = (_utm0).north + (_pos).x; \
99
(_utm).alt = (_utm0).alt - (_pos).z; \
100
}
101
102
#ifdef __cplusplus
103
}
/* extern "C" */
104
#endif
105
106
#endif
/* PPRZ_GEODETIC_H */
107
sw
airborne
math
pprz_geodetic.h
Generated on Tue Feb 1 2022 13:51:14 for Paparazzi UAS by
1.8.17