30 #define PERIODIC_C_MAIN
39 #include "generated/airframe.h"
40 #include "generated/settings.h"
41 #include "generated/modules.h"
56 #include "pprz_version.h"
59 #define DEMO_MAX_ROLL RadOfDeg(65)
62 #ifndef DEMO_MAX_PITCH
63 #define DEMO_MAX_PITCH RadOfDeg(65)
70 static void send_alive(
struct transport_tx *trans,
struct link_device *
dev);
73 static void send_commands(
struct transport_tx *trans,
struct link_device *
dev);
121 SetActuatorsFromCommands(
commands, 0);
124 modules_periodic_task();
130 modules_periodic_task();
136 modules_event_task();
141 pprz_msg_send_ALIVE(trans,
dev, AC_ID, 16, MD5SUM);
146 static uint32_t ap_version = PPRZ_VERSION_INT;
147 static char *ver_desc = PPRZ_VERSION_DESC;
148 pprz_msg_send_AUTOPILOT_VERSION(trans,
dev, AC_ID, &ap_version, strlen(ver_desc), ver_desc);
153 pprz_msg_send_ACTUATORS_RAW(trans,
dev, AC_ID , ACTUATORS_NB, actuators);
158 pprz_msg_send_COMMANDS(trans,
dev, AC_ID, COMMANDS_NB,
commands);
Main include for ABI (AirBorneInterface).
void ahrs_init(void)
AHRS initialization.
pprz_t commands[COMMANDS_NB]
Hardware independent code for commands handling.
void datalink_periodic(void)
periodic function, should be called at 1Hz
Handling of messages coming from ground and other A/Cs.
static void main_event_task(void)
static void send_commands(struct transport_tx *trans, struct link_device *dev)
static void send_alive(struct transport_tx *trans, struct link_device *dev)
static void main_periodic_task(void)
static void send_autopilot_version(struct transport_tx *trans, struct link_device *dev)
static void send_actuators(struct transport_tx *trans, struct link_device *dev)
static void main_init(void)
Common code for AP and FBW telemetry.
void mcu_init(void)
Microcontroller peripherals initialization.
void mcu_event(void)
MCU event functions.
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
Inertial Measurement Unit interface.
arch independent LED (Light Emitting Diodes) API
Arch independent mcu ( Micro Controller Unit ) utilities.
void actuators_init(void)
Hardware independent API for actuators (servos, motor controllers).
Persistent settings interface.
API to get/set the generic vehicle states.
static const struct usb_device_descriptor dev
tid_t sys_time_register_timer(float duration, sys_time_cb cb)
Register a new system timer.
Architecture independent timing functions.
volatile uint32_t nb_sec
full seconds since startup
static bool sys_time_check_and_ack_timer(tid_t id)
Check if timer has elapsed.
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.