{"id":26115494,"url":"https://github.com/phospho-app/phosphobot","last_synced_at":"2025-04-13T04:13:30.161Z","repository":{"id":271860771,"uuid":"914796651","full_name":"phospho-app/phosphobot","owner":"phospho-app","description":"Share and explore robotics projects built with the phosphobot dev kit","archived":false,"fork":false,"pushed_at":"2025-04-12T20:32:17.000Z","size":39726,"stargazers_count":47,"open_issues_count":2,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-13T04:12:59.415Z","etag":null,"topics":["robots"],"latest_commit_sha":null,"homepage":"https://robots.phospho.ai","language":"Python","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/phospho-app.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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-01-10T10:21:53.000Z","updated_at":"2025-04-13T00:09:56.000Z","dependencies_parsed_at":"2025-01-10T11:33:42.446Z","dependency_job_id":"878271a0-360f-4f62-b9bb-4dc31593f0f0","html_url":"https://github.com/phospho-app/phosphobot","commit_stats":null,"previous_names":["phospho-app/phosphobot"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phospho-app%2Fphosphobot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phospho-app%2Fphosphobot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phospho-app%2Fphosphobot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phospho-app%2Fphosphobot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phospho-app","download_url":"https://codeload.github.com/phospho-app/phosphobot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248661720,"owners_count":21141451,"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","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":["robots"],"created_at":"2025-03-10T07:33:09.245Z","updated_at":"2025-04-13T04:13:30.151Z","avatar_url":"https://github.com/phospho-app.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phosphobot\n\nA community-driven platform for robotics enthusiasts to share and explore creative projects built with the phospho starter pack.\n\n\u003cdiv align=\"center\"\u003e\n\n\u003ca href=\"https://pypi.org/project/phosphobot/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/phosphobot?style=flat-square\u0026label=pypi+phospho\" alt=\"phosphobot Python package on PyPi\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.ycombinator.com/companies/phospho\"\u003e\u003cimg src=\"https://img.shields.io/badge/Y%20Combinator-W24-orange?style=flat-square\" alt=\"Y Combinator W24\"\u003e\u003c/a\u003e\n\u003ca href=\"https://discord.gg/cbkggY6NSK\"\u003e\u003cimg src=\"https://img.shields.io/discord/1106594252043071509\" alt=\"phospho discord\"\u003e\u003c/a\u003e\n\n\u003c/div\u003e\n\n## Overview\n\nThis repository contains demo code and community projects developed using the phospho starter pack. Whether you're a beginner or an experienced developer, you can explore existing projects or contribute your own creations.\n\n## Getting started\n\n1. **Get Your Dev Kit**: Purchase your Phospho starter pack at [robots.phospho.ai](https://robots.phospho.ai). Unbox it and set it up following the instructions in the box.\n\n2. **Install the phosphobot server** and run it:\n\n```bash\n# Install it this way\ncurl -fsSL https://raw.githubusercontent.com/phospho-app/phosphobot/main/install.sh | bash\n# Start it this way\nphosphobot run\n# Upgrade it with brew or with apt\n# sudo apt update \u0026\u0026 sudo apt install phosphobot\n# brew update \u0026\u0026 brew upgrade phosphobot\n```\n\n3. Use the **phosphobot python client** to interact with the phosphobot server API.\n\n```\npip install --upgrade phosphobot\n```\n\nWe release new versions very often.\n\n## How to train ACT with LeRobot?\n\n1. **Record a Dataset with phosphobot**: Record a dataset using the app. Do the same gesture 30-50 times (depending on the task complexity) to create a dataset. [Learn more](https://docs.phospho.ai/basic-usage/dataset-recording)\n\n2. **Install LeRobot**. [LeRobot](https://github.com/huggingface/lerobot) by HuggingFace is a research-oriented library for AI training which is still a work in progress. We made a few workarounds to make sure it works reliably. On MacOS, here is a step by step guide.\n\n2.1. Install [uv](https://docs.astral.sh/uv/), a Python environment manager.\n\n```bash\n# On macOS and Linux.\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n```\n\n2.2 Create a new directory and install requirements.\n\n```bash\nmkdir my_model\ncd my_model\nuv init\nuv add phosphobot git+https://github.com/phospho-app/lerobot\ngit clone https://github.com/phospho-app/lerobot\n```\n\n2.3 On MacOS M1, you need to set this variable for torchcodec to work.\n\n```bash\nexport DYLD_LIBRARY_PATH=\"/opt/homebrew/lib:/usr/local/lib:$DYLD_LIBRARY_PATH\"\n```\n\n2.4 Run the **LeRobot** training script. For example, on Mac M1:\n\n```bash\nuv run lerobot/lerobot/scripts/train.py \\\n --dataset.repo_id=PLB/simple-lego-pickup-mono-2 \\\n --policy.type=act \\\n --output_dir=outputs/train/phoshobot_test \\\n --job_name=phosphobot_test \\\n --policy.device=mps\n```\n\nChange the dataset.repo_id to the id of your dataset on Hugging Face.\n\nChange the `--policy.device` flag based on your hardware: `cuda` if you have an NVIDIA GPU, `mps` if you use a MacBook Pro Sillicon, and `cpu` otherwise.\n\n3. **Use the ACT model to control your robot**:\n\n3.1 Launch the ACT server to run inference. This should be running on a beefy GPU machine. Check out our folder [/inference] for more details.\n\n```bash\ncurl -o server.py https://raw.githubusercontent.com/phospho-app/phosphobot/refs/heads/main/inference/ACT/server.py\n```\n\n```bash\nuv run server.py --model_id LegrandFrederic/Orange-brick-in-black-box # Replace with \u003cYOUR_HF_MODEL_ID\u003e\n```\n\n3.2 Make sure the [phosphobot server](https://docs.phospho.ai/installation) is running to control your robot:\n\n```bash\n# Install it this way\ncurl -fsSL https://raw.githubusercontent.com/phospho-app/phosphobot/main/install.sh | bash\n# Start it this way\nphosphobot run\n```\n\n3.3 Create a script called `my_model/client.py` and copy paste the content below.\n\n```python\n# /// script\n# requires-python = \"\u003e=3.11\"\n# dependencies = [\n#     \"phosphobot\",\n# ]\n# ///\nfrom phosphobot.camera import AllCameras\nfrom phosphobot.api.client import PhosphoApi\nfrom phosphobot.am import ACT\n\nimport time\nimport numpy as np\n\n# Connect to the phosphobot server\nclient = PhosphoApi(base_url=\"http://localhost:80\")\n\n# Get a camera frame\nallcameras = AllCameras()\n\n# Need to wait for the cameras to initialize\ntime.sleep(1)\n\n# Instantiate the model\nmodel = ACT()\n\nwhile True:\n    images = [\n        allcameras.get_rgb_frame(camera_id=0, resize=(240, 320)),\n        allcameras.get_rgb_frame(camera_id=1, resize=(240, 320)),\n        allcameras.get_rgb_frame(camera_id=2, resize=(240, 320)),\n    ]\n\n    # Get the robot state\n    state = client.control.read_joints()\n\n    inputs = {\"state\": np.array(state.angles_rad), \"images\": np.array(images)}\n\n    # Go through the model\n    actions = model(inputs)\n\n    for action in actions:\n        # Send the new joint postion to the robot\n        client.control.write_joints(angles=action.tolist())\n        # Wait to respect frequency control (30 Hz)\n        time.sleep(1 / 30)\n```\n\n3.4 Run this script to control your robot using the model:\n\n```\nuv run client.py\n```\n\nFor the full detailed instructions and other model (Pi0, OpenVLA,...), refer to the [docs](https://docs.phospho.ai/basic-usage/inference).\n\n## Join the Community\n\nConnect with other developers and share your experience in our [Discord community](https://discord.gg/cbkggY6NSK)\n\n## Community Projects\n\nExplore projects created by our community members in the [code_examples](./code_examples) directory. Each project includes its own documentation and setup instructions.\n\n## Support\n\n- **Documentation**: Read the [documentation](https://docs.phospho.ai)\n- **Community Support**: Join our [Discord server](https://discord.gg/cbkggY6NSK)\n- **Issues**: Submit problems or suggestions through [GitHub Issues](https://github.com/phospho-app/phosphobot/issues)\n\n## License\n\nMIT License\n\n---\n\nMade with 💚 by the Phospho community\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphospho-app%2Fphosphobot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphospho-app%2Fphosphobot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphospho-app%2Fphosphobot/lists"}