Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
file_logger.c File Reference

File logger for Linux based autopilots. More...

#include "file_logger.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 dependency graph for file_logger.c:

Go to the source code of this file.

Macros

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

Functions

static void file_logger_write_header (FILE *file)
 Logging functions. More...
 
static void file_logger_write_row (FILE *file)
 Write CSV row Write values at this timestamp to log file. More...
 
void file_logger_start (void)
 Start the file logger and open a new file. More...
 
void file_logger_stop (void)
 Stop the logger an nicely close the file. More...
 
void file_logger_periodic (void)
 Log the values to a csv file
More...
 

Variables

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

Detailed Description

File logger for Linux based autopilots.

Definition in file file_logger.c.

Macro Definition Documentation

◆ FILE_LOGGER_PATH

#define FILE_LOGGER_PATH   /data/video/usb

Set the default File logger path to the USB drive.

Definition at line 49 of file file_logger.c.

Function Documentation

◆ file_logger_periodic()

void file_logger_periodic ( void  )

Log the values to a csv file

Definition at line 157 of file file_logger.c.

References file_logger, and file_logger_write_row().

+ Here is the call graph for this function:

◆ file_logger_start()

void file_logger_start ( void  )

Start the file logger and open a new file.

Definition at line 105 of file file_logger.c.

References counter, file_logger, FILE_LOGGER_PATH, and file_logger_write_header().

+ Here is the call graph for this function:

◆ file_logger_stop()

void file_logger_stop ( void  )

Stop the logger an nicely close the file.

Definition at line 148 of file file_logger.c.

References file_logger.

◆ file_logger_write_header()

static void file_logger_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 file_logger_write_row! Don't forget the
at the end of the line.

Parameters
fileLog file pointer

Definition at line 64 of file file_logger.c.

Referenced by file_logger_start().

+ Here is the caller graph for this function:

◆ file_logger_write_row()

static void file_logger_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 file_logger_write_header! Don't forget the
at the end of the line.

Parameters
fileLog file pointer

Definition at line 83 of file file_logger.c.

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

Referenced by file_logger_periodic().

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

Variable Documentation

◆ file_logger

FILE* file_logger = NULL
static

The file pointer.

Definition at line 53 of file file_logger.c.

Referenced by file_logger_periodic(), file_logger_start(), and file_logger_stop().