Week 03 | SKILL-022

IK in the Real World: Industrial Arms, Humanoids, and Beyond

Published: April 12, 2026 | Author: Smartotics Learning Journey | Reading Time: 10 min

This week we’ve built the mathematical foundations of inverse kinematics. Today let’s see where the rubber meets the road — how real robots use IK to perform tasks that matter.

Industrial Robot Arms

The Pick-and-Place Problem

The most common industrial task: pick up an object from one location and place it at another. Here’s how IK makes it happen:

import numpy as np

class PickAndPlacePlanner:
    """
    Plans a pick-and-place trajectory using IK waypoints.
    
    Real industrial controllers use similar concepts but with
    much more sophisticated trajectory planning (e.g., trapezoidal
    velocity profiles, splines).
    """
    
    def __init__(self, fk_func, jacobian_func, ik_solver, n_joints=6):
        self.fk = fk_func
        self.jacobian = jacobian_func
        self.solve_ik = ik_solver
        self.n_joints = n_joints
    
    def plan_waypoints(self, pick_pos, place_pos, approach_height=0.15):
        """
        Generate IK waypoints for a complete pick-and-place cycle:
        1. Move above pick position
        2. Lower to pick position
        3. Grip (not handled by IK)
        4. Lift
        5. Move above place position
        6. Lower to place position
        7. Release (not handled by IK)
        8. Lift
        """
        waypoints = [
            ("above_pick",  np.array([pick_pos[0], pick_pos[1], pick_pos[2] + approach_height])),
            ("at_pick",     pick_pos),
            ("lift_pick",   np.array([pick_pos[0], pick_pos[1], pick_pos[2] + approach_height])),
            ("transit",     np.array([place_pos[0], place_pos[1], max(pick_pos[2], place_pos[2]) + approach_height])),
            ("above_place", np.array([place_pos[0], place_pos[1], place_pos[2] + approach_height])),
            ("at_place",    place_pos),
            ("lift_place",  np.array([place_pos[0], place_pos[1], place_pos[2] + approach_height])),
        ]
        
        trajectory = []
        q_current = np.zeros(self.n_joints)  # Home position
        
        for name, target in waypoints:
            q_target, converged, _ = self.solve_ik(target, q_current)
            if not converged:
                print(f"Warning: IK failed at waypoint '{name}'")
            trajectory.append({"name": name, "q": q_target, "pos": target})
            q_current = q_target  # Seed next IK with previous solution
        
        return trajectory

# Usage example (simplified)
print("Pick-and-Place Planning (conceptual):")
print("=" * 45)
print("1. Solve IK for approach pose above pick")
print("2. Solve IK for grasp pose at pick location")
print("3. Solve IK for lift pose")
print("4. Solve IK for transit pose (high arc)")
print("5. Solve IK for approach pose above place")
print("6. Solve IK for place pose")
print("7. Solve IK for lift pose (retreat)")
print()
print("Key insight: seeding each IK solve with the")
print("previous solution ensures smooth, continuous")
print("joint trajectories between waypoints.")

Real Industrial IK Considerations

Collision-free motion planning is critical. Real systems combine IK with motion planners like RRT (Rapidly-exploring Random Trees) or trajectory optimization:

  1. IK solves “what angles reach this point?”
  2. Motion planning solves “how do I get there without hitting anything?”

Tools like MoveIt! (ROS) and KUKA Sunrise handle both layers.

Specific Industrial Arms

RobotDOFIK MethodSpecial Features
UR5e (Universal Robots)6Analytical + numericalCollaborative, force sensing
KUKA LBR iiwa7Damped least squaresTorque control, collision detection
Franka Emika Panda7Null space optimization7-DOF, impedance control
ABB IRB 12006Analytical (closed-form)Fast cycle times

Humanoid Robots

The IK Challenge in Humanoids

Humanoid robots face IK problems at multiple levels simultaneously:

  1. Arm IK: Reaching, grasping, manipulating (similar to industrial arms)
  2. Leg IK: Computing joint angles for foot placement during walking
  3. Whole-body IK: Coordinating arms, legs, and torso together

Bipedal Walking IK

For a simplified walking gait, the leg IK computes hip, knee, and ankle angles given a desired foot position:

def leg_ik(hip_pos, ankle_pos, knee_sign=1):
    """
    IK for a planar 3-DOF leg (hip, knee, ankle).
    
    Args:
        hip_pos: [x, y] position of the hip joint
        ankle_pos: [x, y] desired ankle position
        knee_sign: +1 for knee forward, -1 for knee backward
    
    Returns:
        (hip_angle, knee_angle) in radians
    """
    L_thigh = 0.4   # 40 cm thigh
    L_shin = 0.4    # 40 cm shin
    
    # Vector from hip to ankle
    dx = ankle_pos[0] - hip_pos[0]
    dy = ankle_pos[1] - hip_pos[1]
    d = np.sqrt(dx**2 + dy**2)
    
    if d > L_thigh + L_shin:
        return None  # Unreachable
    
    # Hip angle using law of cosines
    cos_knee = (d**2 - L_thigh**2 - L_shin**2) / (2 * L_thigh * L_shin)
    cos_knee = np.clip(cos_knee, -1, 1)
    knee_angle = knee_sign * np.arccos(cos_knee)
    
    # Hip angle
    alpha = np.arctan2(dy, dx)
    cos_beta = (d**2 + L_thigh**2 - L_shin**2) / (2 * d * L_thigh)
    cos_beta = np.clip(cos_beta, -1, 1)
    beta = np.arccos(cos_beta)
    
    hip_angle = alpha + knee_sign * beta
    
    return hip_angle, knee_angle

# Generate a walking gait
print("Simplified Walking Gait Generation:")
print("=" * 40)

hip_y = 0.85  # Hip height (standing)
stride_length = 0.3
step_height = 0.05

foot_positions = []
for phase in np.linspace(0, 2 * np.pi, 20):
    x = stride_length * np.sin(phase)
    y = -hip_y + step_height * max(0, np.sin(phase)) * (1 if np.sin(phase) > 0 else 0)
    foot_positions.append((x, -hip_y + abs(step_height * np.sin(phase)) * np.heaviside(np.sin(phase), 0)))

for i, (fx, fy) in enumerate(foot_positions[:5]):
    result = leg_ik([0, hip_y], [fx, fy])
    if result:
        ha, ka = result
        print(f"  Step {i}: foot=({fx:.3f}, {fy:.3f}) → "
              f"hip={np.degrees(ha):.1f}°, knee={np.degrees(ka):.1f}°")

Whole-Body IK

Advanced humanoid platforms like Tesla Optimus, Figure 02, and Unitree H1 use whole-body IK frameworks that:

The math is a combination of everything we’ve learned: analytical IK where possible, numerical methods for complex chains, and null space optimization for balance and style.

Computer Graphics and Animation

Beyond physical robots, IK is fundamental in computer graphics:

CCD and FABRIK are the dominant algorithms here because they’re fast, stable, and produce natural-looking results.

Surgical Robotics

Systems like the da Vinci Surgical System use IK at millimeter precision:

Key Takeaways

Next Steps

Tomorrow wraps up Week 3 with a comprehensive summary of everything we’ve learned about inverse kinematics, plus a preview of what’s coming in Week 4.