28 #include "pprzlink/messages.h"
41 #ifndef WING_POS_DOWN_THRESH
42 #define WING_POS_DOWN_THRESH 100
44 #ifndef WING_POS_LOCK_MIN_THRESH
45 #define WING_POS_LOCK_MIN_THRESH 2000
47 #ifndef WING_POS_LOCK_MAX_THRESH
48 #define WING_POS_LOCK_MAX_THRESH 2100
50 #ifndef WING_POS_NOMINAL_THRUST
51 #define WING_POS_NOMINAL_THRUST 5000
53 #ifndef WING_POS_LOCK_SWITCH
54 #define WING_POS_LOCK_SWITCH RADIO_AUX2
65 static int lockstate = 0;
109 if (!(in_flight)) { cmd_in[COMMAND_YAW] = 0; }
110 if (!(motors_on)) { cmd_in[COMMAND_THRUST] = 0; }
111 cmd_out[COMMAND_ROLL] = cmd_in[COMMAND_ROLL];
112 cmd_out[COMMAND_PITCH] = cmd_in[COMMAND_PITCH];
113 cmd_out[COMMAND_YAW] = cmd_in[COMMAND_YAW];
114 cmd_out[COMMAND_THRUST] = cmd_in[COMMAND_THRUST];
116 if (
lock_wings == 1 && motors_on && cmd_out[COMMAND_THRUST] > 0) {
119 cmd_out[COMMAND_THRUST] = 0;
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
void glide_wing_lock_event()
#define WING_POS_LOCK_SWITCH
void adc_buf_channel(uint8_t adc_channel, struct adc_buf *s, uint8_t av_nb_sample)
Link between ChibiOS ADC drivers and Paparazzi adc_buffers.
pprz_t values[RADIO_CONTROL_NB_CHANNEL]
arch independent ADC (Analog to Digital Converter) API
Generic interface for all ADC hardware drivers, independent from microcontroller architecture.
Hardware independent code for commands handling.
struct RadioControl radio_control
void set_rotorcraft_commands(pprz_t *cmd_out, int32_t *cmd_in, bool in_flight, bool motors_on)
Set Rotorcraft commands.
#define WING_POS_NOMINAL_THRUST
Core autopilot interface common to all firmwares.
#define WING_POS_LOCK_MIN_THRESH
#define WING_POS_LOCK_MAX_THRESH
void glide_wing_lock_init(void)
Common code for AP and FBW telemetry.
#define WING_POS_DOWN_THRESH
void glide_wing_lock_periodic()