38 #include "generated/airframe.h"
46 #include "generated/modules.h"
49 #ifndef LOGGER_FILE_PATH
50 #define LOGGER_FILE_PATH /data/video/usb
66 fprintf(file,
"time,");
67 fprintf(file,
"pos_x,pos_y,pos_z,");
68 fprintf(file,
"vel_x,vel_y,vel_z,");
69 fprintf(file,
"att_phi,att_theta,att_psi,");
70 fprintf(file,
"rate_p,rate_q,rate_r,");
72 fprintf(file,
"rpm_obs_1,rpm_obs_2,rpm_obs_3,rpm_obs_4,");
73 fprintf(file,
"rpm_ref_1,rpm_ref_2,rpm_ref_3,rpm_ref_4,");
79 fprintf(file,
"cmd_thrust,cmd_roll,cmd_pitch,cmd_yaw\n");
81 fprintf(file,
"h_ctl_aileron_setpoint,h_ctl_elevator_setpoint\n");
98 fprintf(file,
"%f,%f,%f,", pos->
x, pos->
y, pos->
z);
99 fprintf(file,
"%f,%f,%f,", vel->
x, vel->
y, vel->
z);
100 fprintf(file,
"%f,%f,%f,", att->
phi, att->
theta, att->
psi);
101 fprintf(file,
"%f,%f,%f,", rates->
p, rates->
q, rates->
r);
106 #ifdef INS_EXT_POSE_H
109 #ifdef COMMAND_THRUST
110 fprintf(file,
"%d,%d,%d,%d\n",
123 logger_file_logger_file_periodic_status = MODULES_RUN;
127 char save_dir_cmd[256];
129 if (system(save_dir_cmd) != 0) {
130 printf(
"[logger_file] Could not create log file directory %s.\n", STRINGIFY(
LOGGER_FILE_PATH));
137 time_t now =
time(0);
139 tstruct = *localtime(&now);
140 strftime(date_time,
sizeof(date_time),
"%Y%m%d-%H%M%S", &tstruct);
156 printf(
"[logger_file] ERROR opening log file %s!\n", filename);
160 printf(
"[logger_file] Start logging to %s...\n", filename);
struct ActuatorsBebop actuators_bebop
uint16_t rpm_ref[4]
Reference RPM.
uint16_t rpm_obs[4]
Observed RPM.
Fixed wing horizontal control.
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
static struct NedCoor_f * stateGetPositionNed_f(void)
Get position in local NED coordinates (float).
static struct FloatRates * stateGetBodyRates_f(void)
Get vehicle body angular rate (float).
static struct NedCoor_f * stateGetSpeedNed_f(void)
Get ground speed in local NED coordinates (float).
void ins_ext_pos_log_data(FILE *file)
void ins_ext_pos_log_header(FILE *file)
Logging.
static FILE * logger_file
The file pointer.
void logger_file_stop(void)
Stop the logger an nicely close the file.
void logger_file_periodic(void)
Log the values to a csv file
static void logger_file_write_header(FILE *file)
Logging functions.
static void logger_file_write_row(FILE *file)
Write CSV row Write values at this timestamp to log file.
void logger_file_start(void)
Start the file logger and open a new file.
#define LOGGER_FILE_PATH
Set the default File logger path to the USB drive.
File logger for Linux based autopilots.
vector in North East Down coordinates Units: meters
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)
pprz_t h_ctl_elevator_setpoint
pprz_t h_ctl_aileron_setpoint
Fixed wing horizontal adaptive control.
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.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.