|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
34 #include "generated/modules.h"
46 #include "generated/settings.h"
48 #include "pprz_version.h"
55 static uint32_t ap_version = PPRZ_VERSION_INT;
56 static char *ver_desc = PPRZ_VERSION_DESC;
57 pprz_msg_send_AUTOPILOT_VERSION(trans,
dev, AC_ID, &ap_version, strlen(ver_desc), ver_desc);
60 static void send_alive(
struct transport_tx *trans,
struct link_device *
dev)
62 pprz_msg_send_ALIVE(trans,
dev, AC_ID, 16, MD5SUM);
68 pprz_msg_send_ATTITUDE(trans,
dev, AC_ID, &(att->
phi), &(att->
psi), &(att->
theta));
73 PeriodicSendDlValue(trans,
dev);
77 static void send_rc(
struct transport_tx *trans,
struct link_device *
dev)
86 pprz_msg_send_ACTUATORS(trans,
dev, AC_ID , ACTUATORS_NB, actuators);
105 #ifdef POWER_SWITCH_GPIO
107 #ifdef POWER_SWITCH_ENABLE
137 #if USE_GENERATED_AUTOPILOT
152 #if USE_GENERATED_AUTOPILOT
163 #if USE_GENERATED_AUTOPILOT
175 #if USE_GENERATED_AUTOPILOT
202 #if USE_GENERATED_AUTOPILOT
266 #ifdef POWER_SWITCH_GPIO
bool autopilot_get_motors_on(void)
get motors status
void autopilot_clear_settings(void)
clear settings
void autopilot_set_in_flight(bool in_flight)
set in_flight flag
void WEAK autopilot_reset_in_flight_counter(void)
reset in_flight counter actual implementation is firmware dependent
void autopilot_generated_periodic(void)
static struct spektrum_t spektrum
void autopilot_reset_flight_time(void)
reset flight time and launch
void autopilot_static_set_motors_on(bool motors_on)
void autopilot_generated_on_rc_frame(void)
uint16_t flight_time
flight time in seconds
uint8_t mode
current autopilot mode
void autopilot_generated_SetModeHandler(float mode)
AP mode setting handler.
void autopilot_init(void)
Autopilot initialization function.
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
#define POWER_SWITCH_GPIO
void gpio_setup_output(ioportid_t port, uint16_t gpios)
Setup one or more pins of the given GPIO port as outputs.
bool use_rc
enable/disable RC input
void autopilot_SetModeHandler(float mode)
AP mode setting handler.
PPRZ Autopilot structure definition.
void WEAK autopilot_event(void)
AP event call.
static void send_autopilot_version(struct transport_tx *trans, struct link_device *dev)
bool autopilot_in_flight(void)
get in_flight flag
static void gpio_clear(ioportid_t port, uint16_t pin)
Clear a gpio output to low level.
void autopilot_set_power_switch(bool power_switch)
set power switch
void autopilot_send_version(void)
send autopilot version
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
bool motors_on
motor status
struct pprz_autopilot autopilot
Global autopilot structure.
bool autopilot_throttle_killed(void)
get kill status
bool in_flight
in flight status
pprz_t throttle
throttle level as will be displayed in GCS
static const struct usb_device_descriptor dev
static const struct usb_config_descriptor config
bool settings_store_flag
flag for setting feedback.
Architecture independent timing functions.
#define RADIO_CONTROL_NB_CHANNEL
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
void autopilot_generated_set_mode(uint8_t new_autopilot_mode)
bool ground_detected
automatic detection of landing
void WEAK autopilot_send_mode(void)
send autopilot mode actual implementation is firmware dependent
int32_t settings_clear(void)
clear all persistent settings from flash
void autopilot_firmware_init(void)
Init function.
void autopilot_set_motors_on(bool motors_on)
turn motors on/off, eventually depending of the current mode set kill_throttle accordingly FIXME is i...
void autopilot_set_kill_throttle(bool kill)
set kill throttle
void autopilot_generated_set_motors_on(bool motors_on)
void autopilot_periodic(void)
AP periodic call.
void autopilot_static_set_mode(uint8_t new_autopilot_mode)
timer subsystem PPM input on SERVO6 pin actuators pwm(if PWM_USE_TIM1) TIM8 radio_control/ppm(if USE_PPM_TIM8)(non-advanced timers using RCC_APB2) TIM2 adc(if USE_AD_TIM2
void autopilot_store_settings(void)
store settings
static void send_alive(struct transport_tx *trans, struct link_device *dev)
void autopilot_static_periodic(void)
bool autopilot_set_mode(uint8_t new_autopilot_mode)
set autopilot mode
static void send_actuators(struct transport_tx *trans, struct link_device *dev)
void WEAK autopilot_check_in_flight(bool motors_on)
in flight check utility function actual implementation is firmware dependent
uint8_t mode_auto2
FIXME hide this in a private part ?
timer subsystem type(config options) --------------------------------------------(advanced timers using RCC_APB1) TIM1 adc(if USE_AD_TIM1) radio_control/ppm(if USE_PPM_TIM1
void autopilot_static_SetModeHandler(float new_autopilot_mode)
timer subsystem PPM input on SERVO6 pin actuators default radio_control ppm(if USE_PPM_TIM2, PPM input on UART1_RX pin) actuators/pwm(if PWM_USE_TIM2) TIM3 actuators/pwm(if PWM_USE_TIM3
static void send_attitude(struct transport_tx *trans, struct link_device *dev)
static uint8_t mode
mode holds the current sonar mode mode = 0 used at high altitude, uses 16 wave patterns mode = 1 used...
Hardware independent code for commands handling.
uint8_t autopilot_get_mode(void)
get autopilot mode
void autopilot_on_rc_frame(void)
RC frame handler.
static void send_rc(struct transport_tx *trans, struct link_device *dev)
bool power_switch
enable/disable power from power switch (if any)
int32_t settings_store(void)
store settings marked as persistent to flash
static void send_dl_value(struct transport_tx *trans, struct link_device *dev)
static void gpio_set(ioportid_t port, uint16_t pin)
Set a gpio output to high level.
void autopilot_static_on_rc_frame(void)
Function to be called when a message from FBW is available.
bool kill_throttle
allow autopilot to use throttle
#define DefaultPeriodic
Set default periodic telemetry.
bool launch
request launch
bool detect_ground_once
enable automatic detection of ground (one shot)
struct RadioControl radio_control
pprz_t values[RADIO_CONTROL_NB_CHANNEL]