GitXplorerGitXplorer
a

sixdofone

public
9 stars
0 forks
2 issues

Commits

List of commits on branch main.
Verified
253cb5c69ecc86dad9e6d72328030b7ac6d39462

Update README.md

aalsuren committed 3 months ago
Verified
43a73c4b9d60904fceb4ed0418178ca0bd1a663d

Merge pull request #9 from alsuren/uv

aalsuren committed 5 months ago
Unverified
4d8774aff08b9ac37624da72a5ea14e9828487f6

feedback from twitter

aalsuren committed 5 months ago
Verified
3ed09b930b1bf6e553b382588ab41d0c43a52744

Merge pull request #8 from alsuren/uv

aalsuren committed 5 months ago
Unverified
809d78f84ef4c754e8ec59381d1aa0dcc408fb95

update readme

aalsuren committed 5 months ago
Unverified
d7a3c1b347c602ce02f3d5a74b60268c96083428

run app.py with 'uv run' (deps managed by uv add --script)

aalsuren committed 5 months ago

README

The README file for this repository.

SixDoFone

This is a python app for teleoperating a robot arm using the WebXR capabilities on your phone.

Setup

Install requirements

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

or just install uv and let it manage everything else just-in-time.

curl -LsSf https://astral.sh/uv/install.sh | sh

Get HTTPS working

#### Option A: Setup tailscale on all devices

This is recommended so that your phone can talk to your computer over https. You could use ngrok instead if you want.

Once you have installed tailscale on all devices, you can set up https-to-http proxying by doing:

tailscale serve --bg localhost:8000

It should print something like:

Available within your tailnet:

https://yourhostname.your-tailnet-domain.ts.net/
|-- proxy http://localhost:8000

Serve started and running in the background.
To disable the proxy, run: tailscale serve --https=443 off
#### Option A: Setup tailscale on all devices

This is the quickest way to get things set up, but you may find that ngrok adds quite a lot of latency. If you find yourself only getting a couple of poses per second then consider switching to tailscale.

  • Go to https://ngrok.com and sign up
  • run ngrok config add-authtoken <your auth token> to make ngrok happy
    • if you don't have ngrok installed, just plough through and let it fail when running, then try again (pyngrok will install ngrok for you)

Add a .env file

cp .env.example .env

and then add a SIXDOFONE_SHARED_SECRET by following the instructions in your new .env file.

Also set USE_NGROK or USE_TAILSCALE to something nonempty, to pick one of them to use.

Running the app

Inside the python virtual environment, run:

python app.py

or if you are using uv, just run

./app.py

and it will manage the virtualenv and dependencies for you.

This will start the server on http port 8000, which tailscale will expose as https://yourhostname.your-tailnet-domain.ts.net/.

Hacking

Some notes:

  • You do not need nodejs in order to run the python server.
    • I did add @ts-check to the top of some files though, and you can run npm install to get clean type-checking in vscode.
    • Once https://tc39.es/proposal-type-annotations/ is implemented in some browsers, I will probably switch to using that.
    • I may add some CI checks for the typescript bits in the future. No promises.
  • I initially picked flask because I heard a rumour that this is what lerobot are using for some of their tools. I might switch to something pydantic/fastapi-based at some point though.