<div align="center">

# Robotic Manipulator — Kinematics, Trajectory & Simulation Studio

**6-DOF Puma 560 kinematics, App Designer GUI, quintic & cubic trajectory planning, Yoshikawa manipulability analysis, and 2-DOF PR workshop labs in MATLAB — backed by a 7-check Python verification suite.**

[![MATLAB](https://img.shields.io/badge/MATLAB-R2024a-0076A8?style=for-the-badge&logo=mathworks&logoColor=white)](https://github.com/rohaan2802/Robotic_Manipulator)
[![Python](https://img.shields.io/badge/Python-3.14%20Verification-3776AB?style=for-the-badge&logo=python&logoColor=white)](tests/verify_python_sim.py)
[![Puma 560](https://img.shields.io/badge/6--DOF-Puma%20560-0F766E?style=for-the-badge)](src/kinematics_app/ManipulatorApp.m)
[![NAO_ROB](https://img.shields.io/badge/2--DOF-NAO__ROB%20PR-4338CA?style=for-the-badge)](src/workshops/nao_seriallink_demo.m)
[![Trajectory](https://img.shields.io/badge/Trajectory-Quintic%20%26%20Cubic-B45309?style=for-the-badge)](src/trajectory_planning/quintic_trajectory.m)
[![App Designer](https://img.shields.io/badge/GUI-App%20Designer-0F4C81?style=for-the-badge)](src/kinematics_app/ManipulatorApp.m)
[![Checks](https://img.shields.io/badge/Verification-7%2F7%20Passed-15803D?style=for-the-badge)](tests/verify_python_sim.py)
[![License](https://img.shields.io/badge/License-MIT-CA8A04?style=for-the-badge)](LICENSE)

</div>

---

## Live Links

| What | Link |
|------|------|
| Repository | [https://github.com/rohaan2802/Robotic_Manipulator](https://github.com/rohaan2802/Robotic_Manipulator) |
| Website (GitHub Pages) | [https://rohaan2802.github.io/Robotic_Manipulator/](https://rohaan2802.github.io/Robotic_Manipulator/) |
| App Designer Entry Point | [https://github.com/rohaan2802/Robotic_Manipulator/blob/main/src/kinematics_app/ManipulatorApp.m](https://github.com/rohaan2802/Robotic_Manipulator/blob/main/src/kinematics_app/ManipulatorApp.m) |

---

## Table of Contents

1. [Live Links](#live-links)
2. [Overview](#overview)
3. [What's Inside](#whats-inside)
4. [Kinematics & Workspace Analysis](#kinematics--workspace-analysis)
5. [Trajectory Planning & Benchmarks](#trajectory-planning--benchmarks)
6. [Workshop Labs, Manuals & Coursework](#workshop-labs-manuals--coursework)
7. [Project Breakdown & Bug Fixes](#project-breakdown--bug-fixes)
8. [Folder Structure](#folder-structure)
9. [Setup & Running](#setup--running)
10. [Demo & Verification](#demo--verification)
11. [Results](#results)
12. [Limitations](#limitations)
13. [Screenshots](#screenshots)
14. [License](#license)
15. [Author](#author)

---

## Overview

This repository consolidates robotic manipulator engineering coursework and simulation modules into a clean, modular, and recruiter-ready codebase:

- **Interactive 6-DOF Kinematics Studio (`ManipulatorApp.m`)** — App Designer GUI for planar 4×4 pose computation, Puma 560 forward kinematics (`getTransform`), geometric Jacobian singularity probing (`geometricJacobian`), workspace-gated inverse kinematics (`inverseKinematics`), joint-limit validation, and semicircle reach animation.
- **Reachable Workspace & Manipulability Analyzer (`workspace_analyzer.m`)** — Monte Carlo joint-space sampling computing maximum radial reach and Yoshikawa's manipulability index $w = \sqrt{\det(JJ^T)}$.
- **Trajectory Planning & Benchmarking (`quintic_trajectory.m`, `cubic_vs_quintic_benchmark.m`)** — Solves the 6×6 boundary-value system $A\mathbf{a} = \mathbf{b}$ for rest-to-rest motion ($t_0 = 3\text{ s} \to t_f = 8\text{ s}$, $q: 0 \to \pi/2\text{ rad}$) and benchmarks 5th-order quintic vs. 3rd-order cubic profiles.
- **Workshop Manipulator Labs (`src/workshops/`)** — 2-DOF Prismatic–Revolute (`NAO_ROB`) `SerialLink` simulation and Puma 560 closed-form `ikine6s` target pose verification, plus 7 unique workshop/toolbox PDF manuals.
- **Automated Verification (`tests/`)** — Both a MATLAB test suite (`verify_kinematics.m`, `run_demo.m`) and a zero-MATLAB-dependency Python verification script (`verify_python_sim.py`).


---

## What's Inside

| Module | Path | Key Capabilities |
|--------|------|------------------|
| **Kinematics App** | [src/kinematics_app/ManipulatorApp.m](src/kinematics_app/ManipulatorApp.m) | Cached Puma 560 `RigidBodyTree`, FK, IK, workspace gate, Jacobian singularity check, DH table & animation |
| **Workspace Analyzer** | [src/kinematics_app/workspace_analyzer.m](src/kinematics_app/workspace_analyzer.m) | Monte Carlo reachable workspace & Yoshikawa manipulability $w$ evaluation |
| **Quintic Trajectory** | [src/trajectory_planning/quintic_trajectory.m](src/trajectory_planning/quintic_trajectory.m) | 5th-order polynomial solver (`A\b`), endpoint verification, 3-panel plot |
| **Cubic vs. Quintic** | [src/trajectory_planning/cubic_vs_quintic_benchmark.m](src/trajectory_planning/cubic_vs_quintic_benchmark.m) | Peak velocity, acceleration, and jerk comparison between 3rd- and 5th-order trajectories |
| **Workshop 1 (NAO_ROB)** | [src/workshops/nao_seriallink_demo.m](src/workshops/nao_seriallink_demo.m) | 2-DOF PR `SerialLink`, stroke limits `[0, 5] m`, `fkine([4, 0.3])` |
| **Workshop 2 (Puma IK)** | [src/workshops/puma560_ik_demo.m](src/workshops/puma560_ik_demo.m) | Fixed `ws#02.m` syntax error, `qz` plot, `trplot(T)`, closed-form `ikine6s` |
| **Python Verification** | [tests/verify_python_sim.py](tests/verify_python_sim.py) | Standalone NumPy DH/FK/IK/manipulability/trajectory verification (7/7 checks passing) |
| **MATLAB Tests** | [tests/verify_kinematics.m](tests/verify_kinematics.m) | Automated MATLAB checks for quintic BCs, planar SE(3), workspace gates, and Puma IK |
| **Archived Originals** | [archive/original_coursework/](archive/original_coursework/) | Preserved unedited university scripts (`assignment_app.m`, `ass1.m`, `Robot_.m`, `ws#02.m`) |

---

## Kinematics & Workspace Analysis

### Puma 560 Standard Denavit–Hartenberg Parameters

| Joint $i$ | $\theta_i$ | $d_i$ (m) | $a_i$ (m) | $\alpha_i$ (deg) | Position Limits (deg) | Role |
|-----------|------------|-----------|-----------|-------------------|-----------------------|------|
| 1 | $\theta_1$ | `0.0000` | `0.0000` | `+90°` | `[-160°, +160°]` | Waist |
| 2 | $\theta_2$ | `0.0000` | `0.4318` | `0°` | `[-110°, +110°]` | Shoulder |
| 3 | $\theta_3$ | `0.15005` | `0.0203` | `−90°` | `[-135°, +135°]` | Elbow |
| 4 | $\theta_4$ | `0.4318` | `0.0000` | `+90°` | `[-266°, +266°]` | Wrist Roll |
| 5 | $\theta_5$ | `0.0000` | `0.0000` | `−90°` | `[-100°, +100°]` | Wrist Pitch |
| 6 | $\theta_6$ | `0.0000` | `0.0000` | `0°` | `[-266°, +266°]` | Wrist Yaw |

### Workspace Gate & Singularity Rules (`ManipulatorApp.m`)

- **Radial bounds:** $0.50\text{ m} \le r = \sqrt{x^2 + y^2} \le 1.00\text{ m}$
- **Azimuth bounds:** $-90^\circ \le \theta = \operatorname{atan2d}(y, x) \le +90^\circ$
- **Vertical bound:** $z \ge 0.00\text{ m}$
- **Singularity probe:** Evaluates `abs(det(geometricJacobian(robot, q, 'link6'))) < 1e-6` and warns the user in the UI overlay.
- **Yoshikawa Manipulability:** $w(\mathbf{q}) = \sqrt{\det(J(\mathbf{q}) J(\mathbf{q})^T)}$ evaluated across 600 Monte Carlo joint samples (`workspace_analyzer.m`).
- **Damped Least-Squares IK Update:** $\Delta \mathbf{q} = J^T (J J^T + \lambda^2 I_3)^{-1} (\mathbf{p}_{\text{target}} - \mathbf{p}_{\text{fk}}(\mathbf{q}))$ with damping $\lambda = 0.05$.

---

## Trajectory Planning & Benchmarks

For rest-to-rest motion from $q(3) = 0$ to $q(8) = \pi/2\text{ rad}$ ($v_0 = 2\times 10^{-9}, v_f = 5\times 10^{-9}, a_0 = a_f = 0$):

- **Solved Quintic Coefficients (`A\b`):** `a5 = +0.00301650`, `a4 = -0.08295380`, `a3 = +0.89238198`, `a2 = -4.64541294`, `a1 = +11.61353233`, `a0 = -11.03285570`

| Metric | Cubic (3rd-Order) | Quintic (5th-Order) | Engineering Advantage |
|--------|-------------------|---------------------|-----------------------|
| Peak Velocity $\|v\|_{\max}$ | `0.4712 rad/s` | `0.5890 rad/s` | Smooth bell-shaped profile |
| Endpoint Acceleration | `±0.3770 rad/s²` (step jump) | `0.0000 rad/s²` | Eliminates actuator torque shock |
| Boundary Residual | — | `9.77e-15` | Exact `A\b` machine-precision fit |

### End-to-End Test Case Matrix

| Test Case | Module | Input | Expected / Measured Output |
|-----------|--------|-------|----------------------------|
| **Planar Pose** | `ManipulatorApp.m` | `θ = [30°, 45°, 10°, 0°]` | `X = 1.1248 m`, `Y = 1.4659 m`, `Z = 0.1745 m`, `det(R) = 1.0000` |
| **Puma 560 FK** | `ManipulatorApp.m` | `q = [20°, 30°, -15°, 10°, 0°, 0°]` | `XYZ = (0.3161, -0.0446, 0.6382) m` |
| **IK Reject (Radial)** | `ManipulatorApp.m` | `(0.20, 0.10, 0.30) m` | Rejected: `r = 0.2236 m < 0.50 m` |
| **IK Accept & Solve** | `ManipulatorApp.m` | `(0.70, 0.20, 0.30) m` | Converged in 40 iters, residual `2.20e-07 m`, `w = 0.1063` |
| **NAO_ROB PR Arm** | `nao_seriallink_demo.m` | `q = [4.0 m, 0.3 rad]` | `XYZ = (2.8660, 0.0000, 4.8866) m` |
| **Puma Closed-Form IK** | `puma560_ik_demo.m` | `transl(0.6, 0.1, 0) * rpy2tr(0, 180°, 0)` | `ikine6s(T)` verified against `fkine(q)` |

---

## Workshop Labs, Manuals & Coursework

- **Workshop Manuals ([src/workshops/manuals/](src/workshops/manuals/)):** `Robotics_Toolbox_Manual.pdf`, `Workshop_01_Robotics_Intro.pdf`, `Workshop_02_03_Pose_2D_3D.pdf`, `Workshop_04_Complete_Simulation.pdf`, and `Tutorial_ESP8266_Part1..3.pdf`.
- **Course Assignments ([docs/assignments/](docs/assignments/)):** `Assignment_01_Brief.pdf`, `Assignment_02_Brief.pdf`, `Assignment_04_Brief.pdf`, `A2_Robotics.pdf`, `A4_Robotics.pdf`.
- **Supporting Reports:** [Report.pdf](src/kinematics_app/Report.pdf), [Humanoid_Robot_Pitch_Deck.pptx](src/kinematics_app/Humanoid_Robot_Pitch_Deck.pptx), and [SEC.pdf](src/trajectory_planning/SEC.pdf).

---

## Project Breakdown & Bug Fixes

| Original File | Refactored Module | Issue Fixed / Enhancement Added |
|---------------|-------------------|---------------------------------|
| `Assignment #02/ass1.m` | `src/trajectory_planning/quintic_trajectory.m` | Fixed bug where coefficients `a5..a0` were printed as `q, v, a` at `T=3` and `T=8`; replaced `inv(A)*b` with `A\b` and added `polyval`/`polyder` verification + 3-panel plot |
| `WORK_SHOPS/ws#02.m` | `src/workshops/puma560_ik_demo.m` | Fixed multiline `*rpy2tr(...)` syntax error and added `fkine(q)` verification error output |
| `Assignment #01/assignment_app.m` | `src/kinematics_app/ManipulatorApp.m` | Removed duplicate `properties` blocks, cached `loadrobot('puma560')`, replaced Corke `mdl_puma560` dependency with native `geometricJacobian`, fixed discarded `sprintf` singularity warning, standardized joint limits in degrees |
| `WORK_SHOPS/Robot_.m` | `src/workshops/nao_seriallink_demo.m` | Cleaned comments, added explicit `fkine([4, 0.3])` output, non-blocking `teach` option |
| Duplicate files & 10 MB `R2.jpg` | Removed / Optimized | Deleted `assignment_app_1.txt`, `robotics tool box manual_2.pdf`, `Week 6 - Workshop 4 - Complete Simulation_2.pdf`; resized `R2.jpg` to `1920×1280` (~350 KB) |

---

## Folder Structure

```text
Robotic_Manipulator/
├── src/
│   ├── kinematics_app/
│   │   ├── ManipulatorApp.m
│   │   ├── workspace_analyzer.m
│   │   ├── R2.jpg
│   │   ├── Report.pdf
│   │   └── Humanoid_Robot_Pitch_Deck.pptx
│   ├── trajectory_planning/
│   │   ├── quintic_trajectory.m
│   │   ├── cubic_vs_quintic_benchmark.m
│   │   └── SEC.pdf
│   └── workshops/
│       ├── nao_seriallink_demo.m
│       ├── puma560_ik_demo.m
│       ├── qz_qr_reference.txt
│       └── manuals/                 (7 unique workshop & toolbox PDFs)
├── tests/
│   ├── run_demo.m
│   ├── verify_kinematics.m
│   └── verify_python_sim.py
├── docs/
│   ├── ARCHITECTURE.md
│   └── assignments/                 (5 official coursework PDFs)
├── archive/
│   └── original_coursework/         (4 original unedited .m files)
├── assets/
│   ├── screenshots/                 (24 full 1440×900 PNGs)
│   ├── thumbs/                      (24 preview 960×600 WebPs)
│   ├── css/style.css
│   ├── js/main.js
│   ├── favicon.svg
│   └── og-image.png
├── index.html
├── .nojekyll
├── LICENSE
└── README.md
```

---

## Setup & Running

### Option A — MATLAB (Full GUI & Toolboxes)

```matlab
addpath(genpath('src'));
run('tests/run_demo.m');   % Console demo, benchmarks & automated verification
app = ManipulatorApp;      % Launch interactive App Designer GUI
```

### Option B — Python (Zero-MATLAB Verification)

```bash
python tests/verify_python_sim.py
```

---

## Demo & Verification

Live output from `python tests/verify_python_sim.py`:

```text
=== Robotic Manipulator Python Verification Suite ===
[PASS] 1. Quintic trajectory: 6 coeffs solved, max BC error = 9.77e-15
[PASS] 2. Cubic vs Quintic: cubic peak |v|=0.4712 rad/s vs quintic 0.5890 rad/s (0 endpoint accel)
[PASS] 3. Puma 560 FK [20,30,-15,10,0,0] deg -> XYZ = (0.3161, -0.0446, 0.6382) m
[PASS] 4. Workspace gate checks (accept (0.7,0.2,0.3), reject out-of-bounds)
[PASS] 5. Puma 560 IK->FK round-trip for (0.7, 0.2, 0.3): error = 2.20e-07 m
[PASS] 6. Manipulability w(q_ik) = 0.1063, MC max reach = 0.874 m
[PASS] 7. NAO_ROB PR arm FK([4.0, 0.3]) -> XYZ = (2.8660, 0.0000, 4.8866) m
=== All 7 verification checks passed ===
```

---

## Results

- **Quintic Trajectory (`t ∈ [3, 8] s`, `q: 0 → π/2 rad`)**: Maximum boundary condition residual is `9.77e-15`, with zero endpoint acceleration.
- **Puma 560 IK → FK Round-Trip (`(0.7, 0.2, 0.3) m`)**: Converges within 40 iterations to `2.20e-07 m` positional error with Yoshikawa manipulability $w = 0.1063$.
- **Workspace Gate**: Accepts `(0.7, 0.2, 0.3) m` and rejects out-of-bounds radial, azimuth, and negative-$z$ targets.

---

## Limitations

- `src/workshops/nao_seriallink_demo.m` and `src/workshops/puma560_ik_demo.m` require Peter Corke's Robotics Toolbox for MATLAB (`SerialLink`, `mdl_puma560`, `ikine6s`).
- `ManipulatorApp.m` and `workspace_analyzer.m` require MATLAB Robotics System Toolbox (`loadrobot`, `inverseKinematics`, `geometricJacobian`).

---

## Screenshots

| # | Figure | Category | Files |
|---|--------|----------|-------|
| 01 | Repository Architecture & Module Map | `verification` | [Preview](assets/thumbs/01_repo_architecture.webp) · [Full 1440×900](assets/screenshots/01_repo_architecture.png) |
| 02 | ManipulatorApp GUI Layout & Controls | `kinematics` | [Preview](assets/thumbs/02_app_ui_mockup.webp) · [Full 1440×900](assets/screenshots/02_app_ui_mockup.png) |
| 03 | Puma 560 Standard Denavit–Hartenberg Table | `kinematics` | [Preview](assets/thumbs/03_puma560_dh_table.webp) · [Full 1440×900](assets/screenshots/03_puma560_dh_table.png) |
| 04 | Planar 2-Link + Z Homogeneous Pose Matrix | `kinematics` | [Preview](assets/thumbs/04_planar_pose_matrix.webp) · [Full 1440×900](assets/screenshots/04_planar_pose_matrix.png) |
| 05 | Puma 560 Forward Kinematics 3D Pose | `kinematics` | [Preview](assets/thumbs/05_puma560_fk_3d_pose.webp) · [Full 1440×900](assets/screenshots/05_puma560_fk_3d_pose.png) |
| 06 | IK Workspace Gate: Radial & Azimuth Bounds | `kinematics` | [Preview](assets/thumbs/06_workspace_boundary_polar.webp) · [Full 1440×900](assets/screenshots/06_workspace_boundary_polar.png) |
| 07 | IK Workspace Gate Rejection Case | `kinematics` | [Preview](assets/thumbs/07_ik_workspace_reject.webp) · [Full 1440×900](assets/screenshots/07_ik_workspace_reject.png) |
| 08 | Damped Least-Squares IK Convergence | `kinematics` | [Preview](assets/thumbs/08_ik_convergence_curve.webp) · [Full 1440×900](assets/screenshots/08_ik_convergence_curve.png) |
| 09 | Puma 560 Inverse Kinematics 3D Solution | `kinematics` | [Preview](assets/thumbs/09_puma560_ik_3d_pose.webp) · [Full 1440×900](assets/screenshots/09_puma560_ik_3d_pose.png) |
| 10 | Puma 560 Reachable Workspace & Manipulability | `kinematics` | [Preview](assets/thumbs/10_singularity_jacobian_map.webp) · [Full 1440×900](assets/screenshots/10_singularity_jacobian_map.png) |
| 11 | Puma 560 Joint Rotation Limits vs. IK Solution | `kinematics` | [Preview](assets/thumbs/11_joint_limits_envelope.webp) · [Full 1440×900](assets/screenshots/11_joint_limits_envelope.png) |
| 12 | Planar Workspace Semicircle Reach Animation | `kinematics` | [Preview](assets/thumbs/12_semicircle_reach_anim.webp) · [Full 1440×900](assets/screenshots/12_semicircle_reach_anim.png) |
| 13 | Quintic Trajectory Linear System A*a = b | `trajectory` | [Preview](assets/thumbs/13_quintic_boundary_system.webp) · [Full 1440×900](assets/screenshots/13_quintic_boundary_system.png) |
| 14 | Cubic vs. Quintic Trajectory Comparison | `trajectory` | [Preview](assets/thumbs/14_quintic_position_profile.webp) · [Full 1440×900](assets/screenshots/14_quintic_position_profile.png) |
| 15 | Quintic Velocity v(t) & Acceleration a(t) | `trajectory` | [Preview](assets/thumbs/15_quintic_velocity_accel.webp) · [Full 1440×900](assets/screenshots/15_quintic_velocity_accel.png) |
| 16 | Quintic Phase Portrait (Position vs. Velocity) | `trajectory` | [Preview](assets/thumbs/16_quintic_phase_portrait.webp) · [Full 1440×900](assets/screenshots/16_quintic_phase_portrait.png) |
| 17 | Workshop 1: NAO_ROB 2-DOF PR Manipulator | `workshops` | [Preview](assets/thumbs/17_nao_pr_arm_3d.webp) · [Full 1440×900](assets/screenshots/17_nao_pr_arm_3d.png) |
| 18 | NAO_ROB Reachable Workspace Envelope | `workshops` | [Preview](assets/thumbs/18_nao_pr_workspace_envelope.webp) · [Full 1440×900](assets/screenshots/18_nao_pr_workspace_envelope.png) |
| 19 | Workshop 2: Puma 560 Zero Configuration (qz) | `workshops` | [Preview](assets/thumbs/19_puma_qz_home_pose.webp) · [Full 1440×900](assets/screenshots/19_puma_qz_home_pose.png) |
| 20 | Workshop 2: Closed-Form Target Pose (0.6, 0.1, 0.0) m | `workshops` | [Preview](assets/thumbs/20_puma_ikine6s_target.webp) · [Full 1440×900](assets/screenshots/20_puma_ikine6s_target.png) |
| 21 | Source Highlight: ManipulatorApp.m | `verification` | [Preview](assets/thumbs/21_code_manipulator_app.webp) · [Full 1440×900](assets/screenshots/21_code_manipulator_app.png) |
| 22 | Source Highlight: quintic_trajectory.m | `verification` | [Preview](assets/thumbs/22_code_quintic_solver.webp) · [Full 1440×900](assets/screenshots/22_code_quintic_solver.png) |
| 23 | Automated Verification Suite Output (7/7 Passed) | `verification` | [Preview](assets/thumbs/23_verification_suite_output.webp) · [Full 1440×900](assets/screenshots/23_verification_suite_output.png) |
| 24 | Multi-Pose Comparison: Home, Ready, Reach, Folded | `workshops` | [Preview](assets/thumbs/24_arm_pose_comparison_grid.webp) · [Full 1440×900](assets/screenshots/24_arm_pose_comparison_grid.png) |

### 1. Repository Architecture & Module Map

Modular separation of App Designer GUI, trajectory benchmarks, workshop labs, verification tests, and archived originals.

<p align="left"><a href="assets/screenshots/01_repo_architecture.png"><img src="assets/thumbs/01_repo_architecture.webp" alt="Repository Architecture & Module Map" width="640"></a></p>

### 2. ManipulatorApp GUI Layout & Controls

App Designer interface (ManipulatorApp.m) with R2.jpg PCB backdrop and five interactive action buttons.

<p align="left"><a href="assets/screenshots/02_app_ui_mockup.png"><img src="assets/thumbs/02_app_ui_mockup.webp" alt="ManipulatorApp GUI Layout & Controls" width="640"></a></p>

### 3. Puma 560 Standard Denavit–Hartenberg Table

6-DOF standard DH parameters used across Forward/Inverse Kinematics and Jacobian computation.

<p align="left"><a href="assets/screenshots/03_puma560_dh_table.png"><img src="assets/thumbs/03_puma560_dh_table.webp" alt="Puma 560 Standard Denavit–Hartenberg Table" width="640"></a></p>

### 4. Planar 2-Link + Z Homogeneous Pose Matrix

Test input [30°, 45°, 10°, 0°] yielding a 4x4 SE(3) pose with L1 = 1 m and L2 = 1 m.

<p align="left"><a href="assets/screenshots/04_planar_pose_matrix.png"><img src="assets/thumbs/04_planar_pose_matrix.webp" alt="Planar 2-Link + Z Homogeneous Pose Matrix" width="640"></a></p>

### 5. Puma 560 Forward Kinematics 3D Pose

Joint angles [20°, 30°, -15°, 10°, 0°, 0°] mapped to end-effector XYZ via DH forward kinematics.

<p align="left"><a href="assets/screenshots/05_puma560_fk_3d_pose.png"><img src="assets/thumbs/05_puma560_fk_3d_pose.webp" alt="Puma 560 Forward Kinematics 3D Pose" width="640"></a></p>

### 6. IK Workspace Gate: Radial & Azimuth Bounds

Polar workspace envelope enforcing 0.5 m <= r <= 1.0 m, -90 deg <= theta <= +90 deg, and z >= 0 m.

<p align="left"><a href="assets/screenshots/06_workspace_boundary_polar.png"><img src="assets/thumbs/06_workspace_boundary_polar.webp" alt="IK Workspace Gate: Radial & Azimuth Bounds" width="640"></a></p>

### 7. IK Workspace Gate Rejection Case

Target (0.20, 0.10, 0.30) m has r = 0.2236 m < 0.50 m and is rejected before the IK solver runs.

<p align="left"><a href="assets/screenshots/07_ik_workspace_reject.png"><img src="assets/thumbs/07_ik_workspace_reject.webp" alt="IK Workspace Gate Rejection Case" width="640"></a></p>

### 8. Damped Least-Squares IK Convergence

Position residual drops below 1e-6 m within 40 iterations for target (0.70, 0.20, 0.30) m.

<p align="left"><a href="assets/screenshots/08_ik_convergence_curve.png"><img src="assets/thumbs/08_ik_convergence_curve.webp" alt="Damped Least-Squares IK Convergence" width="640"></a></p>

### 9. Puma 560 Inverse Kinematics 3D Solution

Solved 6-DOF joint configuration reaching (0.70, 0.20, 0.30) m with sub-micrometer residual.

<p align="left"><a href="assets/screenshots/09_puma560_ik_3d_pose.png"><img src="assets/thumbs/09_puma560_ik_3d_pose.webp" alt="Puma 560 Inverse Kinematics 3D Solution" width="640"></a></p>

### 10. Puma 560 Reachable Workspace & Manipulability

600-sample Monte Carlo reachability colored by Yoshikawa manipulability index w = sqrt(det(J*J^T)).

<p align="left"><a href="assets/screenshots/10_singularity_jacobian_map.png"><img src="assets/thumbs/10_singularity_jacobian_map.webp" alt="Puma 560 Reachable Workspace & Manipulability" width="640"></a></p>

### 11. Puma 560 Joint Rotation Limits vs. IK Solution

All six revolute joints remain safely inside RigidBodyTree PositionLimits.

<p align="left"><a href="assets/screenshots/11_joint_limits_envelope.png"><img src="assets/thumbs/11_joint_limits_envelope.webp" alt="Puma 560 Joint Rotation Limits vs. IK Solution" width="640"></a></p>

### 12. Planar Workspace Semicircle Reach Animation

100-point arc (r = 1.0 m, theta in [0, pi]) traced by the Animation button.

<p align="left"><a href="assets/screenshots/12_semicircle_reach_anim.png"><img src="assets/thumbs/12_semicircle_reach_anim.webp" alt="Planar Workspace Semicircle Reach Animation" width="640"></a></p>

### 13. Quintic Trajectory Linear System A*a = b

Boundary conditions at t0 = 3 s and tf = 8 s with solved coefficients and verified endpoint values.

<p align="left"><a href="assets/screenshots/13_quintic_boundary_system.png"><img src="assets/thumbs/13_quintic_boundary_system.webp" alt="Quintic Trajectory Linear System A*a = b" width="640"></a></p>

### 14. Cubic vs. Quintic Trajectory Comparison

Quintic maintains zero endpoint acceleration (smooth jerk), whereas cubic jumps to +/-0.377 rad/s^2.

<p align="left"><a href="assets/screenshots/14_quintic_position_profile.png"><img src="assets/thumbs/14_quintic_position_profile.webp" alt="Cubic vs. Quintic Trajectory Comparison" width="640"></a></p>

### 15. Quintic Velocity v(t) & Acceleration a(t)

Zero-velocity and zero-acceleration endpoints eliminate jerk spikes at t0 and tf.

<p align="left"><a href="assets/screenshots/15_quintic_velocity_accel.png"><img src="assets/thumbs/15_quintic_velocity_accel.webp" alt="Quintic Velocity v(t) & Acceleration a(t)" width="640"></a></p>

### 16. Quintic Phase Portrait (Position vs. Velocity)

Closed smooth trajectory loop from rest at 0 rad to rest at pi/2 rad.

<p align="left"><a href="assets/screenshots/16_quintic_phase_portrait.png"><img src="assets/thumbs/16_quintic_phase_portrait.webp" alt="Quintic Phase Portrait (Position vs. Velocity)" width="640"></a></p>

### 17. Workshop 1: NAO_ROB 2-DOF PR Manipulator

SerialLink prismatic-revolute arm evaluated at q = [4.0 m, 0.3 rad].

<p align="left"><a href="assets/screenshots/17_nao_pr_arm_3d.png"><img src="assets/thumbs/17_nao_pr_arm_3d.webp" alt="Workshop 1: NAO_ROB 2-DOF PR Manipulator" width="640"></a></p>

### 18. NAO_ROB Reachable Workspace Envelope

Prismatic stroke d1 in [0, 5] m combined with revolute link a2 = 3 m.

<p align="left"><a href="assets/screenshots/18_nao_pr_workspace_envelope.png"><img src="assets/thumbs/18_nao_pr_workspace_envelope.webp" alt="NAO_ROB Reachable Workspace Envelope" width="640"></a></p>

### 19. Workshop 2: Puma 560 Zero Configuration (qz)

Reference home pose q = [0, 0, 0, 0, 0, 0] rad from puma560_ik_demo.m.

<p align="left"><a href="assets/screenshots/19_puma_qz_home_pose.png"><img src="assets/thumbs/19_puma_qz_home_pose.webp" alt="Workshop 2: Puma 560 Zero Configuration (qz)" width="640"></a></p>

### 20. Workshop 2: Closed-Form Target Pose (0.6, 0.1, 0.0) m

Fixed ws#02.m syntax error; IK pose reaches target T = transl(0.6, 0.1, 0) * rpy2tr(0, 180, 0).

<p align="left"><a href="assets/screenshots/20_puma_ikine6s_target.png"><img src="assets/thumbs/20_puma_ikine6s_target.webp" alt="Workshop 2: Closed-Form Target Pose (0.6, 0.1, 0.0) m" width="640"></a></p>

### 21. Source Highlight: ManipulatorApp.m

Cached RigidBodyTree model and native Robotics System Toolbox Jacobian singularity probe.

<p align="left"><a href="assets/screenshots/21_code_manipulator_app.png"><img src="assets/thumbs/21_code_manipulator_app.webp" alt="Source Highlight: ManipulatorApp.m" width="640"></a></p>

### 22. Source Highlight: quintic_trajectory.m

Refactored MATLAB function using A\b solver and polyval/polyder boundary evaluation.

<p align="left"><a href="assets/screenshots/22_code_quintic_solver.png"><img src="assets/thumbs/22_code_quintic_solver.webp" alt="Source Highlight: quintic_trajectory.m" width="640"></a></p>

### 23. Automated Verification Suite Output (7/7 Passed)

Live execution of tests/verify_python_sim.py passing all 7 kinematics, manipulability & trajectory checks.

<p align="left"><a href="assets/screenshots/23_verification_suite_output.png"><img src="assets/thumbs/23_verification_suite_output.webp" alt="Automated Verification Suite Output (7/7 Passed)" width="640"></a></p>

### 24. Multi-Pose Comparison: Home, Ready, Reach, Folded

Four canonical 6-DOF Puma 560 joint configurations verified in 3D space.

<p align="left"><a href="assets/screenshots/24_arm_pose_comparison_grid.png"><img src="assets/thumbs/24_arm_pose_comparison_grid.webp" alt="Multi-Pose Comparison: Home, Ready, Reach, Folded" width="640"></a></p>


---

## License

Code and documentation in this repository are released under the [MIT License](LICENSE). Coursework PDFs and toolbox manuals belong to their respective authors and instructors.

---

## Author

**Mohammad Rohaan**  
BS Computer Science — FAST-NUCES

- GitHub: [@rohaan2802](https://github.com/rohaan2802)
- Email: [m.rohaanarshad@gmail.com](mailto:m.rohaanarshad@gmail.com)
