This repository holds Python scripts, examples, and automation for PteroSim: RL loops, tooling, and utilities that use the gRPC Python SDK (pterosim).
Get the simulator from PteroSim v0.1.0 open beta (GitHub Release) — download the build for your OS and read the release notes there.
- Virtual environment
- Install the
pterosimpackage - Get and run PteroSim
- Connect from Python
- Pre-commit hooks (contributors)
Virtual environment is required for smooth usage. Create one in this repo and activate it before every session.
Windows — PowerShell
cd your\path\to\PteroSimScripts
python -m venv pterosim-venv
.\pterosim-venv\Scripts\Activate.ps1If activation is blocked by execution policy:
Set-ExecutionPolicy -Scope CurrentUser RemoteSignedLinux / macOS — bash
cd your/path/to/PteroSimScripts
python3 -m venv pterosim-venv
source pterosim-venv/bin/activateDeactivate when finished:
deactivateTo remove the virtual environment (e.g. recreate from scratch or reclaim disk space), run deactivate first if the venv is still active (your prompt shows (pterosim-venv)). Then delete the pterosim-venv folder:
Windows — PowerShell
cd your\path\to\PteroSimScripts
Remove-Item -Recurse -Force pterosim-venvLinux / macOS — bash
cd your/path/to/PteroSimScripts
rm -rf pterosim-venvThe Python package ships inside the unpacked simulator archive:
Windows — PowerShell
cd your\path\to\Pterosim\Plugins\PteroSimScripting\SDK\python
python -m pip install -U pip
python -m pip install -e .Linux / macOS — bash
cd your/path/to/Pterosim/Plugins/PteroSimScripting/SDK/python
python3 -m pip install -U pip
python3 -m pip install -e .
python -m pip install numpy- Open PteroSim.
- Download the asset for your OS and unpack it.
- Windows: from the unpacked folder, run
PteroSim.exe. Linux: runPteroSim.sh. - Start a play session in the shipped build so the simulator is running.
You need a running sim so the gRPC server in PteroSimScripting is listening.
With the virtual environment activated and PteroSim running:
from pterosim import PteroSim
sim = PteroSim("localhost:10010")Remote machine: use "192.168.1.10:10010" (host running the simulator) instead of localhost, and allow TCP on that port through the firewall.
Lint/format rules live in a single place — .pre-commit-config.yaml (ruff + ruff-format, plus whitespace/EOF/YAML/TOML/AST checks). CI runs the exact same rules via pre-commit run --all-files, so what passes locally passes in CI.
Install the hook once (with the venv activated):
python -m pip install pre-commit
pre-commit installFrom then on, git commit runs the checks automatically. To run them manually across the whole repo:
pre-commit run --all-files