![]() |
Paparazzi UAS
v6.1.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "firmwares/fixedwing/autopilot_firmware.h"
#include "state.h"
#include "firmwares/fixedwing/nav.h"
#include <stdint.h>
#include "modules/datalink/telemetry.h"
#include "generated/settings.h"
#include "firmwares/fixedwing/stabilization/stabilization_attitude.h"
#include <CTRL_TYPE_H>
#include "generated/flight_plan.h"
#include "generated/airframe.h"
Go to the source code of this file.
Macros | |
#define | CATASTROPHIC_BAT_KILL_DELAY 5 |
Maximum time allowed for catastrophic battery level before going into kill mode. More... | |
#define | KILL_MODE_DISTANCE (1.5*MAX_DIST_FROM_HOME) |
Maximum distance from HOME waypoint before going into kill mode. More... | |
#define | MIN_SPEED_FOR_TAKEOFF 5. |
Default minimal speed for takeoff in m/s. More... | |
Functions | |
static void | send_mode (struct transport_tx *trans, struct link_device *dev) |
static void | send_estimator (struct transport_tx *trans, struct link_device *dev) |
static void | send_energy (struct transport_tx *trans, struct link_device *dev) |
static void | send_desired (struct transport_tx *trans, struct link_device *dev) |
static void | send_airspeed (struct transport_tx *trans, struct link_device *dev) |
void | autopilot_send_mode (void) |
Report autopilot mode on default downlink channel. More... | |
void | autopilot_firmware_init (void) |
Init function. More... | |
void | monitor_task (void) |
monitor stuff run at 1Hz More... | |
Variables | |
struct Electrical | ap_electrical |
uint8_t | lateral_mode |
uint8_t | mcu1_status |
Second MCU status (FBW part) More... | |
uint8_t | rc_settings_mode = 0 |
Fixedwing specific autopilot interface and initialization
Definition in file autopilot_firmware.c.
#define CATASTROPHIC_BAT_KILL_DELAY 5 |
Maximum time allowed for catastrophic battery level before going into kill mode.
Definition at line 147 of file autopilot_firmware.c.
#define KILL_MODE_DISTANCE (1.5*MAX_DIST_FROM_HOME) |
Maximum distance from HOME waypoint before going into kill mode.
Definition at line 152 of file autopilot_firmware.c.
#define MIN_SPEED_FOR_TAKEOFF 5. |
Default minimal speed for takeoff in m/s.
Definition at line 157 of file autopilot_firmware.c.
void autopilot_firmware_init | ( | void | ) |
Init function.
Definition at line 114 of file autopilot_firmware.c.
Referenced by autopilot_init().
void autopilot_send_mode | ( | void | ) |
Report autopilot mode on default downlink channel.
Report autopilot mode on default downlink channel.
Definition at line 106 of file autopilot_firmware.c.
References DefaultChannel, DefaultDevice, and send_mode().
void monitor_task | ( | void | ) |
monitor stuff run at 1Hz
monitoring task should be called at 1Hz
Definition at line 161 of file autopilot_firmware.c.
References ap_electrical, autopilot, CATASTROPHIC_BAT_KILL_DELAY, DefaultChannel, DefaultDevice, dist2_to_home, pprz_autopilot::flight_time, KILL_MODE_DISTANCE, pprz_autopilot::kill_throttle, pprz_autopilot::launch, MIN_SPEED_FOR_TAKEOFF, sys_time::nb_sec, Square, stateGetHorizontalSpeedNorm_f(), and Electrical::vsupply.
|
static |
Definition at line 91 of file autopilot_firmware.c.
References dev, stateGetAirspeed_f(), v_ctl_auto_airspeed_controlled, v_ctl_auto_airspeed_setpoint, and v_ctl_auto_groundspeed_setpoint.
Referenced by autopilot_firmware_init().
|
static |
Definition at line 80 of file autopilot_firmware.c.
References desired_x, desired_y, dev, h_ctl_course_setpoint, h_ctl_pitch_loop_setpoint, h_ctl_roll_setpoint, v_ctl_altitude_setpoint, v_ctl_auto_airspeed_setpoint, and v_ctl_climb_setpoint.
Referenced by autopilot_firmware_init().
|
static |
Definition at line 69 of file autopilot_firmware.c.
References ap_electrical, autopilot, Electrical::charge, Electrical::current, dev, Electrical::energy, MAX_PPRZ, pprz_autopilot::throttle, and Electrical::vsupply.
Referenced by autopilot_firmware_init().
|
static |
Definition at line 63 of file autopilot_firmware.c.
References dev, stateGetPositionUtm_f(), and stateGetSpeedEnu_f().
Referenced by autopilot_firmware_init().
|
static |
Definition at line 57 of file autopilot_firmware.c.
References autopilot, dev, horizontal_mode, lateral_mode, mcu1_status, pprz_autopilot::mode, rc_settings_mode, and v_ctl_mode.
Referenced by autopilot_firmware_init(), and autopilot_send_mode().
struct Electrical ap_electrical |
Definition at line 36 of file autopilot_firmware.c.
Referenced by attitude_loop(), autopilot_firmware_init(), autopilot_generated_on_rc_frame(), autopilot_static_on_rc_frame(), monitor_task(), send_energy(), and v_ctl_guidance_loop().
uint8_t lateral_mode |
Definition at line 38 of file autopilot_firmware.c.
Referenced by autopilot_static_init(), collective_tracking_control(), fly_to_xy(), gvf_control_2D(), gvf_parametric_low_level_control_2D(), gvf_parametric_low_level_control_3D(), h_ctl_guidance_loop(), nav_without_gps(), navigation_task(), send_mode(), and v_ctl_landing_loop().
uint8_t mcu1_status |
Second MCU status (FBW part)
Definition at line 39 of file autopilot_firmware.c.
Referenced by mcu1_status_update(), and send_mode().
uint8_t rc_settings_mode = 0 |
Definition at line 54 of file autopilot_firmware.c.
Referenced by send_mode().