This is a collection of utilities I've found useful for working with PyBullet, including:
- Collision detection: conveniently set up shortest distance computations and collision checking between arbitrary objects in arbitrary configurations with PyBullet. See the accompanying blog post.
- Ghost objects: add purely visual objects to the simulation, optionally attached to another body.
- Camera: virtual camera from which to get RGBA, depth, segmentation, and point cloud data. Also provides video recording using OpenCV.
This package requires Python 3.7+. It has been tested on Ubuntu 16.04, 18.04, and 20.04.
pip install pyb_utils
Clone the repo:
git clone https://github.com/adamheins/pyb_utils
cd pyb_utils
Install using poetry:
poetry install
poetry run python scripts/collision_detection_example.py # for example
Or using pip:
python -m pip install .
You can find example scripts demonstrating all of this package's utilities in
the scripts/
directory:
Feel free to open issues (or better yet, a pull request!) if you find a problem. Currently known issues:
- Video recording does not output MP4 videos correctly. The AVI format works, however.
- Ghost objects sometimes flicker (spooky, but undesirable).