|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
38 #include "generated/airframe.h"
48 #ifndef FILE_LOGGER_PATH
49 #define FILE_LOGGER_PATH /data/video/usb
65 fprintf(file,
"time,");
66 fprintf(file,
"pos_x,pos_y,pos_z,");
67 fprintf(file,
"vel_x,vel_y,vel_z,");
68 fprintf(file,
"att_phi,att_theta,att_psi,");
69 fprintf(file,
"rate_p,rate_q,rate_r,");
71 fprintf(file,
"cmd_thrust,cmd_roll,cmd_pitch,cmd_yaw\n");
73 fprintf(file,
"h_ctl_aileron_setpoint,h_ctl_elevator_setpoint\n");
90 fprintf(file,
"%f,%f,%f,", pos->
x, pos->
y, pos->
z);
91 fprintf(file,
"%f,%f,%f,", vel->
x, vel->
y, vel->
z);
92 fprintf(file,
"%f,%f,%f,", att->
phi, att->
theta, att->
psi);
93 fprintf(file,
"%f,%f,%f,", rates->
p, rates->
q, rates->
r);
95 fprintf(file,
"%d,%d,%d,%d\n",
109 char save_dir_cmd[256];
111 if (system(save_dir_cmd) != 0) {
112 printf(
"[file_logger] Could not create log file directory %s.\n", STRINGIFY(
FILE_LOGGER_PATH));
119 time_t now = time(0);
121 tstruct = *localtime(&now);
122 strftime(date_time,
sizeof(date_time),
"%Y%m%d-%H%M%S", &tstruct);
138 printf(
"[file_logger] ERROR opening log file %s!\n", filename);
142 printf(
"[file_logger] Start logging to %s...\n", filename);
vector in North East Down coordinates Units: meters
static struct NedCoor_f * stateGetPositionNed_f(void)
Get position in local NED coordinates (float).
#define FILE_LOGGER_PATH
Set the default File logger path to the USB drive.
static float get_sys_time_float(void)
Get the time in seconds since startup.
void file_logger_stop(void)
Stop the logger an nicely close the file.
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
static struct FloatRates * stateGetBodyRates_f(void)
Get vehicle body angular rate (float).
void file_logger_start(void)
Start the file logger and open a new file.
static void file_logger_write_header(FILE *file)
Logging functions.
static struct NedCoor_f * stateGetSpeedNed_f(void)
Get ground speed in local NED coordinates (float).
File logger for Linux based autopilots.
Architecture independent timing functions.
static FILE * file_logger
The file pointer.
pprz_t h_ctl_elevator_setpoint
static void file_logger_write_row(FILE *file)
Write CSV row Write values at this timestamp to log file.
void file_logger_periodic(void)
Log the values to a csv file
int32_t stabilization_cmd[COMMANDS_NB]
Stabilization commands.
pprz_t h_ctl_aileron_setpoint