4 #if ANU_COMPILE_FOR_XENOMAI
5 #include <native/mutex.h>
31 #if ANU_COMPILE_FOR_XENOMAI
43 #if DATALOGGER_MODULE_ENABLED
44 double enabled_variables[16][1];
45 char datalogger_filename[256];
46 #if ANU_COMPILE_FOR_XENOMAI
61 strcat(datalogger_filename,
"/");
63 strcat(datalogger_filename,
".mat");
64 #if DATALOGGER_ENABLE_NEW_FILE_ENNUMERATION
65 char datalogger_tmp[256];
70 strcat(datalogger_tmp,
"/");
72 strcat(datalogger_tmp,
"_%d.mat");
75 sprintf(datalogger_filename, datalogger_tmp, ++i);
84 #endif //DATALOGGER_ENABLE_NEW_FILE_ENNUMERATION
111 #if DATALOGGER_LOG_TIME
114 #endif // DATALOGGER_LOG_TIME
116 #if DATALOGGER_LOG_EXECTIMES
119 #endif // DATALOGGER_LOG_EXECTIMES
121 #if DATALOGGER_LOG_RAW_IMU
132 #endif // DATALOGGER_LOG_IMU
134 #if DATALOGGER_LOG_EFFORTS
139 #if DATALOGGER_LOG_MRA
144 #if DATALOGGER_LOG_CALIBRATED_IMU
158 #endif // DATALOGGER_LOG_CALIBRATED_IMU
210 #endif //DATALOGGER_MODULE_ENABLED
217 #if DATALOGGER_MODULE_ENABLED
231 #if ANU_COMPILE_FOR_XENOMAI
233 #endif //ANU_COMPILE_FOR_XENOMAI
235 #endif //DATALOGGER_MODULE_ENABLED
242 #if DATALOGGER_MODULE_ENABLED
258 #if DATALOGGER_MODULE_ENABLED
284 #if DATALOGGER_LOG_TIME
285 double tmp_t = t_s - t0_s;
290 #endif // DATALOGGER_LOG_TIME
292 #if DATALOGGER_LOG_EXECTIMES
297 tmp_e = t_control_exec_s;
299 #endif // DATALOGGER_LOG_EXECTIMES
302 #if DATALOGGER_LOG_RAW_IMU
303 tmp = (double) pimu_data->
acc.
x;
305 tmp = (double) pimu_data->
acc.
y;
307 tmp = (double) pimu_data->
acc.
z;
309 tmp = (double) pimu_data->
mag.
x;
311 tmp = (double) pimu_data->
mag.
y;
313 tmp = (double) pimu_data->
mag.
z;
315 tmp = (double) pimu_data->
gyr.
x;
317 tmp = (double) pimu_data->
gyr.
y;
319 tmp = (double) pimu_data->
gyr.
z;
326 #endif //DATALOGGER_LOG_RAW_IMU
328 #if DATALOGGER_LOG_EFFORTS
329 tmp = (double) peff_data->
F.
x;
335 #if DATALOGGER_LOG_MRA
336 tmp = (double) pmra_data->
v_ctl;
344 #if DATALOGGER_LOG_CALIBRATED_IMU
364 tmp_ci = pimu_measure->ax;
365 tmp_ci = pmagnetometer_measure->mx;
366 #endif // DATALOGGER_LOG_CALIBRATED_IMU
552 #if DATALOGGER_LOG_TIME
565 #endif // DATALOGGER_LOG_TIME
586 #if DATALOGGER_MODULE_ENABLED
603 #if DATALOGGER_MODULE_ENABLED
621 if((file = fopen(filename,
"r")))
631 #if ANU_COMPILE_FOR_XENOMAI
641 #if ANU_COMPILE_FOR_XENOMAI
#define DATALOGGER_ERROR_NOT_INITIALIZED
#define DATALOGGER_VARIABLE_NOT_INSERTED
int datalogger_set_Ts(double Ts)
int datalogger_start(void)
#define DATALOGGER_RUNNING
int gDataLogger_InsertVariable(PGDATALOGGER pgDataLogger, char *varname, double *varvalue)
#define DATALOGGER_FILE_NAME
int datalogger_update_IPC(void)
#define DATALOGGER_LOG_TIME
#define DATALOGGER_STANDARD_QUEUE_SIZE
int datalogger_close(void)
#define DATALOGGER_LOG_RAW_IMU
#define DATALOGGER_NOT_INITIALIZED
#define DATALOGGER_LOG_EXECTIMES
#define DATALOGGER_LOG_EFFORTS
DATA_XYZ mag
Magnetormeter Vector.
int datalogger_write_file(void)
int datalogger_init(void)
#define DATALOGGER_VARIABLE_INSERTED
int datalogger_unlock_mutex(void)
int datalogger_update(double t_s, double t_control_exec_s, double t_ui_exec_s, double t0_s, IMU_DATA_STRUCT *pimu_data, EFF_DATA_STRUCT *peff_data, MRA_DATA_STRUCT *pmra_data)
#define DATALOGGER_LOG_CALIBRATED_IMU
unsigned int datalogger_initialized
#define DATALOGGER_VARIBALE_ALREADY_INSERTED
pthread_mutex_t datalogger_mutex
#define DATALOGGER_LOG_MRA
#define DATALOGGER_INITIALIZED
int gDataLogger_MatfileUpdate(PGDATALOGGER pgDataLogger)
short int v_ctl_read
Voltage level read from the actuator.
DATA_XYZ acc
Accel Vector.
#define DATALOGGER_FAILURE
#define DATALOGGER_NOT_RUNNING
#define DATALOGGER_SUCCESS
int gDataLogger_IPCUpdate(PGDATALOGGER pgDataLogger)
int gDataLogger_DeclareVariable(PGDATALOGGER pgDataLogger, char *varname, char *varunit, int nrows, int ncols, int queuesize)
#define DATALOGGER_FOLDER
int gDataLogger_Close(PGDATALOGGER pgDataLogger)
struct IMU_DATA_STRUCT::calibrated calib
int datalogger_file_exists(const char *filename)
int gDataLogger_Init(PGDATALOGGER pgDataLogger, char *filename, char *dirname)
DATA_XYZ gyr
Gyrometer Vector.
unsigned int datalogger_running
short int v_ctl
Voltage level for control output.
int datalogger_status(void)
int datalogger_stop(void)
int datalogger_lock_mutex(void)