Some utility functions for PyBullet.
Project description
pybullet-helpers
Some utility functions for PyBullet. Copied and modified from predicators, which in turn was heavily based on the pybullet-planning repository by Caelan Garrett (https://github.com/caelan/pybullet-planning/). In addition, the structure is loosely based off the pb_robot repository by Rachel Holladay (https://github.com/rachelholladay/pb_robot). Will Shen made huge contributions.
Requirements
- Python 3.10+
- Tested on MacOS Catalina
Installation
We strongly recommend uv. The steps below assume that you have uv installed. If you do not, just remove uv from the commands and the installation should still work.
# Install PRPL dependencies.
uv pip install -r prpl_requirements.txt
# Install this package and third-party dependencies.
uv pip install -e ".[develop]"
Check Installation
Run ./run_ci_checks.sh. It should complete with all green successes in 5-10 seconds.
Adding New Robots
To add a new robot, build off an existing example. For inverse kinematics, PyBullet's IK solver will be used by default. It is not very good. IKFast is much better, but then you need to compile robot-specific IK models. This process needs to be automated further, but here is some guidance:
- Install Docker on an Ubuntu machine. (You will only need Ubuntu to compile once; IKFast should work cross-platform.)
- Follow the instructions on pyikfast.
- Save the
cppfile that is generated. You won't need the other files. - Make a new directory in this repository inside
third_party/ikfast. Copy in thecppfile and rename it to match the existing examples (e.g.,ikfast_panda_arm.cpp.) - Modify the
cppfile in two ways: (1) Add#include "Python.h"at the top; (2) add python bindings at the bottom (copy and change the robot name from an existing example likeikfast_panda_arm.cpp). - Copy in the other files from an example directory like
third_party/ikfast/panda_arm. Modifyrobot_nameinsetup.py. - Add
IKInfoinside your new robot class inrobots/.
Contributions are welcome to improve this process, especially steps 3 onward.
*Note for Robot URDFs: For consistency with Bullet IK, ensure that the inertial frame of the robot URDF's base link is not offset from the its link frame. If that's necessary, a possible workaround is to add a dummy base link to the URDF and connecting this to the real base link via a fixed joint.
<link name="dummy_base" />
<joint name="dummy_joint" type="fixed">
<parent link="dummy_base"/>
<child link="panda_link0"/>
<origin xyz="0 0 0" rpy="0 0 0"/>
</joint>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pybullet_helpers-0.1.0.tar.gz.
File metadata
- Download URL: pybullet_helpers-0.1.0.tar.gz
- Upload date:
- Size: 94.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9212e36aab9f4321b4e6792dbc127763ae72327b976eb0cb049aa3451d84b0bf
|
|
| MD5 |
03bc6951a2f372535ac3c46405fc6195
|
|
| BLAKE2b-256 |
6760393d4bbc3089b21833f3137d661ba8e62c1f56f931fb5c939370118a13e9
|
File details
Details for the file pybullet_helpers-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pybullet_helpers-0.1.0-py3-none-any.whl
- Upload date:
- Size: 95.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f39cd27dc91d4cc55201f31d5b9b0b066d2037b81006b6174253d24889600804
|
|
| MD5 |
e47b967372aafac58c89138f095f2898
|
|
| BLAKE2b-256 |
386eaf0641af62151f3acdf345982dfdfa27687fc7dc29f3941bb1d60382a6c7
|