 |
Paparazzi UAS
v6.2_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
35 #include "generated/flight_plan.h"
50 #define RC_LOST_MODE AP_MODE_HOME
55 #ifdef AHRS_TRIGGERED_ATTITUDE_LOOP
59 static void new_att_cb(
uint8_t sender_id __attribute__((unused)),
60 uint32_t stamp __attribute__((unused)),
61 struct Int32Rates *gyro __attribute__((unused)))
87 #ifdef AHRS_TRIGGERED_ATTITUDE_LOOP
88 AbiBindMsgIMU_GYRO_INT32(
ABI_BROADCAST, &new_att_ev, &new_att_cb);
103 #ifdef SetAutoCommandsFromRC
105 #elif defined RADIO_YAW && defined COMMAND_YAW
109 #if defined RADIO_CONTROL || defined RADIO_CONTROL_AUTO1
119 #if H_CTL_YAW_LOOP && defined RADIO_YAW
178 #if DOWNLINK && !defined PERIOD_NAVIGATION_Ap_0 // If not sent periodically (in default 0 mode)
192 #ifdef H_CTL_RATE_LOOP
219 #if defined RADIO_CONTROL || defined RADIO_CONTROL_AUTO1
224 mode_changed |= pprz_mode_changed;
225 #if defined RADIO_CALIB && defined RADIO_CONTROL_SETTINGS
227 rc_settings(calib_mode_changed || pprz_mode_changed);
228 mode_changed |= calib_mode_changed;
244 #ifdef RADIO_KILL_SWITCH
260 #endif // RADIO_CONTROL
262 #if USE_GPS && (defined FAILSAFE_DELAY_WITHOUT_GPS)
266 static bool gps_lost =
false;
279 }
else if (gps_lost) {
308 #if CTRL_VERTICAL_LANDING
321 #if CTRL_VERTICAL_LANDING
325 #if defined V_CTL_THROTTLE_IDLE
329 #ifdef V_CTL_POWER_CTL_BAT_NOMINAL
360 #if defined RADIO_CONTROL || defined RADIO_CONTROL_AUTO1
369 #ifndef RADIO_AUTO_MODE
375 INFO(
"Using RADIO_AUTO_MODE to switch between AUTO1 and AUTO2.")
393 #endif // RADIO_AUTO_MODE
398 #else // not RADIO_CONTROL
static uint8_t pprz_mode_update(void)
Update paparazzi mode from RC.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
static pprz_t radio_control_get(uint8_t idx)
Get a radio control channel value.
void common_nav_periodic_task()
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
#define FLOAT_OF_PPRZ(pprz, center, travel)
pprz_t to float with saturation
#define V_CTL_MODE_AUTO_ALT
#define AP_COMMAND_SET_PITCH(_pitch)
void autopilot_static_set_motors_on(bool motors_on)
#define LATERAL_MODE_MANUAL
#define RADIO_KILL_SWITCH
uint16_t flight_time
flight time in seconds
uint8_t mode
current autopilot mode
Event structure to store callbacks in a linked list.
void autopilot_failsafe_checks(void)
Failsafe checks.
void autopilot_static_init(void)
Static autopilot API.
#define RADIO_ROLL
Redefining RADIO_* Do not use with radio.h (ppm rc)
pprz_t commands[COMMANDS_NB]
void WEAK autopilot_event(void)
AP event call.
#define AP_MODE_OF_PULSE(pprz)
Get mode from pulse.
void nav_home(void)
Home mode navigation (circle around HOME)
float vsupply
supply voltage in V
float h_ctl_roll_setpoint
#define UNLOCKED_HOME_MODE
static bool datalink_lost(void)
bool motors_on
motor status
void h_ctl_course_loop(void)
Device independent GPS code (interface)
struct pprz_autopilot autopilot
Global autopilot structure.
#define AP_COMMAND_SET_YAW(_yaw)
void h_ctl_attitude_loop(void)
static bool higher_than_max_altitude(void)
void WEAK autopilot_send_mode(void)
send autopilot mode actual implementation is firmware dependent
pprz_t v_ctl_throttle_slewed
uint32_t last_3dfix_time
cpu time in sec at last valid 3D fix
#define AP_COMMAND_SET_THROTTLE(_throttle)
#define AP_COMMAND_SET_CL(_cl)
#define AP_COMMAND_SET_ROLL(_roll)
AP command setter macros for usual commands.
void v_ctl_altitude_loop(void)
outer loop
Common code for AP and FBW telemetry.
void navigation_task(void)
Compute desired_course.
void autopilot_set_kill_throttle(bool kill)
set kill throttle
#define V_CTL_MODE_AUTO_THROTTLE
#define THROTTLE_THRESHOLD_TAKEOFF
Takeoff detection threshold from throttle.
pprz_t v_ctl_throttle_setpoint
void autopilot_static_set_mode(uint8_t new_autopilot_mode)
pprz_t h_ctl_elevator_setpoint
#define AP_MODE_GPS_OUT_OF_ORDER
#define SEND_NAVIGATION(_trans, _dev)
void autopilot_static_periodic(void)
void v_ctl_throttle_slew(void)
Computes slewed throttle from throttle setpoint called at 20Hz.
void v_ctl_climb_loop(void)
Auto-throttle inner loop.
#define LATERAL_MODE_COURSE
bool autopilot_set_mode(uint8_t new_autopilot_mode)
set autopilot mode
#define RC_LOST_MODE
mode to enter when RC is lost in AP_MODE_MANUAL or AP_MODE_AUTO1
void autopilot_static_SetModeHandler(float new_autopilot_mode)
#define V_CTL_MODE_LANDING
void nav_periodic_task(void)
Navigation main: call to the code generated from the XML flight plan.
#define AP_MODE_MANUAL
AP modes.
float h_ctl_pitch_setpoint
pprz_t h_ctl_aileron_setpoint
struct Electrical electrical
uint8_t autopilot_get_mode(void)
get autopilot mode
volatile uint32_t nb_sec
full seconds since startup
float v_ctl_pitch_setpoint
pprz_t nav_throttle_setpoint
void v_ctl_landing_loop(void)
void autopilot_static_on_rc_frame(void)
Function to be called when a message from FBW is available.
#define V_CTL_MODE_AUTO_CLIMB
#define ABI_BROADCAST
Broadcast address.
volatile uint8_t new_ins_attitude
struct GpsState gps
global GPS state
bool kill_throttle
allow autopilot to use throttle
void rc_settings(bool mode_changed)
Includes generated code from tuning_rc.xml.
bool launch
request launch
#define RadioControlIsLost()
void nav_without_gps(void)
Failsafe navigation without position estimation.
struct RadioControl radio_control
pprz_t values[RADIO_CONTROL_NB_CHANNEL]