The ROS2MongoDB package is designed for recording sensors and actuators data generated during scientific experiments with robots. It stores this data in a structured manner within a database, facilitating further analysis for research purposes.
This package is compatible with MongoDB and HDF5 file formats for storing low and high-dimensional data, respectively. To use this package, you'll need the following Python libraries:
The ROS2MongoDB package is used to log data from ROS topics published by sensors and actuators on a robot during its operation or experiments. It stores this data in a NoSQL database (MongoDB) and high-dimensional data (e.g., images) in hierarchical structured files (HDF5). Users can customize several functionalities based on their specific use case, including data compression and specifying the data of interest.
Users must configure required parameters in the datalogger
class indatalogger.py
:
- MongoDB IP: The IP address of the MongoDB server for the Python client. Variable:
mongodb_ip
. - Path to Store HDF5 File: The local path where HDF5 files should be stored. Variable:
path_to_hdf5_file
. - Topics: A list of topics to which the package should listen and record data (comma-separated). Variable:
Topics
. - Name of the Experiment: A name describing the experiment or type of experiment. Variable:
name_of_experiment
. - Frequency (Optional): The frequency or time window at which data should be recorded (default: 10 nanoseconds). Variable:
ws
.
To start recording, follow these steps:
-
Ensure that your experiments have been initiated, and data is actively being published.
-
Open a terminal window.
-
Execute the following command:
ros2 run cairo_robot record_data
This package is designed to work with MongoDB version 7.0.1. You can find installation instructions for MongoDB here. Each significant experiment is stored as a database, and each trial is stored as a collection. Local paths for high-dimensional data (HDF5 database name) and global paths (path to HDF5 files) are stored as separate features. Data from different sources is synchronized with a common reference time (time of generation). The latest data generated within the specified time window (default: 10 nanoseconds) is recorded, while the rest is ignored.
HDF5 stores high-dimensional data in either compressed or non-compressed formats. Users can configure the different compression and pre processing technique tailored to their use case at heavy_data_call_back()
method in datalogger.py
.A new file is created for each type of experiment. Data from different trials of the same experiment is stored in different Level 1 groups, and different sensors/topics are distinguished by distinct Level 2 sub-groups.
- Author: Mahesh Saravanan
- Maintainer: Mahesh Saravanan
- Email: maheshhss750@gmail.com
- Source: GitHub Repository