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);
125 SetActuatorsFromCommands(
commands, 0);
128 modules_periodic_task();
134 modules_periodic_task();
140 modules_event_task();
145 pprz_msg_send_ALIVE(trans, dev, AC_ID, 16, MD5SUM);
150 static uint32_t ap_version = PPRZ_VERSION_INT;
151 static char *ver_desc = PPRZ_VERSION_DESC;
152 pprz_msg_send_AUTOPILOT_VERSION(trans, dev, AC_ID, &ap_version, strlen(ver_desc), ver_desc);
157 pprz_msg_send_ACTUATORS(trans, dev, AC_ID , ACTUATORS_NB, actuators);
162 pprz_msg_send_COMMANDS(trans, dev, AC_ID, COMMANDS_NB,
commands);
void mcu_init(void)
Microcontroller peripherals initialization.
Dispatcher to register actual AHRS implementations.
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
Periodic telemetry system header (includes downlink utility and generated code).
Handling of messages coming from ground and other A/Cs.
Main include for ABI (AirBorneInterface).
static void main_periodic_task(void)
struct Imu imu
global IMU state
static void send_actuators(struct transport_tx *trans, struct link_device *dev)
void ahrs_init(void)
AHRS initialization.
static void send_autopilot_version(struct transport_tx *trans, struct link_device *dev)
Hardware independent API for actuators (servos, motor controllers).
static void main_event_task(void)
Architecture independent timing functions.
static void send_alive(struct transport_tx *trans, struct link_device *dev)
#define DefaultPeriodic
Set default periodic telemetry.
Hardware independent code for commands handling.
Inertial Measurement Unit interface.
struct OrientationReps body_to_imu
rotation from body to imu frame
static const struct usb_device_descriptor dev
Arch independent mcu ( Micro Controller Unit ) utilities.
pprz_t commands[COMMANDS_NB]
Storage of intermediate command values.
API to get/set the generic vehicle states.
Persistent settings interface.
static void main_init(void)
static bool sys_time_check_and_ack_timer(tid_t id)
Check if timer has elapsed.
volatile uint32_t nb_sec
full seconds since startup
static void send_commands(struct transport_tx *trans, struct link_device *dev)
Common code for AP and FBW telemetry.
arch independent LED (Light Emitting Diodes) API
void mcu_event(void)
MCU event functions.
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
tid_t sys_time_register_timer(float duration, sys_time_cb cb)
Register a new system timer.
static struct FloatQuat * orientationGetQuat_f(struct OrientationReps *orientation)
Get vehicle body attitude quaternion (float).