Giter Site home page Giter Site logo

caelan / pybullet-planning Goto Github PK

View Code? Open in Web Editor NEW
384.0 8.0 109.0 119.51 MB

PyBullet Planning

Home Page: https://pypi.org/project/pybullet-planning/

License: MIT License

Python 27.93% C++ 71.63% CMake 0.01% Shell 0.01% PDDL 0.42%
bullet-physics python pybullet planning-algorithms pybullet-planning ss-pybullet motion-planning robotics pr2 movo

pybullet-planning's Introduction

pybullet-planning (previously ss-pybullet)

A repository of PyBullet utility functions for robotic motion planning, manipulation planning, and task and motion planning (TAMP). This repository was originally developed for the PDDLStream (previously named STRIPStream) approach to TAMP.

With the help of Yijiang Huang, a stable and documented fork of pybullet-planning named pybullet_planning is available through PyPI. However, new features will continue to be introduced first through pybullet-planning.

Citation

Caelan Reed Garrett. PyBullet Planning. https://pypi.org/project/pybullet-planning/. 2018.

Installation

Install for macOS or Linux using:

$ git clone --recurse-submodules https://github.com/caelan/pybullet-planning.git
$ cd pybullet-planning
pybullet-planning$ pip install -r requirements.txt

pybullet-planning is intended to have ongoing support for both python2.7 and python3.*

Make sure to recursively update pybullet-planning's submodules when pulling new commits.

pybullet-planning$ git pull --recurse-submodules

IKFast Compilation

We recommend using IKFast, an analytical inverse kinematics solver, instead of PyBullet's damped least squares solver. IKFast bindings are included for the following robots:

  • Franka Panda - pybullet-planning$ (cd pybullet_tools/ikfast/franka_panda; python setup.py)
  • MOVO - pybullet-planning$ (cd pybullet_tools/ikfast/movo; python setup.py)
  • PR2 - pybullet-planning$ (cd pybullet_tools/ikfast/pr2; python setup.py)

To create IKFast bindings for a new robot, following the instructions in ikfast_pybind.

Tests

  1. Test PyBullet - pybullet-planning$ python -c 'import pybullet'

Tutorial

test_turtlebot - $ python -m examples.test_turtlebot

Heavily annotated simple example that demonstrates:

  • Creating a PyBullet simulation
  • Waiting for user input (useful on macOS)
  • Programmatically creating objects
  • Getting/setting object base poses
  • Loading a robot URDF
  • Getting/setting robot joint positions
  • Looking up named robot links and joints
  • Computing an object's current Axis-Aligned Bounding Box (AABB)
  • Drawing coordinate frames and bounding boxes
  • Checking collisions between two objects
  • Temporarily disabling rendering for efficiency purposes

Planning Examples

Debug Examples

PDDLStream Examples

See the following examples: https://github.com/caelan/pddlstream/tree/master/examples/pybullet

Forks

Gallery

PyBullet Resources

Bullet Resources

pybullet-planning's People

Contributors

aidan-curtis avatar caelan avatar cpaxton avatar yijiangh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pybullet-planning's Issues

Grasping Issue

Hi,

I am trying to grasp small blocks in pybullet using the PR2 gripper. However, I notice that there are some artifacts that I encounter while actually grasping the objects. This leads to significant inconsistencies. I have attached a gif of one such artifact. Can someone confirm the source of this issue and possible solutions?

In the example below, the gripper is closed by position controlling to a pre-determined value. There are also cases, where the gripper does not properly grasp the object causing it to fall.

The PR2 model was taken from this repository.

ezgif com-gif-maker

question about test_kuka_pick.py

I build pybullet and pybullet_plan on my Windows system. but when I run the 'test_kuka_pick.py' ,I got an error in 'utils.py' ,'No module named 'motion_planners'. I want to know how to deal with this error.

Cannot find a plan with test_kuka_pick.py( switch to a franka robot)

Hi, Caelan,

I hope you are doing well.

I imported the PANDA_ARM_URDF instead of DRAKE_IIWA_URDF in test_kuka_pick.py, and I modified the TOOL_FRAMES in the kuka_primitives.py by adding the term 'panda': "panda_leftfinger", while there is no plan for the Franka robot to pick the block.
I further investigated the code and found that the function inverse_kinematics(), the kinematic_conf is not in the between of [lower_limits, upper_limits].
Could you try to use the Franka robot to pick up the block?
Btw, I'm working on a research project about LLM&TAMP, which is highly close to your fantastic work. If you are interested, we could talk for the potential collaboration :)

Bests,
Shu

Multiple IK solutions

Hello, Thanks for such a great library.
I have a problem where I do not know the current joint config and I am required to get multiple Ik solutions of Franka panda given the current end-effector position and orientation.
I looked up the ikfast.py file and there I found pybullet_inverse_Kinematics function .
if I set max-attempts arg greater than 1 would I will be able to get multiple Ik solutions?
If not can you help how can I get multiple Ik solutions then for such a problem?
Thanks

test_turtlebot.py: addition on lists throws TypeError

python -m examples.test_turtlebot crashes due to this TypeError:

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/abhishek/pybullet-planning/examples/test_turtlebot.py", line 98, in <module>
    main()
  File "/home/abhishek/pybullet-planning/examples/test_turtlebot.py", line 84, in main
    center = (lower + upper)/2. # Computing the center of the AABB
TypeError: unsupported operand type(s) for /: 'list' and 'float'

robot_aabb = get_subtree_aabb(robot, base_link) # Computes the robot's axis-aligned bounding box (AABB)
lower, upper = robot_aabb # Decomposing the AABB into the lower and upper extrema
center = (lower + upper)/2. # Computing the center of the AABB

Since lower and upper are both type list, adding them results in concatenation instead of element-wise addition.

movo installation instructions

In the README, should the third command in the movo installation instructions be

python setup.py -a right
instead of
python setup.py -a arm ?

question about IKFast inverse kinematics arguments

Hi Caelan :) I hope you're well!

I have a question about the arguments to IKFast inverse kinematics. I'm looking here:

for conf in randomize(compute_inverse_kinematics(ikfast.get_ik, base_from_ee, free_positions)):

The argument that I don't understand is free_positions. I'm guessing that this has something to do with wanting multiple possible solutions from the solver. But what does the IKFast solver expect for that argument? Sorry that I can't find documentation on the IKFast side for this.

Thanks for your help!

Help to build the examples

Hello,

I'm trying to run these examples on my ubuntu 18.x VM.
I managed to install pybullet and numpy.But when i run the test, i get this

Traceback (most recent call last):
File "", line 1, in
ImportError: No module named ss

Thanks for your help.
When i try to run to run the kuka test, i also get some errors

pybullet build time: Mar 5 2019 09:25:16
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/thermo/Documents/dev/ss-pybullet/examples/test_kuka_pick.py", line 5, in
from pybullet_tools.kuka_primitives import BodyPose, BodyConf, Command, get_grasp_gen,
File "/home/thermo/Documents/dev/ss-pybullet/pybullet_tools/kuka_primitives.py", line 4, in
from .pr2_utils import get_top_grasps
File "/home/thermo/Documents/dev/ss-pybullet/pybullet_tools/pr2_utils.py", line 11, in
from .utils import multiply, get_link_pose, joint_from_name, set_joint_position, joints_from_names,
File "/home/thermo/Documents/dev/ss-pybullet/pybullet_tools/utils.py", line 20, in
from motion_planners.rrt_connect import birrt, direct_path
ModuleNotFoundError: No module named 'motion_planners'

Thanks for your help,
Michael

What should I set the "free_joints" in IKFastInfo for my Fetch robot?

Hi,

I'd like to build an ikFast module for a Fetch robot and use it in pybullet env.

Based on what you have for the franka_panda robot:

  1. I created the ikfast solver for my fetch's arm via "ikmodel.autogenerate()" and get the files "ikfast.h, ikfast_fetch_arm.cpp, ikfast_fetch_arm.so";
  2. I copied the python bindings stuff (line 12835 - 12995) in "ikfast_panda_arm.cpp" into my "ikfast_fetch_arm.cpp";
  3. I also copied all relevant files into my workspace;
  4. After running "compile_ikfast", it shows "ikfast module ikfast_fetch_arm imported successful"

I noticed you set a free_joint for panda in ik.py, I was wondering what this free_joint means?

If I leave it as an empty list, I got an error saying "get_ik function takes exactly 3 arguments (2 given)" for line 26 shown below:

Screenshot from 2020-10-13 16-59-12

If I set the free_joint as "wrist_roll_joint", I always get none solution. Is this because I didn't set correct free_joints? if so do you have any idea what the correct joint to be set? Thank you very much!

I also attached the output of dump_body(robot) below:

Screenshot from 2020-10-13 17-01-54

License ?

Hello, under what license is this project released under ? I would like to study it to learn more about PyBullet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.