31 #include "pprzlink/messages.h"
32 #include "pprzlink/dl_protocol.h"
34 #if defined NAV || defined WIND_INFO
48 #define MOfMM(_x) (((float)(_x))/1000.)
52 uint8_t msg_id = IdOfPprzMsg(buf);
59 if (DL_BLOCK_ac_id(buf) != AC_ID) {
break; }
66 if (DL_MOVE_WP_ac_id(buf) != AC_ID) {
break; }
67 uint8_t wp_id = DL_MOVE_WP_wp_id(buf);
71 lla.
lat = RadOfDeg((
float)(DL_MOVE_WP_lat(buf) / 1e7));
72 lla.
lon = RadOfDeg((
float)(DL_MOVE_WP_lon(buf) / 1e7));
73 lla.
alt =
MOfMM(DL_MOVE_WP_alt(buf));
90 if (DL_WIND_INFO_ac_id(buf) != AC_ID) {
break; }
91 uint8_t flags = DL_WIND_INFO_flags(buf);
94 if (bit_is_set(flags, 0)) {
95 wind.
x = DL_WIND_INFO_north(buf);
96 wind.
y = DL_WIND_INFO_east(buf);
99 if (bit_is_set(flags, 1)) {
100 upwind = DL_WIND_INFO_up(buf);
104 if (bit_is_set(flags, 2)) {
110 pprz_msg_send_WIND_INFO_RET(trans,
dev, AC_ID, &flags, &wind.
y, &wind.
x, &upwind, &airspeed);
118 case DL_HITL_INFRARED: {
128 if (gps_msg_received) {
131 ubx_class = DL_HITL_UBX_class(buf);
132 ubx_id = DL_HITL_UBX_id(buf);
133 uint8_t l = DL_HITL_UBX_ubx_payload_length(buf);
134 uint8_t *ubx_payload = DL_HITL_UBX_ubx_payload(buf);
135 memcpy(ubx_msg_buf, ubx_payload, l);
136 gps_msg_received =
true;
float alt
in meters (above WGS84 reference ellipsoid or above MSL)
Handling of messages coming from ground and other A/Cs.
static float stateGetAirspeed_f(void)
Get airspeed (float).
void nav_move_waypoint(uint8_t wp_id, float ux, float uy, float alt)
Move a waypoint to given UTM coordinates.
position in UTM coordinates Units: meters
void firmware_parse_msg(struct link_device *dev, struct transport_tx *trans, uint8_t *buf)
Firmware specfic msg handler.
Paparazzi floating point math for geodetic calculations.
vector in Latitude, Longitude and Altitude
Device independent GPS code (interface)
uint8_t zone
UTM zone number.
static const struct usb_device_descriptor dev
float alt
in meters (normally above WGS84 reference ellipsoid)
static void stateSetVerticalWindspeed_f(float v_windspeed)
Set vertical windspeed (float).
#define SEND_NAVIGATION(_trans, _dev)
API to get/set the generic vehicle states.
struct point waypoints[NB_WAYPOINT]
size == nb_waypoint, waypoint 0 is a dummy waypoint
static void stateSetAirspeed_f(float airspeed)
Set airspeed (float).
Common code for AP and FBW telemetry.
Fixedwing Navigation library.
void nav_goto_block(uint8_t b)
void utm_of_lla_f(struct UtmCoor_f *utm, struct LlaCoor_f *lla)
static void stateSetHorizontalWindspeed_f(struct FloatVect2 *h_windspeed)
Set horizontal windspeed (float).