Skip to main content

The AI-ready robotics dev kit, with built-in remote control and action models support.

Project description

phosphobot

A community-driven platform for robotics enthusiasts to share and explore creative projects built with the phospho Junior Dev Kit.

phosphobot Python package on PyPi Y Combinator W24 phospho discord

Overview

This repository contains demo code and community projects developed using the phospho Junior Dev Kit. Whether you're a beginner or an experienced developer, you can explore existing projects or contribute your own creations.

Getting Started

  1. Get Your Dev Kit: Purchase your Phospho Junior Dev Kit at robots.phospho.ai. Unbox it and set it up following the instructions in the box.

  2. Control your Robot: Donwload the Meta Quest app, connect it to your robot, start teleoperating it.

  3. Record a Dataset: Record a dataset using the app. Do the same gesture 30-50 times (depending on the task complexity) to create a dataset.

  4. Install the Package:

pip install --upgrade phosphobot
  1. Train a Model: Use Le Robot to train a policy on the dataset you just recorded.
git clone https://github.com/huggingface/lerobot.git
cd lerobot
pip install -e .

Add the configs/policy/act_so100_phosphobot.yamlfile from this repository to the lerobot/configs/policy directory in the lerobot repository.

Launch the training script with the following command from the lerobot repository (change the device to cuda if you have an NVIDIA GPU, mps if you use a MacBook Pro Sillicon, and cpu otherwise):

sudo python lerobot/scripts/train.py \
  --dataset.repo_id=<HF_USERNAME>/<DATASET_NAME> \
  --policy.type=<act or diffusion or tdmpc or vqbet> \
  --output_dir=outputs/train/phoshobot_test \
  --job_name=phosphobot_test \
  --device=cpu \
  --wandb.enable=true
  1. Use a model to control your robot: Launch a server (see here how to serve a policy).

Launch the phosphobot server:

phosphobot run

Run the folowing script to control your robot using the model:

from phosphobot.camera import AllCameras
from phosphobot.api.client import PhosphoApi
from phosphobot.am import ACT

import time
import numpy as np

# Connect to the phosphobot server
client = PhosphoApi(base_url="http://localhost:80")

# Get a camera frame
allcameras = AllCameras()

# Need to wait for the cameras to initialize
time.sleep(1)

# Instantiate the model
model = ACT()

while True:
    images = [
        allcameras.get_rgb_frame(camera_id=0, resize=(240, 320)),
        allcameras.get_rgb_frame(camera_id=1, resize=(240, 320)),
        allcameras.get_rgb_frame(camera_id=2, resize=(240, 320)),
    ]

    # Get the robot state
    state = client.control.read_joints()

    inputs = {"state": np.array(state.angles_rad), "images": np.array(images)}

    # Go through the model
    actions = model(inputs)

    for action in actions:
        # Send the new joint postion to the robot
        client.control.write_joints(angles=action.tolist())
        # Wait to respect frequency control (30 Hz)
        time.sleep(1 / 30)

For the full detailed instructions and other model (Pi0, OpenVLA,...), refer to the docs.

Join the Community

Connect with other developers and share your experience in our Discord community

Community Projects

Explore projects created by our community members in the code_examples directory. Each project includes its own documentation and setup instructions.

Support

License

MIT License


Made with 💚 by the Phospho community

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

phosphobot-0.0.15.tar.gz (10.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

phosphobot-0.0.15-py3-none-any.whl (10.7 MB view details)

Uploaded Python 3

File details

Details for the file phosphobot-0.0.15.tar.gz.

File metadata

  • Download URL: phosphobot-0.0.15.tar.gz
  • Upload date:
  • Size: 10.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.13

File hashes

Hashes for phosphobot-0.0.15.tar.gz
Algorithm Hash digest
SHA256 eb7265e7e9c703d3b3d566c67bf2ad4d25cc485d3d55e2b62854b2ac9b11ff92
MD5 150596cd05baaf7afd84c1211ed282f9
BLAKE2b-256 2c06183b32e6b0fe09a45784fea082fc0c39db28d0b18675978b7d0d95bfbbb2

See more details on using hashes here.

File details

Details for the file phosphobot-0.0.15-py3-none-any.whl.

File metadata

File hashes

Hashes for phosphobot-0.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 02ca4a6b8fddd1f9af07fdfb37b8b8fc00c102fccfe5078997c3cd5c68ebc9c7
MD5 710c9490adc1fee6d07314fe9e28acdf
BLAKE2b-256 811f4edc04f0d20c4670815b19c0815519d0b269f0d46e235e18971d3a49ac41

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page