30 #include "generated/flight_plan.h"
52 llh_nav0.
lat = NAV_LAT0;
53 llh_nav0.
lon = NAV_LON0;
55 llh_nav0.
alt = NAV_ALT0 + NAV_MSL0;
66 enu_pos.
x = (
int32_t)((pos_xyz >> 21) & 0x7FF);
67 if (enu_pos.
x & 0x400) {
68 enu_pos.
x |= 0xFFFFF800;
70 enu_pos.
y = (
int32_t)((pos_xyz >> 10) & 0x7FF);
71 if (enu_pos.
y & 0x400) {
72 enu_pos.
y |= 0xFFFFF800;
74 enu_pos.
z = (
int32_t)(pos_xyz & 0x3FF);
83 enu_speed.
x = (
int32_t)((speed_xyz >> 21) & 0x7FF);
84 if (enu_speed.
x & 0x400) {
85 enu_speed.
x |= 0xFFFFF800;
87 enu_speed.
y = (
int32_t)((speed_xyz >> 10) & 0x7FF);
88 if (enu_speed.
y & 0x400) {
89 enu_speed.
y |= 0xFFFFF800;
91 enu_speed.
z = (
int32_t)((speed_xyz) & 0x3FF);
92 if (enu_speed.
z & 0x200) {
93 enu_speed.
z |= 0xFFFFFC00;
178 float enu_xd,
float enu_yd,
float enu_zd,
233 if (DL_REMOTE_GPS_ac_id(
dl_buffer) != AC_ID) {
return; }
252 if (DL_REMOTE_GPS_SMALL_ac_id(
dl_buffer) != AC_ID) {
return; }
256 DL_REMOTE_GPS_SMALL_speed_xyz(
dl_buffer),
262 if (DL_REMOTE_GPS_LOCAL_ac_id(
dl_buffer) != AC_ID) {
return; }
uint32_t pacc
position accuracy in cm
definition of the local (flat earth) coordinate system
#define GPS_VALID_VEL_NED_BIT
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.
uint8_t valid_fields
bitfield indicating valid fields (GPS_VALID_x_BIT)
Handling of messages coming from ground and other A/Cs.
void gps_datalink_parse_REMOTE_GPS(void)
Main include for ABI (AirBorneInterface).
vector in Latitude, Longitude and Altitude
uint16_t speed_3d
norm of 3d speed in cm/s
#define GPS_FIX_3D
3D GPS fix
void ltp_def_from_lla_i(struct LtpDef_i *def, struct LlaCoor_i *lla)
void ned_of_ecef_vect_i(struct NedCoor_i *ned, struct LtpDef_i *def, struct EcefCoor_i *ecef)
Rotate a vector from ECEF to NED.
int32_t hmsl
Height above mean sea level in mm.
#define FLOAT_VECT3_NORM(_v)
uint32_t last_3dfix_ticks
cpu time ticks at last valid 3D fix
int32_t alt
in millimeters above WGS84 reference ellipsoid
uint32_t sacc
speed accuracy in cm/s
uint32_t last_msg_time
cpu time in sec at last received GPS message
uint32_t cacc
course accuracy in rad*1e7
#define GPS_VALID_COURSE_BIT
#define FLOAT_VECT2_NORM(_v)
int32_t hmsl
height above mean sea level (MSL) in mm
static 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.
data structure for GPS information
uint32_t tow
GPS time of week in ms.
#define GPS_FIX_NONE
No GPS fix.
Device independent GPS code (interface)
uint16_t pdop
position dilution of precision scaled by 100
struct EcefCoor_i ecef_pos
position in ECEF in cm
#define GPS_VALID_HMSL_BIT
int32_t lon
in degrees*1e7
static void parse_gps_datalink_small(int16_t heading, uint32_t pos_xyz, uint32_t speed_xyz, uint32_t tow)
volatile uint32_t nb_sec_rem
remainder of seconds since startup in CPU_TICKS
struct GpsState gps_datalink
void gps_datalink_parse_REMOTE_GPS_LOCAL(void)
#define VECT3_NED_OF_ENU(_o, _i)
uint32_t last_3dfix_time
cpu time in sec at last valid 3D fix
void gps_datalink_parse_REMOTE_GPS_SMALL(void)
vector in East North Up coordinates
int32_t course
GPS course over ground in rad*1e7, [0, 2*Pi]*1e7 (CW/north)
uint8_t comp_id
id of current gps
volatile uint32_t nb_sec
full seconds since startup
#define GPS_VALID_POS_ECEF_BIT
void gps_datalink_init(void)
GPS initialization.
uint8_t dl_buffer[MSG_SIZE]
uint32_t last_msg_ticks
cpu time ticks at last received GPS message
#define GPS_VALID_POS_LLA_BIT
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
#define GPS_VALID_VEL_ECEF_BIT
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)
Convert a ECEF to LLA.
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
int32_t lat
in degrees*1e7
struct NedCoor_i ned_vel
speed NED in cm/s
static void parse_gps_datalink_local(float enu_x, float enu_y, float enu_z, float enu_xd, float enu_yd, float enu_zd, uint32_t tow, float course)
Parse the REMOTE_GPS_LOCAL datalink packet.
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.