Skip to main content

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:

  1. Install Docker on an Ubuntu machine. (You will only need Ubuntu to compile once; IKFast should work cross-platform.)
  2. Follow the instructions on pyikfast.
  3. Save the cpp file that is generated. You won't need the other files.
  4. Make a new directory in this repository inside third_party/ikfast. Copy in the cpp file and rename it to match the existing examples (e.g., ikfast_panda_arm.cpp.)
  5. Modify the cpp file 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 like ikfast_panda_arm.cpp).
  6. Copy in the other files from an example directory like third_party/ikfast/panda_arm. Modify robot_name in setup.py.
  7. Add IKInfo inside your new robot class in robots/.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybullet_helpers-0.1.1.tar.gz (94.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybullet_helpers-0.1.1-py3-none-any.whl (95.2 MB view details)

Uploaded Python 3

File details

Details for the file pybullet_helpers-0.1.1.tar.gz.

File metadata

  • Download URL: pybullet_helpers-0.1.1.tar.gz
  • Upload date:
  • Size: 94.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.16

File hashes

Hashes for pybullet_helpers-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d486de97afd0a44c905a7a6b60abecbb76954ba3c48f126db061f960017da93d
MD5 dd3b592398225d822307a665a412dd1c
BLAKE2b-256 b18eaaaf4f2eaf3864b7c44303bb37a81f8c953e8e0ee61c43701f1f73beefbf

See more details on using hashes here.

File details

Details for the file pybullet_helpers-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pybullet_helpers-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 04b77f190cb382a1a91c22ae0b3bff145a7534b8338a400afdb6d0855a48923a
MD5 76f58d30fc3120b5aac384c49e4e0003
BLAKE2b-256 777d575a58fb1ace2c3920d50c12f6fa86b272f47e9a31991f55a8956c7b3d9f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page