GitXplorerGitXplorer
a

sixdofone

public
9 stars
0 forks
2 issues

Commits

List of commits on branch main.
Verified
0ee1167a4982a090dbb688122130e4953e0841ea

Merge pull request #7 from alsuren/mycobot

aalsuren committed 5 months ago
Unverified
b5ec8ec5d67970c970d2010a5f1af83c11464e80

add mjpeg frames into rerun log

aalsuren committed 5 months ago
Unverified
2e5845253ac1b61ad19fe1d5d9e0e450c792816d

3d control of mycobot from the phone

aalsuren committed 5 months ago
Unverified
f1742f09025874df632eae67e05a1b0cad407d23

install pymycobot; fix other dep

aalsuren committed 5 months ago
Verified
44d33736a14969f0c2b925109a9fd58f42442381

Merge pull request #6 from alsuren/gamepad

aalsuren committed 5 months ago
Unverified
ed886c0204776e791e9fbe0cf2ced9277876e736

just use current pose axes rather than dragged version

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.