Krabby Compute - Parkour
Parkour policy inference client and utilities for the Krabby quadruped robot.
Overview
This package provides the parkour policy inference client that:
- Connects to HAL server via ZMQ
- Polls hardware observations
- Runs parkour policy inference
- Sends joint commands back to HAL server
Components
Inference Client (compute.parkour.inference_client.ParkourInferenceClient)
- Runs in a separate thread
- Manages HAL client connection
- Handles inference loop (poll → infer → command)
Policy Interface (compute.parkour.policy_interface.ParkourPolicyModel)
- Loads parkour policy checkpoints
- Runs inference on observations
- Uses OnPolicyRunnerWithExtractor for model loading
Mappers (compute.parkour.mappers)
- hardware_to_model: Maps Krabby hardware observations to parkour model format
- model_to_hardware: Maps parkour model actions to Krabby joint positions
Types (compute.parkour.parkour_types)
ParkourObservation: Observation in training formatParkourModelIO: Combined input for policy inferenceInferenceResponse: Policy inference output with action tensor
Installation
From source (development)
cd compute/parkour
pip install -e .
From wheel
pip install krabby-compute-parkour-0.1.0-py3-none-any.whl
Usage
As a library
from compute.parkour.inference_client import ParkourInferenceClient
from compute.parkour.policy_interface import ModelWeights
from hal.client.config import HalClientConfig
# Configure HAL client
hal_config = HalClientConfig(
observation_endpoint="inproc://hal_observation",
command_endpoint="inproc://hal_commands",
)
# Configure model
model_weights = ModelWeights(
checkpoint_path="/path/to/model.pt",
action_dim=12,
obs_dim=753,
)
# Create client
client = ParkourInferenceClient(
hal_client_config=hal_config,
model_weights=model_weights,
control_rate=100.0,
device="cuda",
transport_context=transport_context, # From HAL server
)
# Initialize and start
client.initialize()
client.start_thread(running_flag=lambda: True)
Architecture
┌──────────────────────────────────────┐
│ ParkourInferenceClient │
│ │
│ ┌────────────┐ ┌──────────────┐ │
│ │ HAL Client │───▶│ Policy Model │ │
│ └────────────┘ └──────────────┘ │
│ │ │ │
│ │ observations │ actions │
│ ▼ ▼ │
│ ┌──────────────────────────────┐ │
│ │ Hardware ↔ Model Mappers │ │
│ └──────────────────────────────┘ │
└──────────────────────────────────────┘
Dependencies
krabby-hal-client: For HAL communicationtorch: For policy inferencenumpy: For numerical operations
Development
Running Tests
pytest tests/
Building Wheel
python -m build
Notes
- Designed to run in a separate thread from HAL server
- Supports both inproc (same-process) and TCP (distributed) communication
- Zero-copy operations where possible for performance
Release files for krabby-compute-parkour 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| krabby_compute_parkour-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / krabby_compute_parkour-0.1.1-py3-none-any.whl
| Download URL | krabby_compute_parkour-0.1.1-py3-none-any.whl |
|---|---|
| Size | 56.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
985b94b188e614a1e53d95b7133d050d5561d8751d0e7ae992e3fc16272baf10
|
|
BLAKE2b-256 checksum How to use checksums |
e0d0fc6dcb2ce2f20f1ca4d8ad4d39bdacc0d03b3a4f7afa84cce04a8e18a7b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|