|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
31 #include "generated/modules.h"
42 #if NO_GPS_NEEDED_FOR_NAV
43 #define GpsIsLost() FALSE
45 #define GpsIsLost() TRUE
56 #ifndef AUTOPILOT_IN_FLIGHT_TIME
57 #define AUTOPILOT_IN_FLIGHT_TIME 20
61 #ifndef AUTOPILOT_IN_FLIGHT_MIN_SPEED
62 #define AUTOPILOT_IN_FLIGHT_MIN_SPEED 0.2
66 #ifndef AUTOPILOT_IN_FLIGHT_MIN_ACCEL
67 #define AUTOPILOT_IN_FLIGHT_MIN_ACCEL 2.0
71 #ifndef AUTOPILOT_IN_FLIGHT_MIN_THRUST
72 #define AUTOPILOT_IN_FLIGHT_MIN_THRUST 500
76 #ifndef THRESHOLD_GROUND_DETECT
77 #define THRESHOLD_GROUND_DETECT 25.0
101 pprz_msg_send_ROTORCRAFT_STATUS(trans,
dev, AC_ID,
102 &imu_nb_err, &_motor_nb_err,
113 pprz_msg_send_ENERGY(trans,
dev, AC_ID,
117 static void send_fp(
struct transport_tx *trans,
struct link_device *
dev)
122 #
if GUIDANCE_INDI_HYBRID
129 pprz_msg_send_ROTORCRAFT_FP(trans,
dev, AC_ID,
155 pprz_msg_send_ROTORCRAFT_FP_MIN(trans,
dev, AC_ID,
165 #ifdef RADIO_KILL_SWITCH
170 pprz_msg_send_ROTORCRAFT_RADIO_CONTROL(trans,
dev, AC_ID,
183 pprz_msg_send_ROTORCRAFT_CMD(trans,
dev, AC_ID,
#define AUTOPILOT_IN_FLIGHT_MIN_ACCEL
minimum vertical acceleration for in_flight condition in m/s^2
vector in North East Down coordinates Units: meters
static void send_status(struct transport_tx *trans, struct link_device *dev)
static void send_fp_min(struct transport_tx *trans, struct link_device *dev)
static void send_rotorcraft_rc(struct transport_tx *trans, struct link_device *dev)
int32_t guidance_v_z_sp
altitude setpoint in meters (input).
static struct NedCoor_f * stateGetAccelNed_f(void)
Get acceleration in NED coordinates (float).
uint16_t flight_time
flight time in seconds
uint8_t mode
current autopilot mode
static struct EnuCoor_i * stateGetPositionEnu_i(void)
Get position in local ENU coordinates (int).
void autopilot_reset_in_flight_counter(void)
reset in_flight counter
struct Int32Vect2 pos
horizontal position setpoint in NED.
#define THRESHOLD_GROUND_DETECT
Z-acceleration threshold to detect ground in m/s^2.
float vsupply
supply voltage in V
#define AUTOPILOT_IN_FLIGHT_TIME
time steps for in_flight detection (at 20Hz, so 20=1second)
static void send_energy(struct transport_tx *trans, struct link_device *dev)
static struct NedCoor_f * stateGetSpeedNed_f(void)
Get ground speed in local NED coordinates (float).
float charge
consumed electric charge in Ah
#define AUTOPILOT_IN_FLIGHT_MIN_SPEED
minimum vertical speed for in_flight condition in m/s
int32_t psi
in rad with INT32_ANGLE_FRAC
bool motors_on
motor status
static struct EnuCoor_i * stateGetSpeedEnu_i(void)
Get ground speed in local ENU coordinates (int).
Device independent GPS code (interface)
struct pprz_autopilot autopilot
Global autopilot structure.
bool in_flight
in flight status
static struct FloatQuat * stateGetNedToBodyQuat_f(void)
Get vehicle body attitude quaternion (float).
#define ANGLE_BFP_OF_REAL(_af)
pprz_t throttle
throttle level as will be displayed in GCS
static const struct usb_device_descriptor dev
uint8_t autopilot_mode_auto2
uint16_t gspeed
norm of 2d ground speed in cm/s
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
bool ground_detected
automatic detection of landing
void autopilot_event(void)
autopilot event function
struct HorizontalGuidanceSetpoint sp
setpoints
static void send_fp(struct transport_tx *trans, struct link_device *dev)
void autopilot_firmware_init(void)
Init function.
#define AUTOPILOT_IN_FLIGHT_MIN_THRUST
minimum thrust for in_flight condition in pprz_t units (max = 9600)
static void send_rotorcraft_cmd(struct transport_tx *trans, struct link_device *dev)
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
void float_eulers_of_quat_zxy(struct FloatEulers *e, struct FloatQuat *q)
euler rotation 'ZXY' This rotation order is useful if you need 90 deg pitch
void autopilot_check_in_flight(bool motors_on)
in flight check utility function
static uint32_t autopilot_in_flight_counter
int32_t stabilization_cmd[COMMANDS_NB]
Stabilization commands.
struct HorizontalGuidance guidance_h
static struct Int32Eulers * stateGetNedToBodyEulers_i(void)
Get vehicle body attitude euler angles (int).
struct Electrical electrical
struct FloatEulers eulers_zxy
state eulers in zxy order
volatile uint32_t nb_sec
full seconds since startup
float energy
consumed energy in Wh
#define RADIO_KILL_SWITCH
struct GpsState gps
global GPS state
#define DefaultPeriodic
Set default periodic telemetry.
struct MotorMixing motor_mixing
uint8_t arming_status
arming status
bool detect_ground_once
enable automatic detection of ground (one shot)
float current
current in A
struct RadioControl radio_control
pprz_t values[RADIO_CONTROL_NB_CHANNEL]