29 #define MODULES_DATALINK_C
33 #include "generated/modules.h"
35 #include "generated/settings.h"
38 #include "dl_protocol.h"
41 #if defined RADIO_CONTROL && defined RADIO_CONTROL_TYPE_DATALINK
48 #if defined GPS_DATALINK
59 #define IdOfMsg(x) (x[1])
62 bool_t datalink_enabled =
TRUE;
77 if (DL_SETTING_ac_id(
dl_buffer) != AC_ID) {
break; }
85 case DL_GET_SETTING : {
86 if (DL_GET_SETTING_ac_id(
dl_buffer) != AC_ID) {
break; }
88 float val = settings_get_value(i);
93 #if defined USE_NAVIGATION
95 if (DL_BLOCK_ac_id(
dl_buffer) != AC_ID) {
break; }
102 if (ac_id != AC_ID) {
break; }
118 #ifdef RADIO_CONTROL_TYPE_DATALINK
120 #ifdef RADIO_CONTROL_DATALINK_LED
129 if (DL_RC_4CH_ac_id(
dl_buffer) == AC_ID) {
130 #ifdef RADIO_CONTROL_DATALINK_LED
140 #endif // RADIO_CONTROL_TYPE_DATALINK
141 #if defined GPS_DATALINK
142 #ifdef GPS_USE_DATALINK_SMALL
143 case DL_REMOTE_GPS_SMALL :
145 if (DL_REMOTE_GPS_SMALL_ac_id(
dl_buffer) != AC_ID) {
149 parse_gps_datalink_small(
152 DL_REMOTE_GPS_SMALL_speed_xy(
dl_buffer));
157 if (DL_REMOTE_GPS_ac_id(
dl_buffer) != AC_ID) {
break; }
179 if (DL_GPS_INJECT_ac_id(
dl_buffer) != AC_ID) {
break; }
190 case DL_GUIDED_SETPOINT_NED:
191 if (DL_GUIDED_SETPOINT_NED_ac_id(
dl_buffer) != AC_ID) {
break; }
193 float x = DL_GUIDED_SETPOINT_NED_x(
dl_buffer);
194 float y = DL_GUIDED_SETPOINT_NED_y(
dl_buffer);
195 float z = DL_GUIDED_SETPOINT_NED_z(
dl_buffer);
196 float yaw = DL_GUIDED_SETPOINT_NED_yaw(
dl_buffer);
220 modules_parse_datalink(msg_id);
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
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 dl_parse_msg(void)
Should be called when chars are available in dl_buffer.
Rotorcraft navigation functions.
Handling of messages coming from ground and other A/Cs.
void parse_rc_3ch_datalink(uint8_t throttle_mode, int8_t roll, int8_t pitch)
Decode datalink message to get rc values with RC_3CH message Mode and throttle are merge in the same ...
vector in Latitude, Longitude and Altitude
int32_t hmsl
Height above mean sea level in mm.
int32_t alt
in millimeters above WGS84 reference ellipsoid
void waypoint_move_lla(uint8_t wp_id, struct LlaCoor_i *lla)
bool_t autopilot_guided_goto_ned(float x, float y, float z, float heading)
Set position and heading setpoints in GUIDED mode.
bool_t autopilot_guided_goto_ned_relative(float dx, float dy, float dz, float dyaw)
Set position and heading setpoints wrt.
Device independent GPS code (interface)
static bool_t stateIsLocalCoordinateValid(void)
Test if local coordinates are valid.
struct LlaCoor_i lla
Reference point in lla.
int32_t lon
in degrees*1e7
Paparazzi fixed point math for geodetic calculations.
struct LtpDef_i ned_origin_i
Definition of the local (flat earth) coordinate system.
#define DefaultChannel
SITL.
GPS system based on datalink.
API to get/set the generic vehicle states.
Common code for AP and FBW telemetry.
uint8_t dl_buffer[MSG_SIZE]
arch independent LED (Light Emitting Diodes) API
bool_t autopilot_guided_goto_body_relative(float dx, float dy, float dz, float dyaw)
Set position and heading setpoints wrt.
void gps_inject_data(uint8_t packet_id, uint8_t length, uint8_t *data)
Override the default GPS packet injector to inject the data trough UART.
void parse_rc_4ch_datalink(uint8_t mode, uint8_t throttle, int8_t roll, int8_t pitch, int8_t yaw)
Decode datalink message to get rc values with RC_4CH message.
int32_t lat
in degrees*1e7
void nav_goto_block(uint8_t b)