Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
pprz_geodetic_int.h File Reference

Paparazzi fixed point math for geodetic calculations. More...

#include "pprz_geodetic.h"
#include "std.h"
#include "pprz_algebra_int.h"
+ Include dependency graph for pprz_geodetic_int.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  EcefCoor_i
 vector in EarthCenteredEarthFixed coordinates More...
 
struct  LlaCoor_i
 vector in Latitude, Longitude and Altitude More...
 
struct  NedCoor_i
 vector in North East Down coordinates More...
 
struct  EnuCoor_i
 vector in East North Up coordinates More...
 
struct  UtmCoor_i
 position in UTM coordinates More...
 
struct  LtpDef_i
 definition of the local (flat earth) coordinate system More...
 

Macros

#define CM_OF_M(_m)   ((_m)*1e2)
 
#define M_OF_CM(_cm)   ((_cm)/1e2)
 
#define MM_OF_M(_m)   ((_m)*1e3)
 
#define M_OF_MM(_mm)   ((_mm)/1e3)
 
#define EM7RAD_OF_RAD(_r)   ((_r)*1e7)
 
#define RAD_OF_EM7RAD(_r)   ((_r)/1e7)
 
#define INT32_VECT3_ENU_OF_NED(_o, _i)
 
#define INT32_VECT3_NED_OF_ENU(_o, _i)   INT32_VECT3_ENU_OF_NED(_o,_i)
 
#define ECEF_BFP_OF_REAL(_o, _i)
 
#define ECEF_FLOAT_OF_BFP(_o, _i)
 
#define LLA_BFP_OF_REAL(_o, _i)
 
#define LLA_FLOAT_OF_BFP(_o, _i)
 
#define NED_BFP_OF_REAL(_o, _i)
 
#define ENU_BFP_OF_REAL(_o, _i)   NED_BFP_OF_REAL(_o, _i)
 
#define NED_FLOAT_OF_BFP(_o, _i)
 
#define ENU_FLOAT_OF_BFP(_o, _i)   NED_FLOAT_OF_BFP(_o, _i)
 
#define INT32_VECT2_ENU_OF_NED(_o, _i)
 
#define INT32_VECT2_NED_OF_ENU(_o, _i)   INT32_VECT2_ENU_OF_NED(_o,_i)
 

Functions

void ltp_def_from_ecef_i (struct LtpDef_i *def, struct EcefCoor_i *ecef)
 
void ltp_def_from_lla_i (struct LtpDef_i *def, struct LlaCoor_i *lla)
 
void lla_of_ecef_i (struct LlaCoor_i *out, struct EcefCoor_i *in)
 
void ecef_of_lla_i (struct EcefCoor_i *out, struct LlaCoor_i *in)
 
void enu_of_ecef_point_i (struct EnuCoor_i *enu, struct LtpDef_i *def, struct EcefCoor_i *ecef)
 
void ned_of_ecef_point_i (struct NedCoor_i *ned, struct LtpDef_i *def, struct EcefCoor_i *ecef)
 
void enu_of_ecef_vect_i (struct EnuCoor_i *enu, struct LtpDef_i *def, struct EcefCoor_i *ecef)
 
void ned_of_ecef_vect_i (struct NedCoor_i *ned, struct LtpDef_i *def, struct EcefCoor_i *ecef)
 
void enu_of_lla_point_i (struct EnuCoor_i *enu, struct LtpDef_i *def, struct LlaCoor_i *lla)
 
void ned_of_lla_point_i (struct NedCoor_i *ned, struct LtpDef_i *def, struct LlaCoor_i *lla)
 
void enu_of_lla_vect_i (struct EnuCoor_i *enu, struct LtpDef_i *def, struct LlaCoor_i *lla)
 
void ned_of_lla_vect_i (struct NedCoor_i *ned, struct LtpDef_i *def, struct LlaCoor_i *lla)
 
void ecef_of_enu_point_i (struct EcefCoor_i *ecef, struct LtpDef_i *def, struct EnuCoor_i *enu)
 
void ecef_of_ned_point_i (struct EcefCoor_i *ecef, struct LtpDef_i *def, struct NedCoor_i *ned)
 
void ecef_of_enu_vect_i (struct EcefCoor_i *ecef, struct LtpDef_i *def, struct EnuCoor_i *enu)
 
void ecef_of_ned_vect_i (struct EcefCoor_i *ecef, struct LtpDef_i *def, struct NedCoor_i *ned)
 

Detailed Description

Paparazzi fixed point math for geodetic calculations.

This is the more detailed description of this file.

Definition in file pprz_geodetic_int.h.

Macro Definition Documentation

#define CM_OF_M (   _m)    ((_m)*1e2)

Definition at line 119 of file pprz_geodetic_int.h.

Referenced by ecef_of_lla_i().

#define ECEF_BFP_OF_REAL (   _o,
  _i 
)
Value:
{ \
(_o).x = (int32_t)CM_OF_M((_i).x); \
(_o).y = (int32_t)CM_OF_M((_i).y); \
(_o).z = (int32_t)CM_OF_M((_i).z); \
}
#define CM_OF_M(_m)
signed long int32_t
Definition: types.h:19

Definition at line 134 of file pprz_geodetic_int.h.

#define ECEF_FLOAT_OF_BFP (   _o,
  _i 
)
Value:
{ \
(_o).x = (float)M_OF_CM((_i).x); \
(_o).y = (float)M_OF_CM((_i).y); \
(_o).z = (float)M_OF_CM((_i).z); \
}
#define M_OF_CM(_cm)

Definition at line 140 of file pprz_geodetic_int.h.

#define EM7RAD_OF_RAD (   _r)    ((_r)*1e7)

Definition at line 123 of file pprz_geodetic_int.h.

Referenced by lla_of_ecef_i().

#define ENU_BFP_OF_REAL (   _o,
  _i 
)    NED_BFP_OF_REAL(_o, _i)

Definition at line 164 of file pprz_geodetic_int.h.

#define ENU_FLOAT_OF_BFP (   _o,
  _i 
)    NED_FLOAT_OF_BFP(_o, _i)

Definition at line 172 of file pprz_geodetic_int.h.

#define INT32_VECT2_ENU_OF_NED (   _o,
  _i 
)
Value:
{ \
(_o).x = (_i).y; \
(_o).y = (_i).x; \
}

Definition at line 174 of file pprz_geodetic_int.h.

#define INT32_VECT2_NED_OF_ENU (   _o,
  _i 
)    INT32_VECT2_ENU_OF_NED(_o,_i)

Definition at line 179 of file pprz_geodetic_int.h.

Referenced by guidance_h_nav_enter(), and guidance_h_run().

#define INT32_VECT3_ENU_OF_NED (   _o,
  _i 
)
Value:
{ \
(_o).x = (_i).y; \
(_o).y = (_i).x; \
(_o).z = -(_i).z; \
}

Definition at line 126 of file pprz_geodetic_int.h.

Referenced by ins_propagate(), and ins_update_gps().

#define INT32_VECT3_NED_OF_ENU (   _o,
  _i 
)    INT32_VECT3_ENU_OF_NED(_o,_i)

Definition at line 132 of file pprz_geodetic_int.h.

#define LLA_BFP_OF_REAL (   _o,
  _i 
)
Value:
{ \
(_o).lat = (int32_t)EM7RAD_OF_RAD((_i).lat); \
(_o).lon = (int32_t)EM7RAD_OF_RAD((_i).lon); \
(_o).alt = (int32_t)MM_OF_M((_i).alt); \
}
#define MM_OF_M(_m)
signed long int32_t
Definition: types.h:19
#define EM7RAD_OF_RAD(_r)

Definition at line 146 of file pprz_geodetic_int.h.

Referenced by sim_use_gps_pos().

#define LLA_FLOAT_OF_BFP (   _o,
  _i 
)
Value:
{ \
(_o).lat = (float)RAD_OF_EM7RAD((_i).lat); \
(_o).lon = (float)RAD_OF_EM7RAD((_i).lon); \
(_o).alt = (float)M_OF_MM((_i).alt); \
}
#define M_OF_MM(_mm)
#define RAD_OF_EM7RAD(_r)

Definition at line 152 of file pprz_geodetic_int.h.

#define M_OF_CM (   _cm)    ((_cm)/1e2)

Definition at line 120 of file pprz_geodetic_int.h.

Referenced by lla_of_ecef_i().

#define M_OF_MM (   _mm)    ((_mm)/1e3)

Definition at line 122 of file pprz_geodetic_int.h.

Referenced by ecef_of_lla_i().

#define MM_OF_M (   _m)    ((_m)*1e3)

Definition at line 121 of file pprz_geodetic_int.h.

Referenced by lla_of_ecef_i().

#define NED_BFP_OF_REAL (   _o,
  _i 
)
Value:
{ \
(_o).x = POS_BFP_OF_REAL((_i).x); \
(_o).y = POS_BFP_OF_REAL((_i).y); \
(_o).z = POS_BFP_OF_REAL((_i).z); \
}
#define POS_BFP_OF_REAL(_af)

Definition at line 158 of file pprz_geodetic_int.h.

#define NED_FLOAT_OF_BFP (   _o,
  _i 
)
Value:
{ \
(_o).x = POS_FLOAT_OF_BFP((_i).x); \
(_o).y = POS_FLOAT_OF_BFP((_i).y); \
(_o).z = POS_FLOAT_OF_BFP((_i).z); \
}
#define POS_FLOAT_OF_BFP(_ai)

Definition at line 166 of file pprz_geodetic_int.h.

#define RAD_OF_EM7RAD (   _r)    ((_r)/1e7)

Definition at line 124 of file pprz_geodetic_int.h.

Referenced by ecef_of_lla_i(), ltp_def_from_ecef_i(), and ltp_def_from_lla_i().

Function Documentation

void ecef_of_enu_point_i ( struct EcefCoor_i ecef,
struct LtpDef_i def,
struct EnuCoor_i enu 
)

Definition at line 148 of file pprz_geodetic_int.c.

References LtpDef_i::ecef, INT32_RMAT_TRANSP_VMULT, INT32_VECT3_ADD, and LtpDef_i::ltp_of_ecef.

Referenced by ecef_of_ned_point_i().

+ Here is the caller graph for this function:

void ecef_of_enu_vect_i ( struct EcefCoor_i ecef,
struct LtpDef_i def,
struct EnuCoor_i enu 
)

Definition at line 159 of file pprz_geodetic_int.c.

References INT32_RMAT_TRANSP_VMULT, and LtpDef_i::ltp_of_ecef.

Referenced by ecef_of_ned_vect_i().

+ Here is the caller graph for this function:

void ecef_of_lla_i ( struct EcefCoor_i out,
struct LlaCoor_i in 
)
void ecef_of_ned_point_i ( struct EcefCoor_i ecef,
struct LtpDef_i def,
struct NedCoor_i ned 
)

Definition at line 153 of file pprz_geodetic_int.c.

References ecef_of_enu_point_i(), and ENU_OF_TO_NED.

+ Here is the call graph for this function:

void ecef_of_ned_vect_i ( struct EcefCoor_i ecef,
struct LtpDef_i def,
struct NedCoor_i ned 
)

Definition at line 163 of file pprz_geodetic_int.c.

References ecef_of_enu_vect_i(), and ENU_OF_TO_NED.

+ Here is the call graph for this function:

void enu_of_ecef_point_i ( struct EnuCoor_i enu,
struct LtpDef_i def,
struct EcefCoor_i ecef 
)
void enu_of_ecef_vect_i ( struct EnuCoor_i enu,
struct LtpDef_i def,
struct EcefCoor_i ecef 
)

Definition at line 123 of file pprz_geodetic_int.c.

References HIGH_RES_TRIG_FRAC, LtpDef_i::ltp_of_ecef, Int32Mat33::m, EcefCoor_i::x, EnuCoor_i::x, EcefCoor_i::y, EnuCoor_i::y, EcefCoor_i::z, and EnuCoor_i::z.

Referenced by enu_of_lla_vect_i(), and ned_of_ecef_vect_i().

+ Here is the caller graph for this function:

void enu_of_lla_point_i ( struct EnuCoor_i enu,
struct LtpDef_i def,
struct LlaCoor_i lla 
)

Definition at line 170 of file pprz_geodetic_int.c.

References ecef_of_lla_i(), and enu_of_ecef_point_i().

Referenced by dl_parse_msg().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void enu_of_lla_vect_i ( struct EnuCoor_i enu,
struct LtpDef_i def,
struct LlaCoor_i lla 
)

Definition at line 182 of file pprz_geodetic_int.c.

References ecef_of_lla_i(), and enu_of_ecef_vect_i().

+ Here is the call graph for this function:

void lla_of_ecef_i ( struct LlaCoor_i out,
struct EcefCoor_i in 
)

Definition at line 201 of file pprz_geodetic_int.c.

References LlaCoor_d::alt, LlaCoor_i::alt, EM7RAD_OF_RAD, LlaCoor_d::lat, LlaCoor_i::lat, lla_of_ecef_d(), LlaCoor_d::lon, LlaCoor_i::lon, M_OF_CM, MM_OF_M, EcefCoor_d::x, EcefCoor_i::x, EcefCoor_d::y, EcefCoor_i::y, EcefCoor_d::z, and EcefCoor_i::z.

Referenced by ltp_def_from_ecef_i().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ltp_def_from_ecef_i ( struct LtpDef_i def,
struct EcefCoor_i ecef 
)

Definition at line 29 of file pprz_geodetic_int.c.

References BFP_OF_REAL, LtpDef_i::ecef, HIGH_RES_TRIG_FRAC, LlaCoor_i::lat, LtpDef_i::lla, lla_of_ecef_i(), LlaCoor_i::lon, LtpDef_i::ltp_of_ecef, Int32Mat33::m, RAD_OF_EM7RAD, and VECT3_COPY.

Referenced by ins_init(), and ins_update_gps().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ltp_def_from_lla_i ( struct LtpDef_i def,
struct LlaCoor_i lla 
)
void ned_of_ecef_point_i ( struct NedCoor_i ned,
struct LtpDef_i def,
struct EcefCoor_i ecef 
)

Definition at line 115 of file pprz_geodetic_int.c.

References enu_of_ecef_point_i(), and ENU_OF_TO_NED.

Referenced by ins_update_gps(), and ned_of_lla_point_i().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ned_of_ecef_vect_i ( struct NedCoor_i ned,
struct LtpDef_i def,
struct EcefCoor_i ecef 
)

Definition at line 141 of file pprz_geodetic_int.c.

References enu_of_ecef_vect_i(), and ENU_OF_TO_NED.

Referenced by ins_update_gps(), and ned_of_lla_vect_i().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ned_of_lla_point_i ( struct NedCoor_i ned,
struct LtpDef_i def,
struct LlaCoor_i lla 
)

Definition at line 176 of file pprz_geodetic_int.c.

References ecef_of_lla_i(), and ned_of_ecef_point_i().

+ Here is the call graph for this function:

void ned_of_lla_vect_i ( struct NedCoor_i ned,
struct LtpDef_i def,
struct LlaCoor_i lla 
)

Definition at line 188 of file pprz_geodetic_int.c.

References ecef_of_lla_i(), and ned_of_ecef_vect_i().

+ Here is the call graph for this function: