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 #include "autopilot.h"
54 #define JoystickHandeDatalink(_roll_int8, _pitch_int8, _throttle_int8) { \
55 if (pprz_mode == PPRZ_MODE_AUTO2 && nav_block == joystick_block) { \
56 h_ctl_roll_setpoint = _roll_int8 * (AUTO1_MAX_ROLL / 0x7f); \
57 h_ctl_pitch_setpoint = _pitch_int8 * (AUTO1_MAX_PITCH / 0x7f); \
58 v_ctl_throttle_setpoint = (MAX_PPRZ/0x7f) * _throttle_int8; \
72 if (DL_BLOCK_ac_id(
dl_buffer) != AC_ID) {
break; }
79 if (DL_MOVE_WP_ac_id(
dl_buffer) != AC_ID) {
break; }
84 lla.
lat = RadOfDeg((
float)(DL_MOVE_WP_lat(
dl_buffer) / 1e7));
85 lla.
lon = RadOfDeg((
float)(DL_MOVE_WP_lon(
dl_buffer) / 1e7));
103 if (DL_WIND_INFO_ac_id(
dl_buffer) != AC_ID) {
break; }
107 if (bit_is_set(flags, 0)) {
112 if (bit_is_set(flags, 1)) {
117 if (bit_is_set(flags, 2)) {
131 case DL_HITL_INFRARED: {
141 if (gps_msg_received) {
144 ubx_class = DL_HITL_UBX_class(
dl_buffer);
148 memcpy(ubx_msg_buf, ubx_payload, l);
149 gps_msg_received =
true;
156 case DL_JOYSTICK_RAW: {
157 if (DL_JOYSTICK_RAW_ac_id(
dl_buffer) == AC_ID) {
158 JoystickHandeDatalink(DL_JOYSTICK_RAW_roll(
dl_buffer),
164 #endif // USE_JOYSTICK
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
Fixed wing horizontal control.
Paparazzi floating point math for geodetic calculations.
vector in Latitude, Longitude and Altitude
Device independent GPS code (interface)
void firmware_parse_msg(void)
Firmware specfic msg handler.
uint8_t zone
UTM zone number.
#define DefaultChannel
SITL.
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.
uint8_t dl_buffer[MSG_SIZE]
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).