{"id":47217887,"url":"https://github.com/avik43218/stable-motion","last_synced_at":"2026-04-01T18:25:55.537Z","repository":{"id":344117981,"uuid":"1180489127","full_name":"Avik43218/stable-motion","owner":"Avik43218","description":"A system for stabilising mouse motion from jitters generated due to hand tremors, especially faced by those with Parkinson's disease","archived":false,"fork":false,"pushed_at":"2026-03-14T08:42:16.000Z","size":62,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-16T04:46:35.548Z","etag":null,"topics":["bash","cpp17","healthcare","healthcare-application","parkinsons-disease","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Avik43218.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2026-03-13T05:02:40.000Z","updated_at":"2026-03-14T08:42:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Avik43218/stable-motion","commit_stats":null,"previous_names":["avik43218/stable-motion"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Avik43218/stable-motion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Avik43218%2Fstable-motion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Avik43218%2Fstable-motion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Avik43218%2Fstable-motion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Avik43218%2Fstable-motion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Avik43218","download_url":"https://codeload.github.com/Avik43218/stable-motion/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Avik43218%2Fstable-motion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30630010,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bash","cpp17","healthcare","healthcare-application","parkinsons-disease","rust"],"created_at":"2026-03-13T16:36:54.085Z","updated_at":"2026-03-17T20:00:50.555Z","avatar_url":"https://github.com/Avik43218.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🖱️ Stable Motion\n### *Empowering Precision for Parkinson's Patients*\n\n\u003e **Team 404 Brain Not Found** | Healthcare Track  \n\u003e Rudra Bhattacharjee · Avik Roy Choudhury · Samrat Talukdar · Shreyan Das · Soumyajit Maity\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/f/f5/Cursor_%3F.svg/250px-Cursor_%3F.svg.png\" alt=\"Computer Mouse\" width=\"180\"/\u003e\n\u003c/p\u003e\n\n---\n\n## 😔 The Human Problem\n\nImagine trying to click a small button on your screen — but your hand won't stop shaking.\n\nThat's everyday reality for someone living with **Parkinson's disease**. Every time they reach for a mouse, their hand trembles at 4–6 times per second. They aim for a link, but the cursor dances away. They try to close a window, but they accidentally open something else. Something as simple as sending an email — something most of us do without thinking — becomes exhausting, frustrating, and demoralizing.\n\n\u003e *\"She wanted to video call her grandchildren. It took her 20 minutes to click the right button.\"*\n\nThese are not rare moments. For **10 million Parkinson's patients worldwide**, this is every single day. 70% of them struggle specifically with mouse control. And when they look for help, the solutions are either:\n- **Too expensive** — specialized adaptive mice cost $500+\n- **Too weak** — built-in accessibility tools like Sticky Keys do nothing for active tremors\n- **Too complicated** — requiring hardware modifications, doctors, or IT support\n\n**They just want to use their computer. Independently. With dignity.**\n\nSo we built a fix — in software, at zero cost, using nothing but the mouse they already own.\n\n---\n\n## 🧩 The Technical Problem\n\n10 million people worldwide live with Parkinson's disease. 70% of them struggle with standard mouse interfaces due to involuntary hand tremors (4–6 Hz frequency range). Existing accessibility tools like Sticky Keys are not built for **active tremor filtering**, and specialized hardware costs $500+.\n\n**Stable Motion** is a pure software solution — zero new hardware required. Zero installation cost. Just run it.\n\n---\n\n## ⚙️ How It Works\n\nThe program sits **between your physical mouse and the OS**, intercepting raw input, filtering tremors in real-time, and re-emitting smooth, high-frequency movement events via a virtual device.\n\n```\nPhysical Mouse ──► [EXCLUSIVE GRAB] ──► STFTFilter (FFT + EMA) ──► Virtual Mouse ──► OS\n```\n\n### The 4-Stage Stability Pipeline\n\n| Stage | What Happens |\n|---|---|\n| **Capture** | Raw mouse movement events read from `/dev/input/eventX` |\n| **Smooth** | EMA (Exponential Moving Average) removes high-frequency jitter |\n| **Filter** | FFT isolates and zeroes out 4–6 Hz tremor frequency bands |\n| **Restore** | IFFT reconstructs a clean cursor path and emits at ~1000Hz |\n\n---\n\n## 🔬 Technical Deep Dive\n\n### STFTFilter (The Core Brain)\n- Maintains a **rolling buffer of 64 samples** per axis (X and Y filtered independently)\n- Performs **forward FFT** → zeroes the 4–6 Hz band → **inverse FFT**\n- Applies **EMA smoothing** on top: `output = (0.3 × new) + (0.7 × previous)`\n- Powered by [FFTW3](https://www.fftw.org/) for high-performance transforms\n\n### Interpolated Emission (The \"Frame Gen\")\n- Each 125Hz hardware tick is split into **8 micro-steps**\n- Emitted with ~1ms spacing, effectively upscaling to **~1000Hz output**\n- Uses sub-pixel accumulation so no fractional movement is lost\n\n### Input Hijacking via uinput\n- `EVIOCGRAB` gives **exclusive ownership** of the physical device\n- A virtual device named `\"Stable Motion\"` is created via `/dev/uinput`\n- Clicks are passed through **raw and unfiltered** — only motion is processed\n\n---\n\n## 🚀 Getting Started\n\n### Prerequisites\n```bash\n# On Ubuntu/Debian:\nsudo apt install libfftw3-dev\n\n# On Fedora/RHEL:\nsudo dnf install fftw-devel\n```\n\n### Build\n```bash\ng++ main.cpp -o stable_motion -lfftw3\ncargo build --release\n```\n\n### Run\n```bash\n# Find your mouse device\nls -l /dev/input/by-id/\n\n# Run directly with sudo (required for uinput and device grab)\nsudo ./stable_motion /dev/input/eventX [glide_factor]\n\n# Or run with TUI\nsudo ./target/release/stable_motion_tui\n```\n\n### Stop\n```bash\n# For CLI\nCTRL+C\n\n# For TUI\nALT+F4\n```\n\n---\n\n## 📊 Results\n\n| Metric | Value |\n|---|---|\n| Tremor Reduction | **~95%** |\n| Target Frequency Band | **4–6 Hz** (Parkinson's tremor range) |\n| Output Poll Rate | **~1000 Hz** (upscaled from 125 Hz) |\n| Hardware Required | **None** (pure software) |\n| Platform | **Linux** (Ubuntu/Debian/Fedora) |\n\n---\n\n## 🗺️ Roadmap\n\n**Phase 1 — Core** ✅  \nLow-level event interception, EMA baseline smoothing, uinput virtual device\n\n**Phase 2 — Signal** 🔄  \nFFT pipeline, rolling buffers, STFT live filtering *(current state)*\n\n**Phase 3 — Polish** 🔜  \nUX Dashboard with sensitivity slider, click stabilizer, system-wide toggle shortcuts\n\n**Future**  \nPort to Windows (HID drivers) and macOS (global input hooks). Potential health monitoring via anonymized tremor telemetry for clinical use.\n\n---\n\n## ⚠️ Known Limitations\n\n- **Linux only** — uses `/dev/uinput` and Linux input subsystem\n- **No middle click** — only left and right buttons registered\n- **64-sample warmup** — filter bypassed until buffer is full\n- Requires `sudo` to run\n\n---\n\n## 🛠️ Tech Stack\n\n`C++17` · `Rust` · `Bash` · `FFTW3` · `Linux uinput` · `Linux input subsystem`\n\n---\n\n## 📄 License\n\nThis project is maintained under the **GNU General Public License 3.0**.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favik43218%2Fstable-motion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favik43218%2Fstable-motion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favik43218%2Fstable-motion/lists"}