The Logger and Playback Module (logger)

The CARMEN logger and playback module. More...


Files

file  readlog.h
 Library for reading log files.
file  writelog.h
 Library for writing log files.
file  logger_messages.h
 Definition of the messages for the module logger.
file  playback_interface.h
 Definition of the interface for playback.
file  playback_messages.h
 Definition of the messages for playback.

Data Structures

struct  carmen_logfile_index_t
struct  carmen_logger_sync_message
struct  carmen_playback_command_message

Defines

#define CARMEN_LOGFILE_HEADER   "# CARMEN Logfile"
#define CARMEN_LOGGER_SYNC_NAME   "carmen_logger_sync"
#define CARMEN_LOGGER_SYNC_FMT   "{string,double,string}"
#define CARMEN_PLAYBACK_COMMAND_PLAY   0
#define CARMEN_PLAYBACK_COMMAND_STOP   1
#define CARMEN_PLAYBACK_COMMAND_RESET   2
#define CARMEN_PLAYBACK_COMMAND_FORWARD   3
#define CARMEN_PLAYBACK_COMMAND_REWIND   4
#define CARMEN_PLAYBACK_COMMAND_FWD_SINGLE   5
#define CARMEN_PLAYBACK_COMMAND_RWD_SINGLE   6
#define CARMEN_PLAYBACK_COMMAND_SET_SPEED   7
#define CARMEN_PLAYBACK_COMMAND_NAME   "carmen_playback_command"
#define CARMEN_PLAYBACK_COMMAND_FMT   "{int,int,float}"

Typedefs

typedef * carmen_logfile_index_p

Functions

carmen_logfile_index_p carmen_logfile_index_messages (carmen_FILE *infile)
void carmen_logfile_free_index (carmen_logfile_index_p *pindex)
int carmen_logfile_eof (carmen_logfile_index_p index)
float carmen_logfile_percent_read (carmen_logfile_index_p index)
int carmen_logfile_read_line (carmen_logfile_index_p index, carmen_FILE *infile, int message_num, int max_line_length, char *line)
int carmen_logfile_read_next_line (carmen_logfile_index_p index, carmen_FILE *infile, int max_line_length, char *line)
char * carmen_string_to_base_odometry_message (char *string, carmen_base_odometry_message *odometry)
char * carmen_string_to_simulator_truepos_message (char *string, carmen_simulator_truepos_message *truepos)
char * carmen_string_to_robot_laser_message_orig (char *string, carmen_robot_laser_message *laser)
char * carmen_string_to_laser_laser_message_orig (char *string, carmen_laser_laser_message *laser)
char * carmen_string_to_robot_laser_message (char *string, carmen_robot_laser_message *laser)
char * carmen_string_to_laser_laser_message (char *string, carmen_laser_laser_message *laser)
char * carmen_string_to_gps_gprmc_message (char *string, carmen_gps_gprmc_message *gps_msg)
char * carmen_string_to_gps_gpgga_message (char *string, carmen_gps_gpgga_message *gps_msg)
void carmen_logwrite_write_robot_name (char *robot_name, carmen_FILE *outfile)
void carmen_logwrite_write_header (carmen_FILE *outfile)
void carmen_logwrite_write_odometry (carmen_base_odometry_message *odometry, carmen_FILE *outfile, double timestamp)
void carmen_logwrite_write_laser_laser (carmen_laser_laser_message *laser, int laser_num, carmen_FILE *outfile, double timestamp)
void carmen_logwrite_write_robot_laser (carmen_robot_laser_message *laser, int laser_num, carmen_FILE *outfile, double timestamp)
void carmen_logwrite_write_param (char *module, char *variable, char *value, double ipc_time, char *hostname, carmen_FILE *outfile, double timestamp)
void carmen_logwrite_write_sync (carmen_logger_sync_message *sync_message, carmen_FILE *outfile)
void carmen_logwrite_write_truepos (carmen_simulator_truepos_message *truepos, carmen_FILE *outfile, double timestamp)
void carmen_logwrite_write_localize (carmen_localize_globalpos_message *msg, carmen_FILE *outfile, double timestamp)
void carmen_logger_write_gps_gpgga (carmen_gps_gpgga_message *gps_msg, carmen_FILE *outfile, double timestamp)
void carmen_logger_write_gps_gprmc (carmen_gps_gprmc_message *gps_msg, carmen_FILE *outfile, double timestamp)
void carmen_playback_command (int pCommand, int pArgument, float speed)

Detailed Description

The CARMEN logger and playback module.

The module logger provides functionalities to log and playback sensor data. Furthermore it provides a library to read and write log files.


Function Documentation

int carmen_logfile_eof carmen_logfile_index_p  index  ) 
 

End of file reached in the index structure.

void carmen_logfile_free_index carmen_logfile_index_p *  pindex  ) 
 

Frees an index structure

carmen_logfile_index_p carmen_logfile_index_messages carmen_FILE infile  ) 
 

Builds the index structure used for parsing a carmen log file.

Parameters:
infile A pointer to a CARMEN_FILE.
Returns:
A pointer to the newly created index structure.

float carmen_logfile_percent_read carmen_logfile_index_p  index  ) 
 

Percentage of the how much data has been read

int carmen_logfile_read_line carmen_logfile_index_p  index,
carmen_FILE infile,
int  message_num,
int  max_line_length,
char *  line
 

Reads a line from the log file using the index structre .

Parameters:
index A pointer to the index structure correspondinf to infile.
infile A Carmen file pointer to the log file.
message_num The index of the message to read.
max_line_length The size of line.
line A pointer to the address where the line is written to.
Returns:
Number of read bytes.

int carmen_logfile_read_next_line carmen_logfile_index_p  index,
carmen_FILE infile,
int  max_line_length,
char *  line
 

Reads the next line from the log file using the index structre.

Parameters:
index A pointer to the index structure correspondinf to infile.
infile A Carmen file pointer.
max_line_length allocated memory in line.
line A pointer to the address where the line is written to.
Returns:
Number of read bytes.

void carmen_logger_write_gps_gpgga carmen_gps_gpgga_message gps_msg,
carmen_FILE outfile,
double  timestamp
 

Converts the corresponding message into a string in the carmen log format.

Parameters:
gps_msg The message that should be written to the log file.
outfile A carmen file pointer.
timestamp The relative timestamp (when was the message received). Note that this is not the timestamp within the message!

void carmen_logger_write_gps_gprmc carmen_gps_gprmc_message gps_msg,
carmen_FILE outfile,
double  timestamp
 

Converts the corresponding message into a string in the carmen log format.

Parameters:
gps_msg The message that should be written to the log file.
outfile A carmen file pointer.
timestamp The relative timestamp (when was the message received). Note that this is not the timestamp within the message!

void carmen_logwrite_write_laser_laser carmen_laser_laser_message laser,
int  laser_num,
carmen_FILE outfile,
double  timestamp
 

Converts the corresponding message into a string in the carmen log format.

Parameters:
laser The message that should be written to the log file.
laser_num The number of the laser (1=front, 2=rear, 3=laser3, 4=laser4, ...)
outfile A carmen file pointer.
timestamp The relative timestamp (when was the message received). Note that this is not the timestamp within the message!

void carmen_logwrite_write_localize carmen_localize_globalpos_message msg,
carmen_FILE outfile,
double  timestamp
 

Converts the corresponding message into a string in the carmen log format.

Parameters:
msg The message that should be written to the log file.
outfile A carmen file pointer.
timestamp The relative timestamp (when was the message received). Note that this is not the timestamp within the message!

void carmen_logwrite_write_odometry carmen_base_odometry_message odometry,
carmen_FILE outfile,
double  timestamp
 

Converts the corresponding message into a string in the carmen log format.

Parameters:
odometry The message that should be written to the log file.
outfile A carmen file pointer.
timestamp The relative timestamp (when was the message received). Note that this is not the timestamp within the message!

void carmen_logwrite_write_param char *  module,
char *  variable,
char *  value,
double  ipc_time,
char *  hostname,
carmen_FILE outfile,
double  timestamp
 

Converts the given parameter into a string in the carmen log format.

void carmen_logwrite_write_robot_laser carmen_robot_laser_message laser,
int  laser_num,
carmen_FILE outfile,
double  timestamp
 

Converts the corresponding message into a string in the carmen log format.

Parameters:
laser The message that should be written to the log file.
laser_num The number of the laser (1=front, 2=rear, 3=laser3, 4=laser4, ...)
outfile A carmen file pointer.
timestamp The relative timestamp (when was the message received). Note that this is not the timestamp within the message!

void carmen_logwrite_write_sync carmen_logger_sync_message sync_message,
carmen_FILE outfile
 

Converts the corresponding message into a string in the carmen log format.

Parameters:
sync_message The message that should be written to the log file.
outfile A carmen file pointer.

void carmen_logwrite_write_truepos carmen_simulator_truepos_message truepos,
carmen_FILE outfile,
double  timestamp
 

Converts the corresponding message into a string in the carmen log format.

Parameters:
truepos The message that should be written to the log file.
outfile A carmen file pointer.
timestamp The relative timestamp (when was the message received). Note that this is not the timestamp within the message!

void carmen_playback_command int  pCommand,
int  pArgument,
float  speed
 

Playback a command with playback

char* carmen_string_to_base_odometry_message char *  string,
carmen_base_odometry_message odometry
 

Converts the string to an odometry message.

Parameters:
string A string describing the message in the carmen logfile format.
odometru A pointer to the (allocated) structure where the message should be written to.
Returns:
A pointer to the character up to which the string has been parsed. In case there are no errors and the string is a line read from a carmen log file, this string points to the relative timestamp (written by logger).

char* carmen_string_to_gps_gpgga_message char *  string,
carmen_gps_gpgga_message gps_msg
 

Converts the string to a gps-nmea-gga message.

Parameters:
string A string describing the message in the carmen logfile format.
gps_msg A pointer to the (allocated) structure where the message should be written to.
Returns:
A pointer to the character up to which the string has been parsed. In case there are no errors and the string is a line read from a carmen log file, this string points to the relative timestamp (written by logger).

char* carmen_string_to_gps_gprmc_message char *  string,
carmen_gps_gprmc_message gps_msg
 

Converts the string to a gps-nmea-rmc message.

Parameters:
string A string describing the message in the carmen logfile format.
gps_msg A pointer to the (allocated) structure where the message should be written to.
Returns:
A pointer to the character up to which the string has been parsed. In case there are no errors and the string is a line read from a carmen log file, this string points to the relative timestamp (written by logger).

char* carmen_string_to_laser_laser_message char *  string,
carmen_laser_laser_message laser
 

Converts the string to a (new) laser_laser_message.

Parameters:
string A string describing the message in the carmen logfile format.
laser A pointer to the (allocated) structure where the message should be written to.
Returns:
A pointer to the character up to which the string has been parsed. In case there are no errors and the string is a line read from a carmen log file, this string points to the relative timestamp (written by logger).

char* carmen_string_to_laser_laser_message_orig char *  string,
carmen_laser_laser_message laser
 

Converts the string to an old laser_laser_message.

Parameters:
string A string describing the message in the *old* carmen logfile format.
laser A pointer to the (allocated) structure where the message should be written to.
Returns:
A pointer to the character up to which the string has been parsed. In case there are no errors and the string is a line read from a carmen log file, this string points to the relative timestamp (written by logger).

char* carmen_string_to_robot_laser_message char *  string,
carmen_robot_laser_message laser
 

Converts the string to a (new) robot_laser_message.

Parameters:
string A string describing the message in the carmen logfile format.
laser A pointer to the (allocated) structure where the message should be written to.
Returns:
A pointer to the character up to which the string has been parsed. In case there are no errors and the string is a line read from a carmen log file, this string points to the relative timestamp (written by logger).

char* carmen_string_to_robot_laser_message_orig char *  string,
carmen_robot_laser_message laser
 

Converts the string to an old robot_laser_message.

Parameters:
string A string describing the message in the carmen logfile format.
laser A pointer to the (allocated) structure where the message should be written to.
Returns:
A pointer to the character up to which the string has been parsed. In case there are no errors and the string is a line read from a carmen log file, this string points to the relative timestamp (written by logger).

char* carmen_string_to_simulator_truepos_message char *  string,
carmen_simulator_truepos_message truepos
 

Converts the string to a truepos message.

Parameters:
string A string describing the message in the *old* carmen logfile format.
truepos A pointer to the (allocated) structure where the message should be written to.
Returns:
A pointer to the character up to which the string has been parsed. In case there are no errors and the string is a line read from a carmen log file, this string points to the relative timestamp (written by logger).


Generated on Wed Apr 5 18:34:21 2006 for CARMEN by  doxygen 1.4.4