|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
29 #include "generated/airframe.h"
30 #include "generated/flight_plan.h"
33 #include "pprzlink/dl_protocol.h"
34 #include "pprzlink/messages.h"
78 uint8_t sender_id = SenderIdOfPprzMsg(buf);
79 uint8_t msg_id = IdOfPprzMsg(buf);
82 #if PPRZLINK_DEFAULT_VER == 2
83 if (pprzlink_get_msg_class_id(buf) == DL_telemetry_CLASS_ID) {
89 uint32_t multiplex_speed = DL_GPS_SMALL_multiplex_speed(buf);
107 DL_GPS_SMALL_lat(buf),
108 DL_GPS_SMALL_lon(buf),
109 (
int32_t)DL_GPS_SMALL_alt(buf) * 10,
118 DL_GPS_utm_east(buf),
119 DL_GPS_utm_north(buf),
121 DL_GPS_utm_zone(buf),
133 DL_GPS_LLA_course(buf),
134 DL_GPS_LLA_speed(buf),
135 DL_GPS_LLA_climb(buf),
136 DL_GPS_LLA_itow(buf));
147 DL_ACINFO_utm_east(buf),
148 DL_ACINFO_utm_north(buf),
149 DL_ACINFO_alt(buf) * 10,
150 DL_ACINFO_utm_zone(buf),
151 DL_ACINFO_course(buf),
152 DL_ACINFO_speed(buf),
153 DL_ACINFO_climb(buf),
154 DL_ACINFO_itow(buf));
157 case DL_ACINFO_LLA: {
159 DL_ACINFO_LLA_lat(buf),
160 DL_ACINFO_LLA_lon(buf),
161 DL_ACINFO_LLA_alt(buf) * 10,
162 DL_ACINFO_LLA_course(buf),
163 DL_ACINFO_LLA_speed(buf),
164 DL_ACINFO_LLA_climb(buf),
165 DL_ACINFO_LLA_itow(buf));
188 if (utm_zone == my_zone) {
196 struct UtmCoor_i utm = {.
east = utm_east, .north = utm_north, .alt =
alt, .zone = utm_zone};
void acInfoCalcPositionUtm_f(uint8_t ac_id)
void lla_of_utm_i(struct LlaCoor_i *lla, struct UtmCoor_i *utm)
Convert a UTM to LLA.
int32_t lon
in degrees*1e7
#define UTM_BFP_OF_REAL(_o, _i)
uint8_t valid_fields
bitfield indicating valid fields (GPS_VALID_x_BIT)
#define LLA_BFP_OF_REAL(_o, _i)
int32_t alt
in millimeters above WGS84 reference ellipsoid
void set_ac_info_lla(uint8_t id, int32_t lat, int32_t lon, int32_t alt, int16_t course, uint16_t gspeed, int16_t climb, uint32_t itow)
Set Aircraft info.
void acInfoCalcVelocityEnu_i(uint8_t ac_id)
uint16_t status
Holds the status bits for all acinfo position and velocity representations.
int32_t north
in centimeters
#define LLA_COPY(_pos1, _pos2)
struct LtpDef_i ned_origin_i
Definition of the local (flat earth) coordinate system.
struct LlaCoor_f lla_pos_f
Position in Latitude, Longitude and Altitude.
void utm_of_lla_i(struct UtmCoor_i *utm, struct LlaCoor_i *lla)
Convert a LLA to UTM.
void acInfoCalcVelocityEnu_f(uint8_t ac_id)
static int32_t wgs84_ellipsoid_to_geoid_i(int32_t lat, int32_t lon)
Get WGS84 ellipsoid/geoid separation.
void acInfoCalcPositionUtm_i(uint8_t ac_id)
bool parse_acinfo_dl(uint8_t *buf)
Parse all datalink or telemetry messages that contain global position of other acs Messages currently...
#define AC_INFO_POS_LLA_I
#define ENU_FLOAT_OF_BFP(_o, _i)
#define SPEEDS_BFP_OF_REAL(_ef, _ei)
struct UtmCoor_f utm_pos_f
Position in UTM coordinates.
#define LLA_FLOAT_OF_BFP(_o, _i)
#define UTM_COPY(_u1, _u2)
void acInfoCalcPositionLla_i(uint8_t ac_id)
void lla_of_utm_f(struct LlaCoor_f *lla, struct UtmCoor_f *utm)
#define AC_INFO_VEL_ENU_I
#define AC_INFO_POS_UTM_F
struct UtmCoor_i utm_pos_i
Position in UTM coordinates.
bool ned_initialized_i
true if local int coordinate frame is initialsed
static void update_geoid_height(void)
Update estimate of the geoid height Requires an available hsml and/or lla measurement,...
#define GPS_VALID_POS_LLA_BIT
void utm_of_lla_f(struct UtmCoor_f *utm, struct LlaCoor_f *lla)
int32_t lat
in degrees*1e7
int32_t east
in centimeters
void set_ac_info_utm(uint8_t id, uint32_t utm_east, uint32_t utm_north, uint32_t alt, uint8_t utm_zone, uint16_t course, uint16_t gspeed, uint16_t climb, uint32_t itow)
Set Aircraft info.
void acInfoCalcPositionEnu_i(uint8_t ac_id)
volatile uint32_t nb_tick
SYS_TIME_TICKS since startup.
float alt
in meters (above WGS84 reference ellipsoid or above MSL)
uint8_t zone
UTM zone number.
Constants UTM (Mercator) projections.
struct EnuCoor_i enu_pos_i
Position in North East Down coordinates.
void enu_of_lla_point_i(struct EnuCoor_i *enu, struct LtpDef_i *def, struct LlaCoor_i *lla)
Convert a point from LLA to local ENU.
#define SPEEDS_FLOAT_OF_BFP(_ef, _ei)
bool utm_initialized_f
True if utm origin (float) coordinate frame is initialsed.
void enu_of_lla_point_f(struct EnuCoor_f *enu, struct LtpDef_f *def, struct LlaCoor_f *lla)
int32_t alt
in millimeters (above WGS84 reference ellipsoid or above MSL)
static struct LlaCoor_f * acInfoGetPositionLla_f(uint8_t ac_id)
Get position from LLA coordinates (float).
struct LtpDef_f ned_origin_f
Definition of the local (flat earth) coordinate system.
#define AC_INFO_POS_ENU_I
#define ENU_OF_UTM_DIFF(_pos, _utm1, _utm2)
float alt
in meters (normally above WGS84 reference ellipsoid)
uint32_t gps_tow_from_sys_ticks(uint32_t sys_ticks)
Convert time in sys_time ticks to GPS time of week.
void traffic_info_init(void)
struct acInfo ti_acs[NB_ACS]
#define AC_INFO_VEL_LOCAL_F
void acInfoCalcPositionEnu_f(uint8_t ac_id)
vector in Latitude, Longitude and Altitude
#define AC_INFO_POS_ENU_F
struct LlaCoor_i lla_pos
position in LLA (lat,lon: deg*1e7; alt: mm over ellipsoid)
int32_t hmsl
height above mean sea level (MSL) in mm
position in UTM coordinates
struct UtmCoor_f utm_origin_f
Definition of the origin of Utm coordinate system.
#define POS_BFP_OF_REAL(_af)
Handling of messages coming from ground and other A/Cs.
void acInfoCalcPositionLla_f(uint8_t ac_id)
struct EnuCoor_f enu_vel_f
speed in North East Down coordinates
static struct LlaCoor_i * acInfoGetPositionLla_i(uint8_t ac_id)
Get position from LLA coordinates (int).
#define AC_INFO_VEL_ENU_F
#define AC_INFO_POS_UTM_I
struct GpsState gps
global GPS state
uint8_t ti_acs_id[NB_ACS_ID]
vector in East North Up coordinates
#define GPS_VALID_HMSL_BIT
struct LlaCoor_i lla_pos_i
Position in Latitude, Longitude and Altitude.
#define UTM_FLOAT_OF_BFP(_o, _i)
#define ENU_BFP_OF_REAL(_o, _i)
static struct UtmCoor_f * acInfoGetPositionUtm_f(uint8_t ac_id)
Get position from UTM coordinates (float).
#define AC_INFO_POS_LLA_F
uint8_t zone
UTM zone number.