Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Position representations
+ Collaboration diagram for Position representations:

Macros

#define POS_ECEF_I   0
 
#define POS_NED_I   1
 
#define POS_ENU_I   2
 
#define POS_LLA_I   3
 
#define POS_UTM_I   4
 
#define POS_ECEF_F   5
 
#define POS_NED_F   6
 
#define POS_ENU_F   7
 
#define POS_LLA_F   8
 
#define POS_UTM_F   9
 
#define POS_LOCAL_COORD   ((1<<POS_NED_I)|(1<<POS_NED_F)|(1<<POS_ENU_I)|(1<<POS_ENU_F))
 
#define POS_GLOBAL_COORD   ((1<<POS_ECEF_I)|(1<<POS_ECEF_F)|(1<<POS_LLA_I)|(1<<POS_LLA_F)|(1<<POS_UTM_I)|(1<<POS_UTM_F))
 

Functions

void stateCalcPositionEcef_i (void)
 
void stateCalcPositionNed_i (void)
 
void stateCalcPositionEnu_i (void)
 
void stateCalcPositionLla_i (void)
 
void stateCalcPositionUtm_f (void)
 
void stateCalcPositionEcef_f (void)
 
void stateCalcPositionNed_f (void)
 
void stateCalcPositionEnu_f (void)
 
void stateCalcPositionLla_f (void)
 
static void stateSetLocalOrigin_i (struct LtpDef_i *ltp_def)
 Set the local (flat earth) coordinate frame origin (int). More...
 
static void stateSetLocalUtmOrigin_f (struct UtmCoor_f *utm_def)
 Set the local (flat earth) coordinate frame origin from UTM (float). More...
 
static bool_t stateIsLocalCoordinateValid (void)
 Test if local coordinates are valid. More...
 
static bool_t stateIsGlobalCoordinateValid (void)
 Test if global coordinates are valid. More...
 
static void stateSetPositionEcef_i (struct EcefCoor_i *ecef_pos)
 Set position from ECEF coordinates (int). More...
 
static void stateSetPositionNed_i (struct NedCoor_i *ned_pos)
 Set position from local NED coordinates (int). More...
 
static void stateSetPositionEnu_i (struct EnuCoor_i *enu_pos)
 Set position from local ENU coordinates (int). More...
 
static void stateSetPositionLla_i (struct LlaCoor_i *lla_pos)
 Set position from LLA coordinates (int). More...
 
static void stateSetPosition_i (struct EcefCoor_i *ecef_pos, struct NedCoor_i *ned_pos, struct EnuCoor_i *enu_pos, struct LlaCoor_i *lla_pos)
 Set multiple position coordinates (int). More...
 
static void stateSetPositionUtm_f (struct UtmCoor_f *utm_pos)
 Set position from UTM coordinates (float). More...
 
static void stateSetPositionEcef_f (struct EcefCoor_f *ecef_pos)
 Set position from ECEF coordinates (float). More...
 
static void stateSetPositionNed_f (struct NedCoor_f *ned_pos)
 Set position from local NED coordinates (float). More...
 
static void stateSetPositionEnu_f (struct EnuCoor_f *enu_pos)
 Set position from local ENU coordinates (float). More...
 
static void stateSetPositionLla_f (struct LlaCoor_f *lla_pos)
 Set position from LLA coordinates (float). More...
 
static void stateSetPosition_f (struct EcefCoor_f *ecef_pos, struct NedCoor_f *ned_pos, struct EnuCoor_f *enu_pos, struct LlaCoor_f *lla_pos, struct UtmCoor_f *utm_pos)
 Set multiple position coordinates (float). More...
 
static struct EcefCoor_istateGetPositionEcef_i (void)
 Get position in ECEF coordinates (int). More...
 
static struct NedCoor_istateGetPositionNed_i (void)
 Get position in local NED coordinates (int). More...
 
static struct EnuCoor_istateGetPositionEnu_i (void)
 Get position in local ENU coordinates (int). More...
 
static struct LlaCoor_istateGetPositionLla_i (void)
 Get position in LLA coordinates (int). More...
 
static struct UtmCoor_fstateGetPositionUtm_f (void)
 Get position in UTM coordinates (float). More...
 
static struct EcefCoor_fstateGetPositionEcef_f (void)
 Get position in ECEF coordinates (float). More...
 
static struct NedCoor_fstateGetPositionNed_f (void)
 Get position in local NED coordinates (float). More...
 
static struct EnuCoor_fstateGetPositionEnu_f (void)
 Get position in local ENU coordinates (float). More...
 
static struct LlaCoor_fstateGetPositionLla_f (void)
 Get position in LLA coordinates (float). More...
 

Variables

uint16_t State::pos_status
 Holds the status bits for all position representations. More...
 
struct EcefCoor_i State::ecef_pos_i
 Position in EarthCenteredEarthFixed coordinates. More...
 
struct LlaCoor_i State::lla_pos_i
 Position in Latitude, Longitude and Altitude. More...
 
struct LtpDef_i State::ned_origin_i
 Definition of the local (flat earth) coordinate system. More...
 
bool_t State::ned_initialized_i
 true if local int coordinate frame is initialsed More...
 
struct NedCoor_i State::ned_pos_i
 Position in North East Down coordinates. More...
 
struct EnuCoor_i State::enu_pos_i
 Position in East North Up coordinates. More...
 
struct UtmCoor_f State::utm_pos_f
 Position in UTM coordinates. More...
 
float State::alt_agl_f
 Altitude above ground level. More...
 
struct LlaCoor_f State::lla_pos_f
 Position in Latitude, Longitude and Altitude. More...
 
struct EcefCoor_f State::ecef_pos_f
 Position in EarthCenteredEarthFixed coordinates. More...
 
struct LtpDef_f State::ned_origin_f
 Definition of the local (flat earth) coordinate system. More...
 
bool_t State::ned_initialized_f
 True if local float coordinate frame is initialsed. More...
 
struct UtmCoor_f State::utm_origin_f
 Definition of the origin of Utm coordinate system. More...
 
bool_t State::utm_initialized_f
 True if utm origin (float) coordinate frame is initialsed. More...
 
struct NedCoor_f State::ned_pos_f
 Position in North East Down coordinates. More...
 
struct EnuCoor_f State::enu_pos_f
 Position in East North Up coordinates. More...
 

Detailed Description

Macro Definition Documentation

#define POS_GLOBAL_COORD   ((1<<POS_ECEF_I)|(1<<POS_ECEF_F)|(1<<POS_LLA_I)|(1<<POS_LLA_F)|(1<<POS_UTM_I)|(1<<POS_UTM_F))

Definition at line 76 of file state.h.

Referenced by stateIsGlobalCoordinateValid().

#define POS_LOCAL_COORD   ((1<<POS_NED_I)|(1<<POS_NED_F)|(1<<POS_ENU_I)|(1<<POS_ENU_F))

Definition at line 75 of file state.h.

Referenced by stateIsLocalCoordinateValid(), and stateSetLocalUtmOrigin_f().

#define POS_UTM_I   4

Definition at line 69 of file state.h.

Function Documentation

void stateCalcPositionEcef_f ( void  )
void stateCalcPositionEcef_i ( void  )
void stateCalcPositionLla_f ( void  )
void stateCalcPositionUtm_f ( void  )

Definition at line 327 of file state.c.

References LLA_FLOAT_OF_BFP, State::lla_pos_f, State::lla_pos_i, POS_LLA_F, POS_LLA_I, State::pos_status, POS_UTM_F, state, utm_of_lla_f(), and State::utm_pos_f.

Referenced by stateGetPositionUtm_f().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static struct EcefCoor_f* stateGetPositionEcef_f ( void  )
static

Get position in ECEF coordinates (float).

Definition at line 658 of file state.h.

References State::ecef_pos_f, POS_ECEF_F, State::pos_status, state, and stateCalcPositionEcef_f().

+ Here is the call graph for this function:

static struct EcefCoor_i* stateGetPositionEcef_i ( void  )
static

Get position in ECEF coordinates (int).

Definition at line 623 of file state.h.

References State::ecef_pos_i, POS_ECEF_I, State::pos_status, state, and stateCalcPositionEcef_i().

+ Here is the call graph for this function:

static struct EnuCoor_i* stateGetPositionEnu_i ( void  )
static

Get position in local ENU coordinates (int).

Definition at line 637 of file state.h.

References State::enu_pos_i, POS_ENU_I, State::pos_status, state, and stateCalcPositionEnu_i().

Referenced by nav_advance_carrot(), nav_approaching_from(), nav_circle(), nav_init_stage(), nav_route(), and rotorcraft_cam_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static struct LlaCoor_f* stateGetPositionLla_f ( void  )
static

Get position in LLA coordinates (float).

Definition at line 679 of file state.h.

References State::lla_pos_f, POS_LLA_F, State::pos_status, state, and stateCalcPositionLla_f().

+ Here is the call graph for this function:

static struct LlaCoor_i* stateGetPositionLla_i ( void  )
static

Get position in LLA coordinates (int).

Definition at line 644 of file state.h.

References State::lla_pos_i, POS_LLA_I, State::pos_status, state, and stateCalcPositionLla_i().

+ Here is the call graph for this function:

static struct NedCoor_f* stateGetPositionNed_f ( void  )
static

Get position in local NED coordinates (float).

Definition at line 665 of file state.h.

References State::ned_pos_f, POS_NED_F, State::pos_status, state, and stateCalcPositionNed_f().

+ Here is the call graph for this function:

static struct NedCoor_i* stateGetPositionNed_i ( void  )
static

Get position in local NED coordinates (int).

Definition at line 630 of file state.h.

References State::ned_pos_i, POS_NED_I, State::pos_status, state, and stateCalcPositionNed_i().

Referenced by guidance_h_hover_enter(), guidance_h_traj_run(), guidance_v_mode_changed(), guidance_v_run(), reset_guidance_reference_from_current_position(), and run_hover_loop().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static struct UtmCoor_f* stateGetPositionUtm_f ( void  )
static
static bool_t stateIsGlobalCoordinateValid ( void  )
inlinestatic

Test if global coordinates are valid.

Definition at line 494 of file state.h.

References POS_GLOBAL_COORD, State::pos_status, state, and stateIsLocalCoordinateValid().

+ Here is the call graph for this function:

static bool_t stateIsLocalCoordinateValid ( void  )
inlinestatic

Test if local coordinates are valid.

Definition at line 489 of file state.h.

References State::ned_initialized_i, POS_LOCAL_COORD, State::pos_status, state, and State::utm_initialized_f.

Referenced by stateIsGlobalCoordinateValid().

+ Here is the caller graph for this function:

static void stateSetLocalOrigin_i ( struct LtpDef_i ltp_def)
inlinestatic

Set the local (flat earth) coordinate frame origin (int).

Definition at line 440 of file state.h.

Referenced by ins_init(), ins_update_gps(), and nav_reset_alt().

+ Here is the caller graph for this function:

static void stateSetLocalUtmOrigin_f ( struct UtmCoor_f utm_def)
inlinestatic

Set the local (flat earth) coordinate frame origin from UTM (float).

Definition at line 459 of file state.h.

References ACCEL_NED_F, ACCEL_NED_I, State::accel_status, POS_LOCAL_COORD, State::pos_status, SPEED_LOCAL_COORD, State::speed_status, state, TRUE, State::utm_initialized_f, and State::utm_origin_f.

Referenced by ins_init(), and nav_reset_reference().

+ Here is the caller graph for this function:

static void stateSetPosition_f ( struct EcefCoor_f ecef_pos,
struct NedCoor_f ned_pos,
struct EnuCoor_f enu_pos,
struct LlaCoor_f lla_pos,
struct UtmCoor_f utm_pos 
)
inlinestatic
static void stateSetPosition_i ( struct EcefCoor_i ecef_pos,
struct NedCoor_i ned_pos,
struct EnuCoor_i enu_pos,
struct LlaCoor_i lla_pos 
)
inlinestatic

Set multiple position coordinates (int).

Definition at line 529 of file state.h.

References State::ecef_pos_i, State::enu_pos_i, INT32_VECT3_COPY, LLA_COPY, State::lla_pos_i, State::ned_pos_i, POS_ECEF_I, POS_ENU_I, POS_LLA_I, POS_NED_I, State::pos_status, and state.

static void stateSetPositionEcef_f ( struct EcefCoor_f ecef_pos)
inlinestatic

Set position from ECEF coordinates (float).

Definition at line 562 of file state.h.

References State::ecef_pos_f, POS_ECEF_F, State::pos_status, state, and VECT3_COPY.

static void stateSetPositionEcef_i ( struct EcefCoor_i ecef_pos)
inlinestatic

Set position from ECEF coordinates (int).

Definition at line 501 of file state.h.

References State::ecef_pos_i, INT32_VECT3_COPY, POS_ECEF_I, State::pos_status, and state.

static void stateSetPositionEnu_f ( struct EnuCoor_f enu_pos)
inlinestatic

Set position from local ENU coordinates (float).

Definition at line 576 of file state.h.

References State::enu_pos_f, POS_ENU_F, State::pos_status, state, and VECT3_COPY.

static void stateSetPositionEnu_i ( struct EnuCoor_i enu_pos)
inlinestatic

Set position from local ENU coordinates (int).

Definition at line 515 of file state.h.

References State::enu_pos_i, INT32_VECT3_COPY, POS_ENU_I, State::pos_status, and state.

static void stateSetPositionLla_f ( struct LlaCoor_f lla_pos)
inlinestatic

Set position from LLA coordinates (float).

Definition at line 583 of file state.h.

References LLA_COPY, State::lla_pos_f, POS_LLA_F, State::pos_status, and state.

static void stateSetPositionLla_i ( struct LlaCoor_i lla_pos)
inlinestatic

Set position from LLA coordinates (int).

Definition at line 522 of file state.h.

References LLA_COPY, State::lla_pos_i, POS_LLA_I, State::pos_status, and state.

static void stateSetPositionNed_f ( struct NedCoor_f ned_pos)
inlinestatic

Set position from local NED coordinates (float).

Definition at line 569 of file state.h.

References State::ned_pos_f, POS_NED_F, State::pos_status, state, and VECT3_COPY.

static void stateSetPositionNed_i ( struct NedCoor_i ned_pos)
inlinestatic

Set position from local NED coordinates (int).

Definition at line 508 of file state.h.

References INT32_VECT3_COPY, State::ned_pos_i, POS_NED_I, State::pos_status, and state.

Referenced by ins_propagate(), ins_update_gps(), and track_event().

+ Here is the caller graph for this function:

static void stateSetPositionUtm_f ( struct UtmCoor_f utm_pos)
inlinestatic

Set position from UTM coordinates (float).

Definition at line 555 of file state.h.

References State::pos_status, POS_UTM_F, state, and State::utm_pos_f.

Referenced by ins_init(), ins_update_baro(), and ins_update_gps().

+ Here is the caller graph for this function:

Variable Documentation

float State::alt_agl_f

Altitude above ground level.

Unit: meters

Definition at line 194 of file state.h.

struct EnuCoor_f State::enu_pos_f

Position in East North Up coordinates.

with respect to ned_origin_i (flat earth) Units: meters

Definition at line 245 of file state.h.

Referenced by stateCalcPositionEnu_f(), stateCalcPositionEnu_i(), stateCalcPositionNed_f(), stateCalcPositionNed_i(), stateGetPositionEnu_f(), stateSetPosition_f(), and stateSetPositionEnu_f().

struct EnuCoor_i State::enu_pos_i

Position in East North Up coordinates.

with respect to ned_origin_i (flat earth) Units: m in BFP with INT32_POS_FRAC

Definition at line 181 of file state.h.

Referenced by stateCalcPositionEnu_f(), stateCalcPositionEnu_i(), stateCalcPositionNed_f(), stateCalcPositionNed_i(), stateGetPositionEnu_i(), stateSetPosition_i(), and stateSetPositionEnu_i().

struct LlaCoor_f State::lla_pos_f
struct LlaCoor_i State::lla_pos_i

Position in Latitude, Longitude and Altitude.

Units lat,lon: radians*1e7 Units alt: milimeters above reference ellipsoid

Definition at line 153 of file state.h.

Referenced by stateCalcPositionEcef_f(), stateCalcPositionEcef_i(), stateCalcPositionEnu_f(), stateCalcPositionEnu_i(), stateCalcPositionLla_i(), stateCalcPositionNed_f(), stateCalcPositionNed_i(), stateCalcPositionUtm_f(), stateGetPositionLla_i(), stateSetPosition_i(), and stateSetPositionLla_i().

bool_t State::ned_initialized_f

True if local float coordinate frame is initialsed.

Definition at line 219 of file state.h.

Referenced by stateCalcAccelNed_f(), stateCalcPositionEnu_f(), stateCalcPositionNed_f(), stateCalcSpeedEnu_f(), stateCalcSpeedNed_f(), and stateInit().

bool_t State::ned_initialized_i

true if local int coordinate frame is initialsed

Definition at line 167 of file state.h.

Referenced by stateCalcAccelNed_i(), stateCalcPositionEnu_i(), stateCalcPositionNed_i(), stateCalcSpeedEnu_i(), stateCalcSpeedNed_i(), stateInit(), and stateIsLocalCoordinateValid().

struct LtpDef_f State::ned_origin_f

Definition of the local (flat earth) coordinate system.

Defines the origin of the local NorthEastDown coordinate system in ECEF (EarthCenteredEarthFixed) and LLA (LatitudeLongitudeAlt) coordinates and the roation matrix from ECEF to local frame. (float version)

Definition at line 216 of file state.h.

Referenced by stateCalcAccelEcef_f(), stateCalcAccelNed_f(), stateCalcHorizontalSpeedNorm_i(), stateCalcPositionEcef_f(), stateCalcPositionEcef_i(), stateCalcPositionEnu_f(), stateCalcPositionEnu_i(), stateCalcPositionLla_f(), stateCalcPositionLla_i(), stateCalcPositionNed_f(), stateCalcPositionNed_i(), stateCalcSpeedEcef_f(), stateCalcSpeedEnu_f(), and stateCalcSpeedNed_f().

struct LtpDef_i State::ned_origin_i

Definition of the local (flat earth) coordinate system.

Defines the origin of the local NorthEastDown coordinate system in ECEF (EarthCenteredEarthFixed) and LLA (LatitudeLongitudeAlt) coordinates and the roation matrix from ECEF to local frame. (int version)

Definition at line 162 of file state.h.

Referenced by stateCalcAccelEcef_i(), stateCalcAccelNed_i(), stateCalcHorizontalSpeedNorm_i(), stateCalcPositionEcef_f(), stateCalcPositionEcef_i(), stateCalcPositionEnu_f(), stateCalcPositionEnu_i(), stateCalcPositionLla_i(), stateCalcPositionNed_f(), stateCalcPositionNed_i(), stateCalcSpeedEcef_i(), stateCalcSpeedEnu_i(), and stateCalcSpeedNed_i().

struct NedCoor_f State::ned_pos_f
struct NedCoor_i State::ned_pos_i

Position in North East Down coordinates.

with respect to ned_origin_i (flat earth) Units: m in BFP with INT32_POS_FRAC

Definition at line 174 of file state.h.

Referenced by stateCalcPositionEcef_f(), stateCalcPositionEcef_i(), stateCalcPositionEnu_f(), stateCalcPositionEnu_i(), stateCalcPositionLla_f(), stateCalcPositionLla_i(), stateCalcPositionNed_f(), stateCalcPositionNed_i(), stateGetPositionNed_i(), stateSetPosition_i(), and stateSetPositionNed_i().

struct UtmCoor_f State::utm_origin_f

Definition of the origin of Utm coordinate system.

Defines the origin of the local NorthEastDown coordinate system in UTM coordinates, used as a reference when ned_origin is not initialized. (float version)

Definition at line 228 of file state.h.

Referenced by stateCalcPositionEnu_f(), stateCalcPositionEnu_i(), stateCalcPositionNed_f(), stateCalcPositionNed_i(), and stateSetLocalUtmOrigin_f().