 |
Paparazzi UAS
v6.2_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
34 #include "generated/modules.h"
44 #include "generated/settings.h"
46 #include "pprz_version.h"
50 #ifndef AUTOPILOT_RC_ID
51 #define AUTOPILOT_RC_ID ABI_BROADCAST
65 static uint32_t ap_version = PPRZ_VERSION_INT;
66 static char *ver_desc = PPRZ_VERSION_DESC;
67 pprz_msg_send_AUTOPILOT_VERSION(trans,
dev, AC_ID, &ap_version, strlen(ver_desc), ver_desc);
70 static void send_alive(
struct transport_tx *trans,
struct link_device *
dev)
72 pprz_msg_send_ALIVE(trans,
dev, AC_ID, 16, MD5SUM);
78 pprz_msg_send_ATTITUDE(trans,
dev, AC_ID, &(att->
phi), &(att->
psi), &(att->
theta));
83 PeriodicSendDlValue(trans,
dev);
100 pprz_msg_send_MINIMAL_COM(trans,
dev, AC_ID,
101 &lat, &lon, &hmsl, &gspeed, &
course, &climb,
126 #if USE_GENERATED_AUTOPILOT
153 #if FIXEDWING_FIRMWARE
164 #if USE_GENERATED_AUTOPILOT
179 #if USE_GENERATED_AUTOPILOT
195 #if USE_GENERATED_AUTOPILOT
207 #if USE_GENERATED_AUTOPILOT
234 #if USE_GENERATED_AUTOPILOT
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
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
void autopilot_generated_periodic(void)
void autopilot_generated_init(void)
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.
Event structure to store callbacks in a linked list.
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
void autopilot_static_init(void)
Static autopilot API.
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 struct UtmCoor_f * stateGetPositionUtm_f(void)
Get position in UTM coordinates (float).
static void send_autopilot_version(struct transport_tx *trans, struct link_device *dev)
float vsupply
supply voltage in V
bool autopilot_in_flight(void)
get in_flight flag
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
float alt
in meters (above WGS84 reference ellipsoid or above MSL)
pprz_t throttle
throttle level as will be displayed in GCS
static const struct usb_device_descriptor dev
bool settings_store_flag
flag for setting feedback.
Architecture independent timing functions.
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
static void rc_cb(uint8_t sender_id, struct RadioControl *rc)
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)
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
void autopilot_store_settings(void)
store settings
static void send_alive(struct transport_tx *trans, struct link_device *dev)
void autopilot_static_periodic(void)
static struct EnuCoor_f * stateGetSpeedEnu_f(void)
Get ground speed in local ENU coordinates (float).
bool autopilot_set_mode(uint8_t new_autopilot_mode)
set autopilot mode
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 ?
void autopilot_static_SetModeHandler(float new_autopilot_mode)
static void send_attitude(struct transport_tx *trans, struct link_device *dev)
static void send_minimal_com(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.
struct Electrical electrical
uint8_t autopilot_get_mode(void)
get autopilot mode
static struct LlaCoor_f * stateGetPositionLla_f(void)
Get position in LLA coordinates (float).
void autopilot_on_rc_frame(void)
RC frame handler.
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)
void autopilot_static_on_rc_frame(void)
Function to be called when a message from FBW is available.
struct GpsState gps
global GPS state
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)
void WEAK autopilot_failsafe_checks(void)
Failsafe checks.