OpenC3 COSMOS XBox360 USB Controller Bridge
- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .gitignore | ||
| .python-version | ||
| bridge.txt | ||
| LICENSE.md | ||
| pyproject.toml | ||
| README.md | ||
| uv.lock | ||
| xbox360_interface.py | ||
| xbox360_raw_test.py | ||
OpenC3 COSMOS XBox360 USB Controller Bridge
This is a bridge to get XBox360 USB controller events into OpenC3 COSMOS.
In COSMOS, you need to install the XBox360 USB Controller plugin to read inputs as telemetry.
Preliminaries
- Install
uv
See https://docs.astral.sh/uv/getting-started/installation/.
- Install
libusb
$ brew install libusb
- Sync Python packages
$ uv sync
Usage
- Run the bridge
$ sudo env PYTHONPATH=. $(pwd)/.venv/bin/openc3pycli bridge bridge.txt
The invocation is a bit complicated because you need to be root to read from the USB device (sudo), but then need to get into the right virtual environment (env and PYTHONPATH=), and then call through the OpenC3 CLI ($(pwd)/.venv/bin/openc3pycli).
- Debugging
If you're unsure whether your XBox360 controller is sending something (or your script is reading it properly), you can use the test script.
$ sudo uv run xbox360-raw-test.py
Now twiddle the sticks a bit. You should get some data.
License
This OpenC3 bridge is released under the MIT License. See LICENSE.md