← udacity portfolio
robotics nd · control planning · June 2019

PR2 Kinematics Pick-and-Place

Solve the PR2's 7-DOF inverse kinematics symbolically, then drive arm-joint trajectories to pick and place objects. Sympy + ROS + tears.

What it did

The Kinematics module’s capstone in the Robotics nanodegree. Given a target end-effector pose (position + orientation) and the PR2’s 7-link arm, solve the inverse kinematics analytically: compute the six joint angles that put the gripper exactly there. Drive the resulting joint trajectory via ROS + MoveIt! to execute pick-and-place.

The math

PR2’s arm has a “spherical wrist” — the last three axes intersect at a single point. That decoupling lets you split IK into two solvable sub-problems:

  1. Wrist center. Subtract the offset along the gripper z-axis from the target position. Solve θ1, θ2, θ3 geometrically (law of cosines on the upper arm + forearm triangle).
  2. Wrist orientation. Compute R_3_6 = inv(R_0_3) · R_target via Sympy; extract θ4, θ5, θ6 from the rotation matrix.

Derive the DH parameters once (a, α, d, θ offset per link), then forward-kinematics via T = T1 · T2 · ... · T7 for verification.

What was actually tricky

What I’d do differently with hindsight

What it taught me

Forward kinematics is multiplication; inverse kinematics is craft. The “right” IK depends on the arm’s geometry (decoupled wrist or not), the singularity behavior you want, and how much you trust numerical solvers. Most of robotics is like this: the textbook answer exists, and then the engineering answer reshapes it for the actual robot.


Source archive: Shivam-Bhardwaj/pick_and_place (archived)
Writeup last touched: 2026-05-22