robologs-ros-utils is a collection of utility functions to extract, convert and analyze ROS data.
Installing robologs-ros-utils is easy using the pip package manager.
We suggest that you use a clean environment to avoid any dependency conflicts:
pip install robologs-ros-utils
From here, you can use robologs-ros-utils in your Python code as follows:
from robologs_ros_utils.sources.ros1 import ros_utils
ros_utils.get_images_from_bag(
rosbag_path="/path/to/rosbag.bag",
output_folder="/output_imgs/",
file_format="jpg",
create_manifest=True,
topics=["/camera/image_raw"],
naming="sequential",
resize=[640,480],
sample=2,
start_time=0,
end_time=10)
After you install robologs-ros-utils, you can also use the command line utilities to extract data from rosbag files.
Run the following command to see the available options:
robologs-ros-utils --help
If you want to extract images from the command line:
robologs-ros-utils get-images --help
Or if you want to get metadata from a rosbag file:
robologs-ros-utils get-summary --help
You can build a local version of the robologs-ros-utils Docker image as follows:
./build_image.sh
And here is how you can run a robologs-ros-utils command inside the Docker image:
docker run -v ~/Desktop/scratch/:/input/ -it --rm robologs-ros-utils-image robologs-ros-utils get-videos -i /input/example_bag_small.bag -o /input/ --naming rosbag_timestamp --format jpg --save-images
If you have any questions, comments, or want to chat, please join our Discord channel.
# activate poetry shell
poetry shell
# install dependencies
poetry update
cd ~/Code/robologs-ros-utils/python/
# run the tests
poetry run coverage run -m --source=robologs_ros_utils pytest tests
# run the coverage report
poetry run coverage report
# run black -> remove the --check to reformat
poetry run black --check .
# run my py
poetry run mypy robologs_ros_utils/sources/
# run isort -> remove the --check to reformat
poetry run isort --check-only .
# clean local build
./clean_build.sh
# build pip package
poetry build
# install pip package
pip install dist/robologs_ros_utils-XX-none-any.whl
# run the CLI
robologs-ros-utils --help
We welcome contributions to robologs-ros-utils. Please see our contribution guide and our development guide for details.
Made with contrib.rocks.