33 #ifndef LOGGER_CONTROL_EFFECTIVENESS_COMMANDS
34 #define LOGGER_CONTROL_EFFECTIVENESS_COMMANDS TRUE
37 #ifndef LOGGER_CONTROL_EFFECTIVENESS_ACTUATORS
38 #define LOGGER_CONTROL_EFFECTIVENESS_ACTUATORS FALSE
41 #ifndef LOGGER_CONTROL_EFFECTIVENESS_POS
42 #define LOGGER_CONTROL_EFFECTIVENESS_POS FALSE
45 #ifndef LOGGER_CONTROL_EFFECTIVENESS_SPEED
46 #define LOGGER_CONTROL_EFFECTIVENESS_SPEED FALSE
49 #ifndef LOGGER_CONTROL_EFFECTIVENESS_AIRSPEED
50 #define LOGGER_CONTROL_EFFECTIVENESS_AIRSPEED FALSE
55 #if LOGGER_CONTROL_EFFECTIVENESS_COMMANDS
56 #ifdef ROTORCRAFT_FIRMWARE
59 #ifdef FIXEDWING_FIRMWARE
64 #if LOGGER_CONTROL_EFFECTIVENESS_ACTUATORS
72 sdLogWriteLog(
pprzLogFile,
"time,gyro_p,gyro_q,gyro_r,ax,ay,az");
73 #if LOGGER_CONTROL_EFFECTIVENESS_COMMANDS
74 for (
unsigned int i = 0; i < COMMANDS_NB; i++) {
78 #if LOGGER_CONTROL_EFFECTIVENESS_ACTUATORS
79 for (
unsigned int i = 0; i < ACTUATORS_NB; i++) {
83 #if LOGGER_CONTROL_EFFECTIVENESS_POS
86 #if LOGGER_CONTROL_EFFECTIVENESS_SPEED
87 sdLogWriteLog(
pprzLogFile,
",speed_x,speed_y,speed_z");
89 #if LOGGER_CONTROL_EFFECTIVENESS_AIRSPEED
108 sdLogWriteLog(
pprzLogFile,
"%.5f,%ld,%ld,%ld,%ld,%ld,%ld",
118 #if LOGGER_CONTROL_EFFECTIVENESS_COMMANDS
119 for (
unsigned int i = 0; i < COMMANDS_NB; i++) {
120 #ifdef ROTORCRAFT_FIRMWARE
123 #ifdef FIXEDWING_FIRMWARE
130 #if LOGGER_CONTROL_EFFECTIVENESS_ACTUATORS
131 for (
unsigned int i = 0; i < ACTUATORS_NB; i++) {
132 sdLogWriteLog(
pprzLogFile,
",%d", actuators[i].pprz_val);
137 #if LOGGER_CONTROL_EFFECTIVENESS_POS
139 sdLogWriteLog(
pprzLogFile,
",%ld,%ld,%ld", pos->
x, pos->
y, pos->
z);
143 #if LOGGER_CONTROL_EFFECTIVENESS_SPEED
145 sdLogWriteLog(
pprzLogFile,
",%ld,%ld,%ld", speed->
x, speed->
y, speed->
z);
149 #if LOGGER_CONTROL_EFFECTIVENESS_AIRSPEED
pprz_t commands[COMMANDS_NB]
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 EnuCoor_i * stateGetSpeedEnu_i(void)
Get ground speed in local ENU coordinates (int).
static struct Int32Vect3 * stateGetAccelBody_i(void)
Get acceleration in Body coordinates (int).
static float stateGetAirspeed_f(void)
Get airspeed (float).
void logger_control_effectiveness_periodic(void)
Log the values to file.
void logger_control_effectiveness_start(void)
Write the log header line according to the enabled parts.
Log data required to compute control effectiveness.
Hardware independent API for actuators (servos, motor controllers).
struct Stabilization stabilization
General stabilization interface for rotorcrafts.
int32_t cmd[COMMANDS_NB]
output command vector, range from [-MAX_PPRZ:MAX_PPRZ] (store for messages)
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.