{"id":31133070,"url":"https://github.com/radithsandeepa/robot-path-visualizer","last_synced_at":"2025-09-18T05:08:25.809Z","repository":{"id":313289938,"uuid":"1050830511","full_name":"RadithSandeepa/robot-path-visualizer","owner":"RadithSandeepa","description":"Welcome to Robot Path Visualizer! This tiny project uses Python, Pygame, and NumPy to replay a precomputed trajectory (x, y, θ). It rotates a robot sprite frame-by-frame and draws a trail, making it handy for diff-drive path playback, simulation demos, and quick visual debugging of robotics experiments.","archived":false,"fork":false,"pushed_at":"2025-09-05T03:14:29.000Z","size":215,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-05T04:21:20.134Z","etag":null,"topics":["animation","numpy","pygame","python","robot-simulation","robotics","trajectory-visualization"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RadithSandeepa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-05T02:30:26.000Z","updated_at":"2025-09-05T03:14:32.000Z","dependencies_parsed_at":"2025-09-05T04:21:21.691Z","dependency_job_id":"7b664df9-b48c-484e-a801-e7141b1f0708","html_url":"https://github.com/RadithSandeepa/robot-path-visualizer","commit_stats":null,"previous_names":["radithsandeepa/robot-path-visualizer"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/RadithSandeepa/robot-path-visualizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RadithSandeepa%2Frobot-path-visualizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RadithSandeepa%2Frobot-path-visualizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RadithSandeepa%2Frobot-path-visualizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RadithSandeepa%2Frobot-path-visualizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RadithSandeepa","download_url":"https://codeload.github.com/RadithSandeepa/robot-path-visualizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RadithSandeepa%2Frobot-path-visualizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275712384,"owners_count":25514205,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-18T02:00:09.552Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["animation","numpy","pygame","python","robot-simulation","robotics","trajectory-visualization"],"created_at":"2025-09-18T05:08:23.468Z","updated_at":"2025-09-18T05:08:25.802Z","avatar_url":"https://github.com/RadithSandeepa.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Robot Path Visualizer (Pygame)\n\nThis project demonstrates a tiny Python app that replays a precomputed robot trajectory `(x, y, θ)` using **Pygame** and **NumPy**. It rotates a robot sprite along the path and draws a trail, handy for quick demos and visual debugging of differential-drive motion.\n\n## Summary\n- Loads `simulationData.npy` → shape **(N, 3)** as columns: **x**, **y**, **theta_rad**.\n- Converts `theta` (radians) to degrees for sprite rotation.\n- Animates `robotImage.png` (50×50) across a `1200×800` window.\n- Draws a yellow polyline trail of visited points.\n\n## Files\n- differential_robot.py → Generates simulationData.npy using a diff-drive ODE model + quick plots\n- simulation_DDRobot.py → Visualizes the saved trajectory with Pygame (rotating sprite + trail)\n- simulationData.npy → Generated trajectory file (created by differential_robot.py)\n- robotImage.png → Robot sprite (will be scaled to 50x50)\n- README.md\n\n## What it does\n### 1) `differential_robot.py` - Simulation\n- Defines robot params: wheel radius `r` and wheelbase `s`.\n- Sets wheel angular velocities `ΔL(t)` and `ΔR(t)`.\n- Simulates the kinematics with SciPy ``` `odeint`:\n  \\[\n  \\dot{x} = \\frac{r}{2}\\cos(\\theta)\\,(\\Delta_R + \\Delta_L) \\quad\n  \\dot{y} = \\frac{r}{2}\\sin(\\theta)\\,(\\Delta_R + \\Delta_L) \\quad\n  \\dot{\\theta} = \\frac{r}{s}(\\Delta_R - \\Delta_L)\n  \\]```\n- Saves the result to **`simulationData.npy`** with shape `(N, 3)` = `[x, y, theta]` (theta in **radians**).\n- Shows quick Matplotlib plots for sanity-check.\n\n### 2) `simulation_DDRobot.py` - Visualization\n- Opens a `1200×800` Pygame window.\n- Loads `simulationData.npy`, converts `theta` to degrees (and flips sign for Pygame’s rotation).\n- Draws `robotImage.png` at `(x[i], y[i])` with correct rotation and a yellow path trail.\n\n\u003e **Coordinate system:** Pygame’s origin is top-left, **y increases downward**.  \n\u003e If you want a math-style y-up view, pre-flip `y` in your data before saving.\n\n## Screenshots\n\n![Run1](https://github.com/RadithSandeepa/robot-path-visualizer/blob/main/Images/Img_1.png)\n\n![Run2](https://github.com/RadithSandeepa/robot-path-visualizer/blob/main/Images/Img_2.png)\n\n## Requirements\n```bash\npython -m pip install -r requirements.txt\n```\n\n- NumPy, SciPy, Matplotlib, Pygame\n\n## Run\n1) Generate the trajectory\n\n```bash\npython differential_robot.py\n```\n- This creates simulationData.npy and shows plots.\n\n2) Visualize the trajectory\n\n```bash\npython simulation_DDRobot.py\n```\n- Make sure robotImage.png is in the same folder.\n\n## Data Format\n### simulationData.npy: NumPy array with shape (N, 3)\n- Column 0 → x (pixels)\n- Column 1 → y (pixels)\n- Column 2 → theta (radians)\n\n![Diagram](https://github.com/RadithSandeepa/robot-path-visualizer/blob/main/Images/Img_3.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradithsandeepa%2Frobot-path-visualizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fradithsandeepa%2Frobot-path-visualizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradithsandeepa%2Frobot-path-visualizer/lists"}