Home

Awesome

events_h52bag

C++ code to convert event data from HDF5 to ROSbags. By default, data format of h5 input file is expected as in the DSEC dataset or TUM-VIE dataset. The exact data structure used can be found here.

Author: Suman Ghosh

Installation

sudo apt-get update
sudo apt-get install libhdf5-dev
git clone https://github.com/Blosc/hdf5-blosc.git
cd hdf5-blosc
mkdir build && cd build
cmake ..
make

Then, add the following line to your ~/.bashrc and source it

export HDF5_PLUGIN_PATH=<path to plugins>
git clone git@github.com:h5py/h5py.git
cd h5py/lzf
h5fc -I"lzf" -O2 -fPIC -shared lzf/*.c lzf_filter.c -lhdf5 -o liblzf_filter.so
sudo cp liblzf_filter.so /usr/lib/x86_64-linux-gnu/hdf5/plugins/
cd events_h52bag
mkdir build && cd build
cmake ..
make

Execution

./events_h52bag <path/to/input/h5file> <path/to/output/bagfile(without extension)> <output_topic_name> <sensor_height> <sensor_width> [optional, default=500000000]<events_read_per_iteration> [optional, default=100000]<event_packet_size> [optional, default="events"]<dataset_prefix>

To overcome memory limitations for large data files, h5 files are read in multiple iterations (500M events per iteration max). The result is a single ROSBag.

Working example

Log