Bag Exchange for conversion between ROS Bag formats and mp4, jpg, png, csv, etc.
- NVIDIA GPU
- x86_64 machine (recommended)
Grant permissions to all the scripts:
sudo chmod -R a+wrx ./scripts
To run (automatically pulls if missing) & attach:
./scripts/run.sh
docker attach BagX
To pull:
./scripts/pull.sh
To build:
./scripts/build.sh
If you have NVIDIA DeepStream and ROS setup locally, you can try the conda environment requirement.yaml
conda env create -f environment.yml
conda activate bagx
-
modify the
DATASET_PATH
in ./scripts/variables.sh according to your data directory on your host machineDATASET_PATH
will be mounted to~/data
inside the docker container- Remember to run ./scripts/run.sh again after modifying the
DATASET_PATH
to update the docker container mount points
-
modify the config according to your needs, e.g., ./config/example/mp4_to_imgdir_rosbag.yaml
- Any invalid input file path will cause assertion failure and stop the program, so don't worry, it won't go crazy
- Remember to specify all the pipelines you want to run in the
pipeline
list, otherwise it won't run
-
To run (inside the docker container):
./conversion.py -c < path to your config file >
- The library currently only supports conversion from mp4 to rosbag/directory of images, but the coding structure is general enough to add other input/output later, e.g., rosbag input, csv output(for IMU, point cloud, etc.)
- The library can concurrently convert multiple files, i.e. multiple pipelines, using Threading
- mp4 reading is using GStreamer, with NVIDIA DeepStream plugin to enable
nvvideoconvert
pipeline for Nvidia's hardware-accelerated decoding onNVDEC
- Please follow the example config for config file format, and follow the
./config
folder structure if you need to push your config - Should you run into any trouble, please try the Jupyter Notebook
- Author: Mukai (Tom Notch) Yu: [email protected]
-
Setup your development environment
sudo ./scripts/setup.sh
This will install
pre-commit
hooks and its dependencies locally, so that each time before you commit, the code will be formatted and linted automatically. Remember togit add .
aftergit commit
failed sincepre-commit
will modify source code in-place. -
Check the GitHub webpage after a few minutes to see if the CI passed. Passing CI will have a green check mark on the commit
- If not, please fix the errors and push again
- Add more input/output classes that can connect to more formats
- append input/output types in macros.py and initializations in pipeline.py