|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
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(buf) != AC_ID) {
return; }
236 DL_REMOTE_GPS_ecef_x(buf),
237 DL_REMOTE_GPS_ecef_y(buf),
238 DL_REMOTE_GPS_ecef_z(buf),
239 DL_REMOTE_GPS_lat(buf),
240 DL_REMOTE_GPS_lon(buf),
241 DL_REMOTE_GPS_alt(buf),
242 DL_REMOTE_GPS_hmsl(buf),
243 DL_REMOTE_GPS_ecef_xd(buf),
244 DL_REMOTE_GPS_ecef_yd(buf),
245 DL_REMOTE_GPS_ecef_zd(buf),
246 DL_REMOTE_GPS_tow(buf),
247 DL_REMOTE_GPS_course(buf));
252 if (DL_REMOTE_GPS_SMALL_ac_id(buf) != AC_ID) {
return; }
255 DL_REMOTE_GPS_SMALL_pos_xyz(buf),
256 DL_REMOTE_GPS_SMALL_speed_xyz(buf),
257 DL_REMOTE_GPS_SMALL_tow(buf));
262 if (DL_REMOTE_GPS_LOCAL_ac_id(buf) != AC_ID) {
return; }
265 DL_REMOTE_GPS_LOCAL_enu_y(buf),
266 DL_REMOTE_GPS_LOCAL_enu_z(buf),
267 DL_REMOTE_GPS_LOCAL_enu_xd(buf),
268 DL_REMOTE_GPS_LOCAL_enu_yd(buf),
269 DL_REMOTE_GPS_LOCAL_enu_zd(buf),
270 DL_REMOTE_GPS_LOCAL_tow(buf),
271 DL_REMOTE_GPS_LOCAL_course(buf));
int32_t lon
in degrees*1e7
uint8_t valid_fields
bitfield indicating valid fields (GPS_VALID_x_BIT)
#define VECT3_NED_OF_ENU(_o, _i)
int32_t alt
in millimeters above WGS84 reference ellipsoid
#define GPS_VALID_COURSE_BIT
void lla_of_ecef_i(struct LlaCoor_i *out, struct EcefCoor_i *in)
Convert a ECEF to LLA.
uint32_t tow
GPS time of week in ms.
definition of the local (flat earth) coordinate system
data structure for GPS information
uint32_t pacc
position accuracy in cm
uint32_t sacc
speed accuracy in cm/s
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 FLOAT_VECT3_NORM(_v)
void gps_datalink_parse_REMOTE_GPS_SMALL(uint8_t *buf)
struct NedCoor_i ned_vel
speed NED in cm/s
#define GPS_VALID_POS_LLA_BIT
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
int32_t lat
in degrees*1e7
uint32_t last_msg_ticks
cpu time ticks at last received GPS message
Device independent GPS code (interface)
uint16_t speed_3d
norm of 3d speed in cm/s
#define FLOAT_VECT2_NORM(_v)
void gps_datalink_parse_REMOTE_GPS_LOCAL(uint8_t *buf)
uint16_t gspeed
norm of 2d ground speed in cm/s
void gps_datalink_parse_REMOTE_GPS(uint8_t *buf)
static void parse_gps_datalink_small(int16_t heading, uint32_t pos_xyz, uint32_t speed_xyz, uint32_t tow)
uint32_t last_3dfix_time
cpu time in sec at last valid 3D fix
uint32_t last_3dfix_ticks
cpu time ticks at last valid 3D fix
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.
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.
uint8_t comp_id
id of current gps
void ltp_def_from_lla_i(struct LtpDef_i *def, struct LlaCoor_i *lla)
int32_t course
GPS course over ground in rad*1e7, [0, 2*Pi]*1e7 (CW/north)
uint32_t last_msg_time
cpu time in sec at last received GPS message
struct EcefCoor_i ecef_pos
position in ECEF in cm
#define GPS_VALID_VEL_NED_BIT
vector in Latitude, Longitude and Altitude
void gps_datalink_init(void)
GPS initialization.
struct LlaCoor_i lla_pos
position in LLA (lat,lon: deg*1e7; alt: mm over ellipsoid)
int32_t hmsl
Height above mean sea level in mm.
#define GPS_VALID_VEL_ECEF_BIT
uint8_t num_sv
number of sat in fix
volatile uint32_t nb_sec_rem
remainder of seconds since startup in CPU_TICKS
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.
int32_t hmsl
height above mean sea level (MSL) in mm
struct GpsState gps_datalink
uint16_t pdop
position dilution of precision scaled by 100
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.
Handling of messages coming from ground and other A/Cs.
#define GPS_VALID_POS_ECEF_BIT
uint32_t cacc
course accuracy in rad*1e7
volatile uint32_t nb_sec
full seconds since startup
struct EcefCoor_i ecef_vel
speed ECEF in cm/s
#define GPS_FIX_NONE
No GPS fix.
#define GPS_FIX_3D
3D GPS fix
vector in East North Up coordinates
#define GPS_VALID_HMSL_BIT