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 ./scriptsTo run (automatically pulls if missing) & attach:
./scripts/run.sh
docker attach BagXTo pull:
./scripts/pull.shTo build:
./scripts/build.shIf 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_PATHin ./scripts/variables.sh according to your data directory on your host machineDATASET_PATHwill be mounted to~/datainside the docker container- Remember to run ./scripts/run.sh again after modifying the
DATASET_PATHto 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
pipelinelist, 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
nvvideoconvertpipeline for Nvidia's hardware-accelerated decoding onNVDEC - Please follow the example config for config file format, and follow the
./configfolder 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-commithooks and its dependencies locally, so that each time before you commit, the code will be formatted and linted automatically. Remember togit add .aftergit commitfailed sincepre-commitwill 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