This is a PyBullet tutorial for CS4278/CS5478 Intelligent Robots: Algorithms and Systems. This repository contains a step-by-step introduction to PyBullet for robotics simulation. The tutorial is structured into six example scripts. It covers basic simulation, loading robots, forward & inverse kinematics, control, and a full pick-and-place demo with the Franka Panda arm.
-
Minimal example: connect to PyBullet, load a plane and a falling cube, step the simulation.
-
Teaches how to:
- Start/stop simulation
- Load URDF assets
- Get object states (
getBasePositionAndOrientation
)
-
Load the Franka Panda arm and keep it fixed at the base.
-
Demonstrates:
- Inspecting joints
- Disabling default motors
- Understanding fixed base vs free base
-
Visualize robot link frames using a small URDF marker.
-
Demonstrates:
getLinkState
to get a link’s world transform- Attaching markers to links for FK visualization
- Understanding Panda’s link hierarchy
-
Add GUI sliders for an interactive IK demo.
-
Demonstrates:
calculateInverseKinematics
- Using GUI sliders to set EE target pose
- Comparing target vs current EE frame
-
Replace direct joint resets with PD controllers.
-
Demonstrates:
POSITION_CONTROL
mode- Effects of P/D gains and torque limits
-
Full pipeline: detect cube, compute grasp poses, move Panda with IK+PD, control gripper, place cube at a target.
-
Features:
- Random red cube dropped in front of robot
- Random green cube as goal (visual only)
- Keyposes (pregrasp, grasp, lift, place) visualized with markers + labels
- Gripper open/close with prismatic joints
- Helpers for joint limits, object settling, and smooth IK
-
Install dependencies:
pip install pybullet numpy
-
Clone this repo and run examples:
python 000_hello_pybullet.py python 001_get_a_robot.py ... python 005_pick_and_place.py
-
Assets:
-
Place additional URDFs under
assets/
:assets/plane/plane.urdf
assets/franka_panda/panda.urdf
assets/frame_marker/
assets/cubes/5cm_green_cube.urdf
,5cm_red_cube.urdf
-