30 #define PERIODIC_C_MAIN
39 #include "generated/airframe.h"
40 #include "generated/settings.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)
127 SetActuatorsFromCommands(
commands, 0);
155 if (DL_SETTING_ac_id(
dl_buffer) == AC_ID) {
162 case DL_GET_SETTING : {
163 if (DL_GET_SETTING_ac_id(
dl_buffer) != AC_ID) {
break; }
165 float val = settings_get_value(i);
176 pprz_msg_send_ALIVE(trans, dev, AC_ID, 16, MD5SUM);
181 static uint32_t ap_version = PPRZ_VERSION_INT;
182 static char *ver_desc = PPRZ_VERSION_DESC;
183 pprz_msg_send_AUTOPILOT_VERSION(trans, dev, AC_ID, &ap_version, strlen(ver_desc), ver_desc);
188 pprz_msg_send_ACTUATORS(trans, dev, AC_ID , ACTUATORS_NB, actuators);
193 pprz_msg_send_COMMANDS(trans, dev, AC_ID, COMMANDS_NB,
commands);
Interface to align the AHRS via low-passed measurements at startup.
void mcu_init(void)
Microcontroller peripherals initialization.
Dispatcher to register actual AHRS implementations.
Generic transmission transport header.
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)
void imu_periodic(void)
optional.
void dl_parse_msg(void)
Should be called when chars are available in dl_buffer.
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)
struct Imu imu
global IMU state
#define DefaultPeriodic
Set default periodic telemetry.
Hardware independent code for commands handling.
Inertial Measurement Unit interface.
int sys_time_register_timer(float duration, sys_time_cb cb)
Register a new system timer.
static bool_t sys_time_check_and_ack_timer(tid_t id)
Check if timer has elapsed.
struct OrientationReps body_to_imu
rotation from body to imu frame
static const struct usb_device_descriptor dev
#define DefaultChannel
SITL.
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)
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.
uint8_t dl_buffer[MSG_SIZE]
#define PERIODIC_FREQUENCY
arch independent LED (Light Emitting Diodes) API
void mcu_event(void)
MCU event functions.
void ahrs_aligner_init(void)
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
static struct FloatQuat * orientationGetQuat_f(struct OrientationReps *orientation)
Get vehicle body attitude quaternion (float).