Paparazzi UAS
v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
|
Fixedwing autopilot modes (static implementation). More...
#include "autopilot.h"
Go to the source code of this file.
Macros | |
#define | AP_MODE_MANUAL 0 |
AP modes. More... | |
#define | AP_MODE_AUTO1 1 |
#define | AP_MODE_AUTO2 2 |
#define | AP_MODE_HOME 3 |
#define | AP_MODE_GPS_OUT_OF_ORDER 4 |
#define | AP_MODE_NB 5 |
#define | CONTROL_FREQUENCY 60 |
#define | NAVIGATION_FREQUENCY 4 |
Functions | |
void | autopilot_static_init (void) |
Static autopilot functions. More... | |
void | autopilot_static_periodic (void) |
void | autopilot_static_on_rc_frame (void) |
Function to be called when a message from FBW is available. More... | |
void | autopilot_static_set_mode (uint8_t new_autopilot_mode) |
void | autopilot_static_SetModeHandler (float new_autopilot_mode) |
AP mode setting handler. More... | |
void | autopilot_static_set_motors_on (bool motors_on) |
void | navigation_task (void) |
Control loops FIXME should be somewhere else. More... | |
void | attitude_loop (void) |
Fixedwing autopilot modes (static implementation).
Definition in file autopilot_static.h.
#define AP_MODE_AUTO1 1 |
Definition at line 37 of file autopilot_static.h.
Referenced by autopilot_static_on_rc_frame(), cam_periodic(), mavlink_send_heartbeat(), periodic_auto1_commands(), pprz_mode_update(), and takeoff_detect_periodic().
#define AP_MODE_AUTO2 2 |
Definition at line 38 of file autopilot_static.h.
Referenced by attitude_loop(), autopilot_static_init(), autopilot_static_on_rc_frame(), cam_periodic(), distributed_circular(), gvf_control_2D(), mavlink_send_heartbeat(), navigation_task(), pprz_mode_update(), takeoff_detect_periodic(), and vPoint().
#define AP_MODE_GPS_OUT_OF_ORDER 4 |
Definition at line 40 of file autopilot_static.h.
Referenced by autopilot_static_on_rc_frame(), navigation_task(), and pprz_mode_update().
#define AP_MODE_HOME 3 |
Definition at line 39 of file autopilot_static.h.
Referenced by autopilot_static_on_rc_frame(), autopilot_static_periodic(), autopilot_static_set_mode(), autopilot_static_SetModeHandler(), failsafe_check(), mavlink_send_heartbeat(), navigation_task(), and pprz_mode_update().
#define AP_MODE_MANUAL 0 |
AP modes.
Definition at line 36 of file autopilot_static.h.
Referenced by autopilot_static_on_rc_frame(), h_ctl_pitch_loop(), h_ctl_roll_loop(), mavlink_send_heartbeat(), pprz_mode_update(), v_ctl_set_pitch(), and v_ctl_set_throttle().
#define AP_MODE_NB 5 |
Definition at line 41 of file autopilot_static.h.
#define CONTROL_FREQUENCY 60 |
Definition at line 67 of file autopilot_static.h.
Referenced by init_ap(), and v_ctl_landing_loop().
#define NAVIGATION_FREQUENCY 4 |
Definition at line 72 of file autopilot_static.h.
Referenced by init_ap().
void attitude_loop | ( | void | ) |
Definition at line 276 of file autopilot_static.c.
References AP_MODE_AUTO2, ap_state, autopilot, autopilot_get_mode(), pprz_autopilot::flight_time, h_ctl_aileron_setpoint, h_ctl_attitude_loop(), h_ctl_elevator_setpoint, h_ctl_pitch_setpoint, inter_mcu_received_ap, pprz_autopilot::kill_throttle, pprz_autopilot::launch, link_mcu_send(), MAX_PPRZ, nav_pitch, nav_throttle_setpoint, PPRZ_MUTEX_LOCK, PPRZ_MUTEX_UNLOCK, TRIM_PPRZ, TRIM_UPPRZ, v_ctl_climb_loop(), v_ctl_landing_loop(), v_ctl_mode, V_CTL_MODE_AUTO_CLIMB, V_CTL_MODE_AUTO_THROTTLE, V_CTL_MODE_LANDING, v_ctl_pitch_setpoint, v_ctl_throttle_setpoint, v_ctl_throttle_slew(), v_ctl_throttle_slewed, and vsupply.
Referenced by autopilot_static_periodic(), handle_periodic_tasks_ap(), and sim_periodic_task().
void autopilot_static_init | ( | void | ) |
Static autopilot functions.
Static autopilot functions.
Definition at line 90 of file autopilot_static.c.
void autopilot_static_on_rc_frame | ( | void | ) |
Function to be called when a message from FBW is available.
In AUTO1 mode, compute roll setpoint and pitch setpoint from RADIO_ROLL and RADIO_PITCH
Roll is bounded between [-AUTO1_MAX_ROLL;AUTO1_MAX_ROLL]
Pitch is bounded between [-AUTO1_MAX_PITCH;AUTO1_MAX_PITCH]
Else asynchronously set by h_ctl_course_loop()
In AUTO1, throttle comes from RADIO_THROTTLE In MANUAL, the value is copied to get it in the telemetry
else asynchronously set by v_ctl_climb_loop();
Definition at line 112 of file autopilot_static.c.
void autopilot_static_periodic | ( | void | ) |
Definition at line 104 of file autopilot_static.c.
void autopilot_static_set_mode | ( | uint8_t | new_autopilot_mode | ) |
Definition at line 188 of file autopilot_static.c.
void autopilot_static_set_motors_on | ( | bool | motors_on | ) |
Definition at line 200 of file autopilot_static.c.
void autopilot_static_SetModeHandler | ( | float | mode | ) |
AP mode setting handler.
Checks RC status before calling autopilot_static_set_mode function
Definition at line 195 of file autopilot_static.c.
void navigation_task | ( | void | ) |
Control loops FIXME should be somewhere else.
Control loops FIXME should be somewhere else.
Definition at line 212 of file autopilot_static.c.
References AP_MODE_AUTO2, AP_MODE_GPS_OUT_OF_ORDER, AP_MODE_HOME, autopilot, autopilot_get_mode(), autopilot_send_mode(), autopilot_set_mode(), callTCAS(), common_nav_periodic_task_4Hz(), DefaultChannel, DefaultDevice, gps_lost, h_ctl_auto1_rate, h_ctl_course_loop(), lateral_mode, LATERAL_MODE_COURSE, pprz_autopilot::launch, nav_home(), nav_periodic_task(), nav_without_gps(), SEND_NAVIGATION, v_ctl_altitude_loop(), v_ctl_mode, and V_CTL_MODE_AUTO_ALT.
Referenced by handle_periodic_tasks_ap(), and sim_nav_task().