Skip to content

Samanyu-dev/robot_vision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

18 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– ROBOT VISION LAB

Premium 3R Manipulator ยท Wrist Camera ยท Real-time Projection





๐ŸŒŒ Overview

Robot Vision Lab is a premium, interactive simulation platform for a 3R robotic manipulator with a wrist-mounted pinhole camera. It bridges robotics kinematics, computer vision projection, and real-time 3D visualization into a single immersive dashboard.

โšก Not your average Streamlit app. This feels like a modern AI/robotics product โ€” complete with glassmorphism UI, neon gradients, particle animations, and interactive 3D scenes.

๐Ÿค– Robot + Camera

Interactive Plotly 3D scene with articulated links, coordinate frames, and a glowing camera module.

๐Ÿ“ท Live Projection

OpenCV-rendered 640ร—480 image plane showing real-time cube vertex projections with "OUT OF VIEW" warnings.


โœจ Features

๐ŸŽจ Premium UI/UX

  • Dark futuristic theme with gradient backgrounds and glassmorphism cards
  • Custom typography: Orbitron (sci-fi headers) + Rajdhani (data labels)
  • Animated particle overlay for a living, breathing interface
  • Neon glow effects on titles, separators, and hover interactions
  • Responsive metric cards with gradient top-border reveals

๐ŸŽฎ Interactive 3D Scene (Plotly)

  • Rotate ยท Zoom ยท Pan the full robot workspace
  • Articulated 3R arm with 3 revolute joints and DH parameters
  • Glowing magenta camera module with optical axis visualization
  • Wireframe or solid cube toggle with 8 tracked vertices
  • RGB coordinate frames for Global (G), End-Effector (E), and Camera (C)
  • Ground grid for spatial reference

๐Ÿ“ท Camera Projection Panel (OpenCV)

  • 640ร—480 simulated image plane with grid overlay
  • Blue projected vertices and edges for the cube
  • Magenta crosshair at the principal point
  • Animated "OUT OF VIEW" warning when vertices leave the frame
  • Live pixel coordinate table with visibility checkmarks

๐ŸŽ›๏ธ Real-time Controls

Control Range Description
ฮธโ‚ (Base) โˆ’180ยฐ โ†’ 180ยฐ Base joint rotation
ฮธโ‚‚ (Shoulder) โˆ’120ยฐ โ†’ 120ยฐ Shoulder joint rotation
ฮธโ‚ƒ (Wrist) โˆ’120ยฐ โ†’ 120ยฐ Wrist joint rotation
Cube Side 0.05 โ†’ 0.60 m Object size
Cube (X, Y, Z) Free Object position in world frame
Focal Length 250 โ†’ 1000 px Camera intrinsics
Camera Tilt โˆ’60ยฐ โ†’ 30ยฐ Wrist camera tilt angle

๐ŸŽฌ Auto Trajectory Animation

  • Sinusoidal motion: ฮธโ‚(t) = 30 + 20ยทsin(t), ฮธโ‚‚(t) = 45 + 15ยทsin(2t), ฮธโ‚ƒ(t) = โˆ’20 + 10ยทcos(t)
  • Play / Pause / Speed controls in the sidebar
  • Live trajectory tracking of (u, v) projection centroids

๐Ÿ“Š Analytics Dashboard

  • 5 live metric cards: Visible Vertices, Camera Z, Image Status, Manipulability, EEโ†’Cube Distance
  • (u, v) Trajectory Plot โ€” tracks projection path over time with Plotly
  • Position Metrics โ€” End-effector vs Camera coordinates
  • Distance Metrics โ€” Baseโ†’EE, Baseโ†’Cam, Camโ†’Cube

๐Ÿ”ฅ Jacobian Analysis

  • Plasma heatmap of the 6ร—3 geometric Jacobian with value annotations
  • Singular value decomposition bar chart
  • Manipulability gauge with progress indicator

๐ŸŽฌ GIF Generation

  • Pre-render 3D Trajectory GIF (60 frames @ 15 fps)
  • Pre-render Camera View GIF (60 frames @ 15 fps)

๐Ÿงฎ Matrix Lab

  • All homogeneous transforms: T_BE, T_GC, T_B0, T_B1, T_B2
  • Complete DH Parameter table

๐Ÿš€ Quick Start

1. Clone the Repository

git clone https://github.com/Samanyu-dev/robot_vision.git
cd robot_vision

2. Install Dependencies

pip install -r requirements.txt

๐Ÿง For headless Linux servers, opencv-python-headless is used instead of the standard opencv-python to avoid libGL.so.1 errors.

3. Launch the App

streamlit run app.py

The dashboard will open at http://localhost:8501.


๐Ÿ—๏ธ Project Structure

robot_vision/
โ”‚
โ”œโ”€โ”€ app.py                      โ† ๐Ÿš€ Premium Streamlit dashboard (main entry)
โ”œโ”€โ”€ requirements.txt            โ† Dependencies (Plotly, OpenCV-Headless, Pandas, Kaleido)
โ”‚
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ kinematics.py           โ† DH forward kinematics for 3R arm
โ”‚   โ”œโ”€โ”€ camera.py               โ† Camera extrinsics & mount transforms
โ”‚   โ”œโ”€โ”€ projection.py           โ† Pinhole projection (world โ†’ image)
โ”‚   โ”œโ”€โ”€ cube.py                 โ† Cube vertex geometry
โ”‚   โ”œโ”€โ”€ jacobian.py             โ† Geometric Jacobian & manipulability
โ”‚   โ”œโ”€โ”€ visualization.py        โ† ๐ŸŽจ Plotly 3D + OpenCV camera + trajectory plots
โ”‚   โ””โ”€โ”€ ui_components.py        โ† โœจ Premium CSS, animations, layout helpers
โ”‚
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ phase1_forward_kinematics.py
โ”‚   โ”œโ”€โ”€ phase2_camera_extrinsics.py
โ”‚   โ”œโ”€โ”€ phase3_projection.py
โ”‚   โ”œโ”€โ”€ phase4_image_coordinates.py
โ”‚   โ”œโ”€โ”€ phase5_cube_vertices.py
โ”‚   โ”œโ”€โ”€ phase6_jacobian.py
โ”‚   โ”œโ”€โ”€ phase7_trajectory.py
โ”‚   โ”œโ”€โ”€ phase8_simulation_3d.py
โ”‚   โ””โ”€โ”€ phase9_camera_view.py
โ”‚
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ test_kinematics.py
โ”‚   โ”œโ”€โ”€ test_camera.py
โ”‚   โ”œโ”€โ”€ test_projection.py
โ”‚   โ”œโ”€โ”€ test_cube.py
โ”‚   โ””โ”€โ”€ test_jacobian.py
โ”‚
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ phase_0_system_model.md
โ”‚   โ”œโ”€โ”€ phase_1_kinematics.md
โ”‚   โ”œโ”€โ”€ phase_2_camera_extrinsics.md
โ”‚   โ”œโ”€โ”€ phase_3_projection.md
โ”‚   โ”œโ”€โ”€ phase_4_image_coordinates.md
โ”‚   โ”œโ”€โ”€ phase_5_cube_vertices.md
โ”‚   โ”œโ”€โ”€ phase_6_jacobian.md
โ”‚   โ”œโ”€โ”€ phase_7_trajectory.md
โ”‚   โ”œโ”€โ”€ phase_8_simulation_3d.md
โ”‚   โ”œโ”€โ”€ phase_9_camera_view.md
โ”‚   โ””โ”€โ”€ live_demo.md
โ”‚
โ””โ”€โ”€ outputs/

๐Ÿง  Technical Stack

Layer Technology
Frontend / UI Streamlit + Custom HTML/CSS/JS
3D Visualization Plotly Graph Objects (WebGL-accelerated)
Image Rendering OpenCV (headless) + NumPy
Math & Kinematics NumPy + SciPy
Data Handling Pandas
Static Plots Matplotlib
GIF Export Pillow + Kaleido

๐Ÿ“ธ Screenshots

Replace these placeholders with actual screenshots after running the app

๐ŸŽฎ Live 3D Scene
3D Robot Trajectory
๐Ÿ“ท Camera View
Camera Projection

๐ŸŽฏ Key Concepts Demonstrated

  1. DH Parameter Forward Kinematics โ€” T_BE from 3 revolute joints
  2. Camera Extrinsics โ€” T_GC via end-effector mount with tilt offset
  3. Pinhole Projection โ€” World โ†’ Camera โ†’ Image plane via K [R|t]
  4. Visibility Testing โ€” In-front and in-bounds checks per vertex
  5. Geometric Jacobian โ€” 6ร—3 matrix relating joint velocities to EE spatial velocity
  6. Manipulability โ€” Yoshikawa measure: โˆšdet(Jแต€J)

๐Ÿ› ๏ธ Development

Running Tests

pytest tests/

Phase Scripts

Each scripts/phase*.py corresponds to a robotics concept doc in docs/:

python scripts/phase1_forward_kinematics.py
python scripts/phase8_simulation_3d.py

๐ŸŒ Host the Landing Page (Free via GitHub Pages)

The project includes a beautiful standalone HTML landing page at docs/demo_landing.html. You can host it for free in under 2 minutes:

Option A: GitHub Pages (Recommended โ€” Free & Fast)

  1. Go to your repo โ†’ Settings โ†’ Pages (left sidebar)
  2. Under Build and deployment โ†’ Source, select Deploy from a branch
  3. Select branch: main โ†’ folder: /docs โ†’ click Save
  4. Wait ~30 seconds, then visit:
    https://samanyu-dev.github.io/robot_vision/demo_landing.html
    

๐Ÿ’ก Tip: If you want the landing page at the root URL, rename docs/demo_landing.html to docs/index.html.

Option B: Netlify Drop (Drag & Drop)

  1. Go to netlify.com/drop
  2. Drag the docs/ folder onto the page
  3. Get an instant live URL (free forever)

Option C: Vercel

  1. Install Vercel CLI: npm i -g vercel
  2. Run vercel --cwd docs from the project root
  3. Get a .vercel.app URL instantly

๐Ÿ“ Citation / Credits

Built with โค๏ธ by Samanyu as part of a robotics + computer vision coursework project.


๐Ÿค– ROBOT VISION LAB ยท PREMIUM EDITION v3.0

Built with Streamlit ยท Enhanced with Plotly ยท Powered by NumPy

Releases

No releases published

Packages

 
 
 

Contributors

Languages