{"id":49565179,"url":"https://github.com/aaronjs99/flexiforce","last_synced_at":"2026-05-03T11:13:04.817Z","repository":{"id":292231263,"uuid":"980220296","full_name":"aaronjs99/flexiforce","owner":"aaronjs99","description":"FlexiForce: EMG-Driven Robotic Resistance Training Simulator","archived":false,"fork":false,"pushed_at":"2025-06-12T16:43:28.000Z","size":19415,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-06T00:39:31.277Z","etag":null,"topics":["admittance-control","controller-design","mujoco","opensim"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aaronjs99.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}},"created_at":"2025-05-08T19:08:52.000Z","updated_at":"2025-07-31T13:36:55.000Z","dependencies_parsed_at":"2025-05-31T00:41:27.862Z","dependency_job_id":"cbaa770d-8995-4ded-a234-31af92b6f2d0","html_url":"https://github.com/aaronjs99/flexiforce","commit_stats":null,"previous_names":["aaronjohnsabu1999/flexiforce","aaronjs99/flexiforce"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aaronjs99/flexiforce","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronjs99%2Fflexiforce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronjs99%2Fflexiforce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronjs99%2Fflexiforce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronjs99%2Fflexiforce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aaronjs99","download_url":"https://codeload.github.com/aaronjs99/flexiforce/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronjs99%2Fflexiforce/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32566492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"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":["admittance-control","controller-design","mujoco","opensim"],"created_at":"2026-05-03T11:13:04.214Z","updated_at":"2026-05-03T11:13:04.795Z","avatar_url":"https://github.com/aaronjs99.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FlexiForce: EMG-Driven Robotic Resistance Training Simulator\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/flexiforce-logo.png\" alt=\"FlexiForce Logo\" width=\"300\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Python-3.10-blue?logo=python\"/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/code%20style-black-000000.svg?style=flat\u0026logo=python\"/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/MuJoCo-enabled-orange?logo=robotframework\"/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/OpenSim-integrated-lightgrey?logo=opensourceinitiative\"/\u003e\n\u003c/p\u003e\n\n---\n\n## Overview\n\nFlexiForce simulates a personalized fitness and rehabilitation system where a redundant robotic arm (Franka Emika FP3) dynamically adjusts resistance based on real-time EMG data. Using MuJoCo for robotic simulation and OpenSim for muscle modeling, it implements a hybrid force-position controller that modulates end-effector resistance to keep user exertion aligned with a target % of max voluntary contraction.\n\n**Key Highlights**:\n- GUI for user-defined effort\n- Real-time EMG feedback\n- Redundant robot arm simulation\n- Modular controllers for benchmarking\n\n## Features\n\n- Closed-loop EMG feedback control\n- Real-time GUI-based effort input\n- Force-position hybrid control architecture\n- Support for both OpenSim and custom muscle models\n- Performance-optimized simulation in MuJoCo\n\n## Architecture\n\n```\n[ GUI Input (Target Effort) ] \n        ↓ \n[ Controller: Hybrid Force-Position ]\n        ↓\n[ MuJoCo Robot Arm ] ←→ [ OpenSim / EMG Model ]\n        ↑                            ↓\n    [ Force Output ] ←── Feedback Loop ──→ [ EMG Activation ]\n```\n\n## Installation\n\n### 1. Clone the Repository\n\n```bash\ngit clone --recurse-submodules https://github.com/aaronjohnsabu1999/flexiforce.git\ncd flexiforce\n```\n\nIf you forgot `--recurse-submodules`:\n```bash\ngit submodule update --init --recursive\n```\n\n### 2. Create a Virtual Environment (Recommended)\n\n```bash\npython -m venv venv\n```\n\nActivate it:\n- macOS/Linux: `source venv/bin/activate`\n- Windows: `venv\\Scripts\\activate`\n\n### 3. Install Dependencies\n\n```bash\npip install -r requirements.txt\n```\n\n#### On Linux:\n```bash\nsudo apt update \u0026\u0026 sudo apt install -y python3-tk\n```\n\n#### On Windows:\nTkinter is bundled with Python. To check:\n```bash\npython -m tkinter\n```\n\n## 🐧 WSL2 Setup Instructions (Ubuntu/Debian)\n\n### Step 1: Install Required Packages\n\n```bash\nsudo apt update\nsudo apt install -y python3-tk libgl1-mesa-glx libglu1-mesa mesa-utils\n```\n\n### Step 2: Launch X Server on Windows\n\nInstall and start [VcXsrv](https://sourceforge.net/projects/vcxsrv/):\n\n- ✅ Multiple windows\n- ✅ Start no client\n- ✅ Disable access control\n- 🔁 Try both with/without Native OpenGL\n\n### Step 3: Export Display Settings\n\nIn `~/.bashrc` or before running:\n```bash\nexport DISPLAY=:0\nexport LIBGL_ALWAYS_INDIRECT=0\n```\nReload with:\n```bash\nsource ~/.bashrc\n```\n\n### Step 4: Test with glxgears\n\n```bash\nglxgears\n```\n\nIf gears spin, OpenGL is working.\n\n### Step 5: Run the Simulation\n\n```bash\npython3 main.py\n```\n\n- ✅ GUI will open via Tkinter\n- ✅ MuJoCo viewer will render (if OpenGL works)\n- 🔁 Headless fallback if viewer fails\n\n## Troubleshooting\n\n- **No MuJoCo viewer?** Ensure VcXsrv is running and `DISPLAY` is set.\n- **OpenGL errors?** Try `export LIBGL_ALWAYS_INDIRECT=1`\n- **Still broken?** Run in native Windows with Python + MuJoCo setup.\n\n## License\n\nMIT License. See `LICENSE.md`.\n\n## Authors\n\n- Ben Forbes  \n- Samantha Herman  \n- Aaron John Sabu  \n\nCourse project for **MAE 263C** – University of California, Los Angeles\n\n## License\n\nMIT License. See `LICENSE.md` for details.\n\n## Acknowledgments\n\n- Dr. Veronica Santos – MAE 263C\n- OpenSim and MuJoCo dev teams\n- Everyone who tolerates noisy EMG data and still finds signal in the chaos\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronjs99%2Fflexiforce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaronjs99%2Fflexiforce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronjs99%2Fflexiforce/lists"}