32#define LogFormatHeader "%.5f,%ld,%ld,%ld,%ld,%ld,%ld"
33#define LogFormatVect3 ",%ld,%ld,%ld"
34#define LogFormatI32 ",%ld"
37#define LogFormatHeader "%.5f,%d,%d,%d,%d,%d,%d"
38#define LogFormatVect3 ",%d,%d,%d"
39#define LogFormatI32 ",%d"
43#ifndef LOGGER_CONTROL_EFFECTIVENESS_FILE_PATH
44#define LOGGER_CONTROL_EFFECTIVENESS_FILE_PATH /data/ftp/internal_000/control_eff
51#ifndef LOGGER_CONTROL_EFFECTIVENESS_COMMANDS
52#define LOGGER_CONTROL_EFFECTIVENESS_COMMANDS TRUE
55#ifndef LOGGER_CONTROL_EFFECTIVENESS_ACTUATORS
56#define LOGGER_CONTROL_EFFECTIVENESS_ACTUATORS FALSE
59#ifndef LOGGER_CONTROL_EFFECTIVENESS_POS
60#define LOGGER_CONTROL_EFFECTIVENESS_POS FALSE
63#ifndef LOGGER_CONTROL_EFFECTIVENESS_SPEED
64#define LOGGER_CONTROL_EFFECTIVENESS_SPEED FALSE
67#ifndef LOGGER_CONTROL_EFFECTIVENESS_AIRSPEED
68#define LOGGER_CONTROL_EFFECTIVENESS_AIRSPEED FALSE
71#ifndef LOGGER_CONTROL_EFFECTIVENESS_RPM
72#define LOGGER_CONTROL_EFFECTIVENESS_RPM FALSE
77#if LOGGER_CONTROL_EFFECTIVENESS_COMMANDS
81#if LOGGER_CONTROL_EFFECTIVENESS_ACTUATORS
85#if LOGGER_CONTROL_EFFECTIVENESS_RPM
89static int32_t act_rpm[ACTUATORS_NB];
93 for (
int i = 0; i < num_act; i++) {
94 if (feedback[i].set.
rpm && feedback[i].
idx < ACTUATORS_NB) {
95 act_rpm[feedback[i].
idx] = feedback[i].rpm;
104#if LOGGER_CONTROL_EFFECTIVENESS_RPM
105 AbiBindMsgACT_FEEDBACK(
ABI_BROADCAST, &rpm_feedback_ev, rpm_feedback_cb);
116#if LOGGER_CONTROL_EFFECTIVENESS_COMMANDS
117 for (
unsigned int i = 0; i < COMMANDS_NB; i++) {
121#if LOGGER_CONTROL_EFFECTIVENESS_ACTUATORS
122 for (
unsigned int i = 0; i < ACTUATORS_NB; i++) {
126#if LOGGER_CONTROL_EFFECTIVENESS_POS
129#if LOGGER_CONTROL_EFFECTIVENESS_SPEED
132#if LOGGER_CONTROL_EFFECTIVENESS_AIRSPEED
135#if LOGGER_CONTROL_EFFECTIVENESS_RPM
136 for (
unsigned int i = 0; i < ACTUATORS_NB; i++) {
172#if LOGGER_CONTROL_EFFECTIVENESS_COMMANDS
173 for (
unsigned int i = 0; i < COMMANDS_NB; i++) {
179#if LOGGER_CONTROL_EFFECTIVENESS_ACTUATORS
180 for (
unsigned int i = 0; i < ACTUATORS_NB; i++) {
186#if LOGGER_CONTROL_EFFECTIVENESS_POS
192#if LOGGER_CONTROL_EFFECTIVENESS_SPEED
198#if LOGGER_CONTROL_EFFECTIVENESS_AIRSPEED
203#if LOGGER_CONTROL_EFFECTIVENESS_RPM
204 for (
unsigned int i = 0; i < ACTUATORS_NB; i++) {
Main include for ABI (AirBorneInterface).
struct abi_struct abi_event
#define ABI_BROADCAST
Broadcast address.
Hardware independent code for commands handling.
int32_t p
in rad/s with INT32_RATE_FRAC
int32_t r
in rad/s with INT32_RATE_FRAC
int32_t q
in rad/s with INT32_RATE_FRAC
vector in East North Up coordinates
static struct EnuCoor_i * stateGetPositionEnu_i(void)
Get position in local ENU coordinates (int).
static struct Int32Rates * stateGetBodyRates_i(void)
Get vehicle body angular rate (int).
static struct Int32Vect3 * stateGetAccelBody_i(void)
Get acceleration in Body coordinates (int).
static struct EnuCoor_i * stateGetSpeedEnu_i(void)
Get ground speed in local ENU coordinates (int).
static float stateGetAirspeed_f(void)
Get airspeed (float).
void logger_control_effectiveness_periodic(void)
Log the values to file.
#define LOGGER_CONTROL_EFFECTIVENESS_FILE_PATH
void logger_control_effectiveness_init(void)
Init module.
void logger_control_effectiveness_start(void)
Write the log header line according to the enabled parts.
static FILE * pprzLogFile
void logger_control_effectiveness_stop(void)
Log data required to compute control effectiveness.
Generic definitions and tools for logging on ChibiOS or Linux.
#define LogOpen(_file, _path, _name)
#define LogFileIsOpen(_file)
Hardware independent API for actuators (servos, motor controllers).
uint8_t idx
General index of the actuators (generated in airframe.h).
static const ShellCommand commands[]
API to get/set the generic vehicle states.
Architecture independent timing functions.
static float get_sys_time_float(void)
Get the time in seconds since startup.
int int32_t
Typedef defining 32 bit int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.