Application: rawlog-grabber
1. Description
rawlog-grabber is a command-line application which uses a generic sensor architecture to collect data from a variety of robotic sensors in real-time taking into account the different rates at which each sensor may work. All the data is time stamp-sorted and dumped into a Rawlog file.
This program creates one thread for each sensor declared in the config file and then saves the timestamp-ordered observations to a rawlog file. The valuable utility of this program is to collect datasets from mobile robots for off-line processing.
The available “sensor drivers” are all those classes derived from mrpt::hwdrivers::CGenericSensor. See also the list of sensors and devices supported by MRPT.
2. Usage
1 |
rawlog-grabber <config_file.ini> |
3. Configuration file specification
The configuration files must contain one mandatory [global]
section with common parameters:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
[global] // The prefix can contain a relative or absolute path. // The final name will be ${rawlog_prefix}_${date}_${time}.rawlog rawlog_prefix = dataset // Milliseconds between thread launches time_between_launches = 800 // SF=1 (or "true"): Enabled= Observations will be grouped by time periods. // SF=0 (or "false"): Disabled= All the observations are saved independently // and ordered solely by their timestamps. use_sensoryframes = false // Only if "use_sensoryframes=1": The maximum time difference between // observations within a single sensory-frame. SF_max_time_span = 0.25 // seconds // Observations will be processed at the main thread with this period GRABBER_PERIOD_MS = 1000 // ms |
Then, a variable number of sections must follow, one for each desired sensor, with all the parameters for each of the sensor classes. The basic structure of these “sensor sections” is:
1 2 3 4 5 |
[SECTION_NAME] driver = CLASS_NAME process_rate = PROCESS_RATE // Hz sensorLabel = SENSOR_LABEL // the rest of sensor-specific parameters.... (See the class Doxygen docs) |
Some notes:
- SECTION_NAME: All section names must be different!
- CLASS_NAME: Valid values are names (without the namespace prefix) of all those classes derived from CGenericSensor (e.g. valid values are “CCameraSensor”,”CHokuyoURG”,…)
- PROCESS_RATE: Set the maximum execution rate of the main loop in this sensor’s thread. Make sure it’s above the maximum number of observations the sensor is able to emit.
- SENSOR_LABEL: An arbitrary text label that will identify the observations emitted by this sensor (it has nothing to do with the SECTION_NAME, can be totally different).
4. Configuration file examples
Several sample configuration files are already shipped with MRPT so you don’t have to start from scratch. Take a look at them here:
https://raw.github.com/MRPT/mrpt/master/share/mrpt/config_files/rawlog-grabber/