Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
logger_file.c File Reference

File logger for Linux based autopilots. More...

#include "logger_file.h"
#include <stdio.h>
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>
#include "std.h"
#include "mcu_periph/sys_time.h"
#include "state.h"
#include "generated/airframe.h"
#include "firmwares/fixedwing/stabilization/stabilization_attitude.h"
#include "firmwares/fixedwing/stabilization/stabilization_adaptive.h"
#include "generated/modules.h"
+ Include dependency graph for logger_file.c:

Go to the source code of this file.

Macros

#define LOGGER_FILE_PATH   /data/video/usb
 Set the default File logger path to the USB drive. More...
 

Functions

static void logger_file_write_header (FILE *file)
 Logging functions. More...
 
static void logger_file_write_row (FILE *file)
 Write CSV row Write values at this timestamp to log file. More...
 
void logger_file_start (void)
 Start the file logger and open a new file. More...
 
void logger_file_stop (void)
 Stop the logger an nicely close the file. More...
 
void logger_file_periodic (void)
 Log the values to a csv file
More...
 

Variables

static FILE * logger_file = NULL
 The file pointer. More...
 

Detailed Description

File logger for Linux based autopilots.

Definition in file logger_file.c.

Macro Definition Documentation

◆ LOGGER_FILE_PATH

#define LOGGER_FILE_PATH   /data/video/usb

Set the default File logger path to the USB drive.

Definition at line 50 of file logger_file.c.

Function Documentation

◆ logger_file_periodic()

void logger_file_periodic ( void  )

Log the values to a csv file

Definition at line 175 of file logger_file.c.

References logger_file, and logger_file_write_row().

+ Here is the call graph for this function:

◆ logger_file_start()

void logger_file_start ( void  )

Start the file logger and open a new file.

Definition at line 120 of file logger_file.c.

References counter, logger_file, LOGGER_FILE_PATH, and logger_file_write_header().

+ Here is the call graph for this function:

◆ logger_file_stop()

void logger_file_stop ( void  )

Stop the logger an nicely close the file.

Definition at line 166 of file logger_file.c.

References logger_file.

◆ logger_file_write_header()

static void logger_file_write_header ( FILE *  file)
static

Logging functions.

Write CSV header Write column names at the top of the CSV file. Make sure that the columns match those in logger_file_write_row! Don't forget the
at the end of the line.

Parameters
fileLog file pointer

Definition at line 65 of file logger_file.c.

References ins_ext_pos_log_header().

Referenced by logger_file_start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ logger_file_write_row()

static void logger_file_write_row ( FILE *  file)
static

Write CSV row Write values at this timestamp to log file.

Make sure that the printf's match the column headers of logger_file_write_header! Don't forget the
at the end of the line.

Parameters
fileLog file pointer

Definition at line 91 of file logger_file.c.

References actuators_bebop, get_sys_time_float(), h_ctl_aileron_setpoint, h_ctl_elevator_setpoint, ins_ext_pos_log_data(), FloatRates::p, FloatEulers::phi, FloatEulers::psi, FloatRates::q, FloatRates::r, ActuatorsBebop::rpm_obs, ActuatorsBebop::rpm_ref, stabilization_cmd, stateGetBodyRates_f(), stateGetNedToBodyEulers_f(), stateGetPositionNed_f(), stateGetSpeedNed_f(), FloatEulers::theta, NedCoor_f::x, NedCoor_f::y, and NedCoor_f::z.

Referenced by logger_file_periodic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ logger_file

FILE* logger_file = NULL
static

The file pointer.

Definition at line 54 of file logger_file.c.

Referenced by logger_file_periodic(), logger_file_start(), and logger_file_stop().