35 #if GPS_USE_DATALINK_SMALL
36 #ifndef GPS_LOCAL_ECEF_ORIGIN_X
37 #error Local x coordinate in ECEF of the remote GPS required
40 #ifndef GPS_LOCAL_ECEF_ORIGIN_Y
41 #error Local y coordinate in ECEF of the remote GPS required
44 #ifndef GPS_LOCAL_ECEF_ORIGIN_Z
45 #error Local z coordinate in ECEF of the remote GPS required
69 #if GPS_USE_DATALINK_SMALL
70 tracking_ecef.x = GPS_LOCAL_ECEF_ORIGIN_X;
71 tracking_ecef.y = GPS_LOCAL_ECEF_ORIGIN_Y;
72 tracking_ecef.z = GPS_LOCAL_ECEF_ORIGIN_Z;
78 #ifdef GPS_USE_DATALINK_SMALL
84 enu_pos.x = (
int32_t)((pos_xyz >> 22) & 0x3FF);
85 if (enu_pos.x & 0x200) {
86 enu_pos.x |= 0xFFFFFC00;
88 enu_pos.y = (
int32_t)((pos_xyz >> 12) & 0x3FF);
89 if (enu_pos.y & 0x200) {
90 enu_pos.y |= 0xFFFFFC00;
92 enu_pos.z = (
int32_t)(pos_xyz >> 2 & 0x3FF);
104 enu_speed.x = (
int32_t)((speed_xy >> 22) & 0x3FF);
105 if (enu_speed.x & 0x200) {
106 enu_speed.x |= 0xFFFFFC00;
108 enu_speed.y = (
int32_t)((speed_xy >> 12) & 0x3FF);
109 if (enu_speed.y & 0x200) {
110 enu_speed.y |= 0xFFFFFC00;
118 gps.
hmsl = tracking_ltp.hmsl + enu_pos.z * 10;
int32_t north
in centimeters
void parse_gps_datalink(uint8_t numsv, int32_t ecef_x, int32_t ecef_y, int32_t ecef_z, int32_t lat, int32_t lon, int32_t alt, int32_t hmsl, int32_t ecef_xd, int32_t ecef_yd, int32_t ecef_zd, uint32_t tow, int32_t course)
Parse the REMOTE_GPS datalink packet.
definition of the local (flat earth) coordinate system
float alt
in meters above WGS84 reference ellipsoid
void gps_impl_init(void)
GPS initialization.
void ecef_of_enu_point_i(struct EcefCoor_i *ecef, struct LtpDef_i *def, struct EnuCoor_i *enu)
Convert a point in local ENU to ECEF.
vector in EarthCenteredEarthFixed coordinates
Main include for ABI (AirBorneInterface).
position in UTM coordinates Units: meters
int32_t east
in centimeters
vector in Latitude, Longitude and Altitude
#define GPS_FIX_3D
3D GPS fix
struct UtmCoor_i utm_pos
position in UTM (north,east: cm; alt: mm over ellipsoid)
uint32_t last_3dfix_ticks
cpu time ticks at last valid 3D fix
int32_t alt
in millimeters above WGS84 reference ellipsoid
static uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
uint32_t last_msg_time
cpu time in sec at last received GPS message
uint32_t cacc
course accuracy in rad*1e7
uint8_t zone
UTM zone number.
vector in Latitude, Longitude and Altitude
int32_t hmsl
height above mean sea level in mm
uint32_t tow
GPS time of week in ms.
#define GPS_FIX_NONE
No GPS fix.
Device independent GPS code (interface)
struct EcefCoor_i ecef_pos
position in ECEF in cm
int32_t lon
in degrees*1e7
uint8_t zone
UTM zone number.
volatile uint32_t nb_sec_rem
remainder of seconds since startup in CPU_TICKS
uint32_t last_3dfix_time
cpu time in sec at last valid 3D fix
int32_t alt
in millimeters above WGS84 reference ellipsoid
vector in East North Up coordinates
int32_t course
GPS course over ground in rad*1e7, [0, 2*Pi]*1e7 (CW/north)
volatile uint32_t nb_sec
full seconds since startup
uint32_t last_msg_ticks
cpu time ticks at last received GPS message
uint8_t num_sv
number of sat in fix
uint16_t gspeed
norm of 2d ground speed in cm/s
struct EcefCoor_i ecef_vel
speed ECEF in cm/s
struct LlaCoor_i lla_pos
position in LLA (lat,lon: deg*1e7; alt: mm over ellipsoid)
void lla_of_ecef_i(struct LlaCoor_i *out, struct EcefCoor_i *in)
int32_t lat
in degrees*1e7
bool_t gps_available
Is set to TRUE when a new REMOTE_GPS packet is received and parsed.
struct GpsState gps
global GPS state
void ecef_of_enu_vect_i(struct EcefCoor_i *ecef, struct LtpDef_i *def, struct EnuCoor_i *enu)
Rotate a vector from ENU to ECEF.
#define LLA_FLOAT_OF_BFP(_o, _i)
void ltp_def_from_ecef_i(struct LtpDef_i *def, struct EcefCoor_i *ecef)
void utm_of_lla_f(struct UtmCoor_f *utm, struct LlaCoor_f *lla)