Paparazzi UAS  v5.15_devel-88-gb3ad7fe
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
glide_wing_lock.c File Reference
#include "modules/glide_wing_lock/glide_wing_lock.h"
#include "pprzlink/messages.h"
#include "mcu_periph/uart.h"
#include "subsystems/datalink/downlink.h"
#include "mcu_periph/adc.h"
#include "subsystems/commands.h"
#include "subsystems/radio_control.h"
#include "autopilot.h"
+ Include dependency graph for glide_wing_lock.c:

Go to the source code of this file.

Macros

#define WING_POS_DOWN_THRESH   100
 
#define WING_POS_LOCK_MIN_THRESH   2000
 
#define WING_POS_LOCK_MAX_THRESH   2100
 
#define WING_POS_NOMINAL_THRUST   5000
 
#define WING_POS_LOCK_SWITCH   RADIO_AUX2
 

Functions

void glide_wing_lock_init (void)
 
void glide_wing_lock_event ()
 
void glide_wing_lock_periodic ()
 
void set_rotorcraft_commands (pprz_t *cmd_out, int32_t *cmd_in, bool in_flight, bool motors_on)
 Set Rotorcraft commands. More...
 

Variables

struct adc_buf adcbuf
 
int lock_wings
 

Detailed Description

Author
Kevin van Hecke Locks the wing of an ornicopter so it can glide.

Definition in file glide_wing_lock.c.

Macro Definition Documentation

#define WING_POS_DOWN_THRESH   100

Definition at line 42 of file glide_wing_lock.c.

Referenced by glide_wing_lock_event().

#define WING_POS_LOCK_MAX_THRESH   2100

Definition at line 48 of file glide_wing_lock.c.

Referenced by glide_wing_lock_event().

#define WING_POS_LOCK_MIN_THRESH   2000

Definition at line 45 of file glide_wing_lock.c.

Referenced by glide_wing_lock_event().

#define WING_POS_LOCK_SWITCH   RADIO_AUX2

Definition at line 54 of file glide_wing_lock.c.

Referenced by glide_wing_lock_event().

#define WING_POS_NOMINAL_THRUST   5000

Definition at line 51 of file glide_wing_lock.c.

Referenced by set_rotorcraft_commands().

Function Documentation

void glide_wing_lock_init ( void  )

Definition at line 58 of file glide_wing_lock.c.

References adc_buf_channel(), and adcbuf.

+ Here is the call graph for this function:

void glide_wing_lock_periodic ( void  )
void set_rotorcraft_commands ( pprz_t cmd_out,
int32_t cmd_in,
bool  in_flight,
bool  motors_on 
)

Set Rotorcraft commands.

Get autopilot mode from two 2way switches.

Limit thrust and/or yaw depending of the in_flight and motors_on flag status

A default implementation is provided, but the function can be redefined

Parameters
[out]cmd_outoutput command vector in pprz_t (usually commands array)
in/out]cmd_in input commands to apply, might be affected by in_flight and motors_on param (FIXME really ?)
[in]in_flighttells if rotorcraft is in flight
[in]motors_ontells if motors are running

Set Rotorcraft commands.

RADIO_MODE switch just selectes between MANUAL and AUTO. If not MANUAL, the RADIO_AUTO_MODE switch selects between AUTO1 and AUTO2.

This is mainly a cludge for entry level radios with no three-way switch, but two available two-way switches which can be used.Set Rotorcraft commands. Limit thrust and/or yaw depending of the in_flight and motors_on flag status

Definition at line 107 of file glide_wing_lock.c.

References lock_wings, and WING_POS_NOMINAL_THRUST.

Variable Documentation

struct adc_buf adcbuf
int lock_wings

Definition at line 39 of file glide_wing_lock.c.

Referenced by glide_wing_lock_event(), and set_rotorcraft_commands().