armnet-client 0.3.2__tar.gz → 0.3.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. {armnet_client-0.3.2 → armnet_client-0.3.3}/PKG-INFO +5 -3
  2. {armnet_client-0.3.2 → armnet_client-0.3.3}/pyproject.toml +8 -3
  3. armnet_client-0.3.3/src/armnet_client/_config.py +31 -0
  4. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/client.py +6 -4
  5. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/current_gate.py +10 -6
  6. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/groot_eval.py +13 -0
  7. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/lerobot_eval.py +22 -0
  8. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/lerobot_record.py +13 -20
  9. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/lerobot_teleop.py +13 -19
  10. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/openpi_eval.py +21 -0
  11. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/runtime_groot_eval/groot_eval_runtime.py +17 -0
  12. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/runtime_lerobot_eval/lerobot_eval_runtime.py +13 -0
  13. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/runtime_openpi_eval/openpi_eval_runtime.py +34 -15
  14. armnet_client-0.3.3/src/armnet_client/variation.py +160 -0
  15. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_bimanual_lerobot.py +47 -3
  16. armnet_client-0.3.3/tests/test_client_defaults.py +46 -0
  17. armnet_client-0.3.3/tests/test_client_exposes_no_rail_homing_control.py +77 -0
  18. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_current_gate.py +6 -9
  19. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_execute_queue.py +27 -2
  20. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_groot_eval.py +2 -6
  21. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_rail_cli.py +19 -0
  22. armnet_client-0.3.3/tests/test_variation_preflight.py +187 -0
  23. armnet_client-0.3.2/src/armnet_client/_config.py +0 -41
  24. {armnet_client-0.3.2 → armnet_client-0.3.3}/.gitignore +0 -0
  25. {armnet_client-0.3.2 → armnet_client-0.3.3}/LICENSE +0 -0
  26. {armnet_client-0.3.2 → armnet_client-0.3.3}/README.md +0 -0
  27. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/__init__.py +0 -0
  28. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/_credential_cache.py +0 -0
  29. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/cli.py +0 -0
  30. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/current_gate_datasets.json +0 -0
  31. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/current_gate_profile.json +0 -0
  32. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/eval_support/__init__.py +0 -0
  33. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/eval_support/dataset.py +0 -0
  34. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/eval_support/recovery.py +0 -0
  35. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/eval_support/robot.py +0 -0
  36. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/eval_support/rollout.py +0 -0
  37. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/execute.py +0 -0
  38. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/image.py +0 -0
  39. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/instrumentation.py +0 -0
  40. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/keypoint_capture.py +0 -0
  41. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/lerobot_train.py +0 -0
  42. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/local.py +0 -0
  43. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/local_container.py +0 -0
  44. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/policy_eval.py +0 -0
  45. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/rerun_stream.py +0 -0
  46. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/robot_telemetry/__init__.py +0 -0
  47. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/robot_telemetry/inspect.py +0 -0
  48. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/robot_telemetry/schema.py +0 -0
  49. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/robot_telemetry/session.py +0 -0
  50. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/robot_telemetry/writer.py +0 -0
  51. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/runtime_build.py +0 -0
  52. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/runtime_groot_eval/Dockerfile +0 -0
  53. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/runtime_lerobot_eval/.dockerignore +0 -0
  54. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/runtime_lerobot_eval/Dockerfile +0 -0
  55. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/runtime_lerobot_eval/diffusion_resolution_patch.py +0 -0
  56. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/runtime_lerobot_eval/install_molmoact2_plugin.py +0 -0
  57. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/runtime_lerobot_eval/state_guard.py +0 -0
  58. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/runtime_lerobot_record/Dockerfile +0 -0
  59. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/runtime_lerobot_record/lerobot_record_runtime.py +0 -0
  60. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/runtime_lerobot_teleop/Dockerfile +0 -0
  61. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/runtime_lerobot_teleop/lerobot_teleop_runtime.py +0 -0
  62. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/runtime_openpi_eval/Dockerfile +0 -0
  63. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/runtime_openpi_eval/state_guard.py +0 -0
  64. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/teleop_stream.py +0 -0
  65. {armnet_client-0.3.2 → armnet_client-0.3.3}/src/armnet_client/volume.py +0 -0
  66. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/fixtures/robot_telemetry_schema.json +0 -0
  67. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_cli_jobs.py +0 -0
  68. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_eval_completion_grace.py +0 -0
  69. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_eval_support.py +0 -0
  70. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_instrumentation_watch.py +0 -0
  71. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_lerobot_eval_build_context.py +0 -0
  72. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_lerobot_eval_policy_device.py +0 -0
  73. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_lightbox_cli.py +0 -0
  74. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_openpi_state_guard.py +0 -0
  75. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_policy_eval.py +0 -0
  76. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_record_finish_on_completion.py +0 -0
  77. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_robot_telemetry_cli.py +0 -0
  78. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_robot_telemetry_inspect.py +0 -0
  79. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_robot_telemetry_lean_schema.py +0 -0
  80. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_robot_telemetry_runtime_integration.py +0 -0
  81. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_robot_telemetry_schema.py +0 -0
  82. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_robot_telemetry_session.py +0 -0
  83. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_robot_telemetry_writer.py +0 -0
  84. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_runtime_build_context.py +0 -0
  85. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_runtime_is_not_required.py +0 -0
  86. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_teleop_finish_on_completion.py +0 -0
  87. {armnet_client-0.3.2 → armnet_client-0.3.3}/tests/test_wait_interrupt_stop.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: armnet-client
3
- Version: 0.3.2
3
+ Version: 0.3.3
4
4
  Summary: armnet client SDK — submit jobs to the platform from dev machines and CI.
5
5
  Project-URL: Homepage, https://armnet.dev
6
6
  Project-URL: Documentation, https://docs.armnet.dev/packages/client/
@@ -8,17 +8,19 @@ Author: Ville Kuosmanen
8
8
  License-Expression: Apache-2.0
9
9
  License-File: LICENSE
10
10
  Requires-Python: <3.13,>=3.12
11
- Requires-Dist: armnet-core>=0.3.0
11
+ Requires-Dist: armnet-core>=0.3.1
12
12
  Requires-Dist: httpx<1,>=0.27
13
13
  Requires-Dist: pydantic<3,>=2.6
14
14
  Requires-Dist: pynput<2,>=1.8
15
15
  Requires-Dist: python-dotenv<2,>=1.0
16
16
  Requires-Dist: tqdm<5,>=4.66
17
17
  Requires-Dist: websocket-client<2,>=1.8
18
+ Provides-Extra: current-gate
19
+ Requires-Dist: huggingface-hub<2,>=0.28; extra == 'current-gate'
18
20
  Provides-Extra: dev
19
21
  Requires-Dist: pytest>=8; extra == 'dev'
20
22
  Provides-Extra: local
21
- Requires-Dist: armnet-runtime>=0.3.0; extra == 'local'
23
+ Requires-Dist: armnet-runtime>=0.3.1; extra == 'local'
22
24
  Provides-Extra: teleop
23
25
  Requires-Dist: lerobot[feetech,smolvla]==0.5.1; extra == 'teleop'
24
26
  Provides-Extra: viz
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "armnet-client"
7
- version = "0.3.2"
7
+ version = "0.3.3"
8
8
  description = "armnet client SDK \u2014 submit jobs to the platform from dev machines and CI."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12,<3.13"
@@ -18,7 +18,7 @@ authors = [{ name = "Ville Kuosmanen" }]
18
18
  # armnet-busybox is deliberately absent — an environment is installed in the
19
19
  # runtime image that needs it, never on the submitting side.
20
20
  dependencies = [
21
- "armnet-core>=0.3.0",
21
+ "armnet-core>=0.3.1",
22
22
  "pydantic>=2.6,<3",
23
23
  "httpx>=0.27,<1",
24
24
  "websocket-client>=1.8,<2",
@@ -40,13 +40,18 @@ dev = [
40
40
  # Submitting jobs to a real cell does not \u2014 containers install the runtime
41
41
  # themselves \u2014 which is why this is an extra and not a hard dependency.
42
42
  local = [
43
- "armnet-runtime>=0.3.0",
43
+ "armnet-runtime>=0.3.1",
44
44
  ]
45
45
  # Live visualization: replays a job's ctx.log_rerun_data(...) stream into a
46
46
  # Rerun viewer (execute(..., use_rerun=True) / init_rerun()).
47
47
  viz = [
48
48
  "rerun-sdk>=0.20,<1",
49
49
  ]
50
+ # Offline derivation of the arm-current safety profile downloads telemetry
51
+ # sidecars from Hugging Face datasets.
52
+ current-gate = [
53
+ "huggingface-hub>=0.28,<2",
54
+ ]
50
55
  # Remote teleoperation: drive a remote cell's robot from a locally-attached
51
56
  # LeRobot leader arm (stream_job_teleop / TeleoperatorConfig).
52
57
  teleop = [
@@ -0,0 +1,31 @@
1
+ """SDK configuration.
2
+
3
+ The production orchestrator URL is built into the public SDK so normal users do
4
+ not configure infrastructure endpoints. ``DEBUG_ARMNET_ORCHESTRATOR_URI`` is
5
+ the single development/CI override for a locally running stack.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import os
11
+
12
+ from armnet_core import API_KEY_ENV
13
+
14
+ DEFAULT_ORCHESTRATOR_URL = "https://armnet-orchestrator-240868335442.europe-west2.run.app"
15
+
16
+ DEBUG_OVERRIDE_ENV = "DEBUG_ARMNET_ORCHESTRATOR_URI"
17
+
18
+
19
+ def orchestrator_url() -> str:
20
+ """Resolve the orchestrator base URL.
21
+
22
+ Returns the env-var override if set, otherwise the SDK default.
23
+ """
24
+
25
+ return os.environ.get(DEBUG_OVERRIDE_ENV) or DEFAULT_ORCHESTRATOR_URL
26
+
27
+
28
+ def api_key() -> str | None:
29
+ """Resolve the API key used for authenticated orchestrator requests."""
30
+
31
+ return os.environ.get(API_KEY_ENV)
@@ -29,6 +29,7 @@ from armnet_core import (
29
29
  WhoAmI,
30
30
  )
31
31
  from armnet_client._config import api_key as default_api_key
32
+ from armnet_client._config import orchestrator_url
32
33
 
33
34
 
34
35
  class OrchestratorError(RuntimeError):
@@ -48,20 +49,21 @@ class OrchestratorError(RuntimeError):
48
49
  class OrchestratorClient:
49
50
  """Synchronous client for the orchestrator HTTP API.
50
51
 
51
- No auth in M0.5 (design doc explicitly defers it). When auth lands
52
- we'll add an ``api_key`` arg here and inject it as a header.
52
+ Defaults to Armnet's production API and the ``ARMNET_API_KEY`` environment
53
+ variable. Pass ``base_url`` or ``api_key`` explicitly for development and
54
+ custom integrations.
53
55
  """
54
56
 
55
57
  def __init__(
56
58
  self,
57
- base_url: str = "http://localhost:8000",
59
+ base_url: Optional[str] = None,
58
60
  timeout: float = 30.0,
59
61
  api_key: Optional[str] = None,
60
62
  ) -> None:
61
63
  key = api_key if api_key is not None else default_api_key()
62
64
  headers = {API_KEY_HEADER: key} if key else None
63
65
  self._client = httpx.Client(
64
- base_url=base_url.rstrip("/"),
66
+ base_url=(base_url or orchestrator_url()).rstrip("/"),
65
67
  timeout=timeout,
66
68
  headers=headers,
67
69
  )
@@ -11,12 +11,14 @@ from importlib import resources
11
11
  from pathlib import Path
12
12
  from typing import Any
13
13
 
14
- from armnet_client.robot_telemetry.schema import CANONICAL_JOINTS, LIVE_GROUP_BITS
14
+ from armnet_client.robot_telemetry.schema import (CANONICAL_JOINTS,
15
+ LIVE_GROUP_BITS)
15
16
 
16
17
  CURRENT_BIT = 1 << LIVE_GROUP_BITS["current"]
17
18
  DEFAULT_PERCENTILES = (95, 99)
18
19
  DEFAULT_GATE_PERCENTILE = 99
19
- DEFAULT_GATE_PERCENT_ABOVE = 100.0
20
+ # Cell configuration owns the gate; jobs request no percentile tightening by default.
21
+ DEFAULT_GATE_PERCENT_ABOVE = 0.0
20
22
  DEFAULT_GATE_DURATION_MS = 200.0
21
23
  # Joints whose baseline max is at or below this use max as the trip limit
22
24
  # instead of percentile × (1 + percent_above). Catches near-zero joints like
@@ -168,7 +170,7 @@ def download_dataset_root(repo_id: str, *, cache_dir: Path | None = None) -> Pat
168
170
  except ImportError as exc: # pragma: no cover - env dependent
169
171
  raise ImportError(
170
172
  "huggingface_hub is required to download datasets for current-gate "
171
- "derivation; install the teleop extra or huggingface_hub"
173
+ "derivation; install 'armnet-client[current-gate]'"
172
174
  ) from exc
173
175
  kwargs: dict[str, Any] = {
174
176
  "repo_id": repo_id,
@@ -262,9 +264,10 @@ def current_gate_config(
262
264
  ) -> dict | None:
263
265
  """Build the job-arg payload for the edge current gate.
264
266
 
265
- Defaults to p99 + 100% for 200 ms. Joints whose baseline max is at or below
266
- ``TINY_MAX_THRESHOLD`` use that max as the trip limit instead. Pass
267
- ``percent_above <= 0`` (or ``None``) to disable the gate.
267
+ Joints whose baseline max is at or below ``TINY_MAX_THRESHOLD`` use that
268
+ max as the trip limit instead. Pass ``percent_above <= 0`` (or ``None``)
269
+ to omit the optional job-level percentile tightening; the cell-owned edge
270
+ gate remains active.
268
271
  """
269
272
  if percent_above is None or float(percent_above) <= 0.0:
270
273
  return None
@@ -275,6 +278,7 @@ def current_gate_config(
275
278
  raise ValueError("current gate duration must be greater than zero")
276
279
  return {
277
280
  "enabled": True,
281
+ "mode": "percentile",
278
282
  "percentile": int(percentile),
279
283
  "percent_above": percent,
280
284
  "duration_ms": duration,
@@ -19,6 +19,9 @@ from armnet_client.current_gate import (
19
19
  current_gate_job_args,
20
20
  )
21
21
  from armnet_client.runtime_build import stage_armnet_packages
22
+ # No pre-flight here: this backend exposes no manual rail or brightness
23
+ # override to check, so every scenario it runs comes from the sampler.
24
+ from armnet_client.variation import DEFAULT_VARIATION_SEED, variation_job_args
22
25
  from armnet_client.volume import upload_to_cloud_volume
23
26
 
24
27
  try:
@@ -66,6 +69,15 @@ class ArmnetConfig:
66
69
  streaming_encoding: bool = True
67
70
  vcodec: str = "libsvtav1"
68
71
  encoder_threads: int = 2
72
+ # Perturb the rail position, camera aim and lighting a little each episode,
73
+ # so the score reflects how well the policy generalises rather than how well
74
+ # one pose was staged. Off by default: an unvaried eval is still the right
75
+ # measurement when comparing against earlier unvaried numbers.
76
+ variation: bool = False
77
+ # Fixes the perturbation sequence, so two policies meet the same scenes and
78
+ # a re-run reproduces. Only the device draws use it; the policy's own
79
+ # randomness stays on --seed.
80
+ variation_seed: int = DEFAULT_VARIATION_SEED
69
81
  current_gate_percentile: int = DEFAULT_GATE_PERCENTILE
70
82
  current_gate_percent_above: float = DEFAULT_GATE_PERCENT_ABOVE
71
83
  current_gate_duration_ms: float = DEFAULT_GATE_DURATION_MS
@@ -155,6 +167,7 @@ def submit_groot_eval(cfg: ArmnetGrootEvalPipelineConfig) -> None:
155
167
  **({"record_dataset_repo_id": cfg.armnet.record_dataset_repo_id}
156
168
  if cfg.armnet.record_dataset_repo_id else {}),
157
169
  **({} if cfg.armnet.push_to_hub else {"no_push_to_hub": True}),
170
+ **variation_job_args(cfg.armnet.variation, cfg.armnet.variation_seed),
158
171
  **current_gate_job_args(
159
172
  cfg.armnet.current_gate_percentile,
160
173
  cfg.armnet.current_gate_percent_above,
@@ -22,6 +22,11 @@ from armnet_client.current_gate import (
22
22
  current_gate_job_args,
23
23
  )
24
24
  from armnet_client.runtime_build import stage_armnet_packages, stage_client_modules
25
+ from armnet_client.variation import (
26
+ DEFAULT_VARIATION_SEED,
27
+ preflight_manual_overrides,
28
+ variation_job_args,
29
+ )
25
30
  from armnet_client.volume import upload_to_cloud_volume
26
31
 
27
32
  logger = logging.getLogger(__name__)
@@ -84,6 +89,15 @@ class ArmnetConfig:
84
89
  # 0..1 of the usable rail. None leaves the slide untouched; ignored on
85
90
  # cells without a rail (the edge pings servo id 7 to find out).
86
91
  rail: Optional[float] = None
92
+ # Perturb the rail position, camera aim and lighting a little each episode,
93
+ # so the score reflects how well the policy generalises rather than how well
94
+ # one pose was staged. Off by default: an unvaried eval is still the right
95
+ # measurement when comparing against earlier unvaried numbers.
96
+ variation: bool = False
97
+ # Fixes the perturbation sequence, so two policies meet the same scenes and
98
+ # a re-run reproduces. Only the device draws use it; the policy's own
99
+ # randomness stays on --seed.
100
+ variation_seed: int = DEFAULT_VARIATION_SEED
87
101
  robot_telemetry: Literal["off", "context", "safety", "full"] = "full"
88
102
  robot_telemetry_strict: bool = False
89
103
  current_gate_percentile: Literal[95, 99] = DEFAULT_GATE_PERCENTILE
@@ -152,6 +166,13 @@ def _eval_main(cfg: ArmnetEvalPipelineConfig) -> None:
152
166
  )
153
167
  policy_path = f"volume://{cfg.armnet.volume_policy_path}"
154
168
 
169
+ preflight_manual_overrides(
170
+ embodiment=cfg.armnet.embodiment,
171
+ task=cfg.armnet.task,
172
+ rail=cfg.armnet.rail,
173
+ lightbox_brightness=cfg.armnet.lightbox_brightness,
174
+ )
175
+
155
176
  image = build_eval_image()
156
177
 
157
178
  policy_device = _resolve_remote_policy_device(str(cfg.policy.device))
@@ -191,6 +212,7 @@ def _eval_main(cfg: ArmnetEvalPipelineConfig) -> None:
191
212
  if cfg.armnet.lightbox_frequency is not None else {}),
192
213
  **({"rail_position": max(0.0, min(1.0, float(cfg.armnet.rail)))}
193
214
  if cfg.armnet.rail is not None else {}),
215
+ **variation_job_args(cfg.armnet.variation, cfg.armnet.variation_seed),
194
216
  **({"hf_user": cfg.armnet.hf_user}
195
217
  if cfg.armnet.hf_user else {}),
196
218
  },
@@ -41,27 +41,19 @@ import threading
41
41
  from importlib import resources
42
42
  from pathlib import Path
43
43
 
44
- from dotenv import load_dotenv
45
-
46
- from armnet_client import (
47
- Image,
48
- JobSpec,
49
- OrchestratorClient,
50
- TeleoperatorConfig,
51
- init_rerun,
52
- stream_job_teleop,
53
- )
44
+ from armnet_client import (Image, JobSpec, OrchestratorClient,
45
+ TeleoperatorConfig, init_rerun, stream_job_teleop)
54
46
  from armnet_client._config import orchestrator_url
55
- from armnet_client.runtime_build import stage_armnet_packages, stage_client_modules
56
- from armnet_client.current_gate import (
57
- DEFAULT_GATE_DURATION_MS,
58
- DEFAULT_GATE_PERCENT_ABOVE,
59
- DEFAULT_GATE_PERCENTILE,
60
- current_gate_job_args,
61
- )
47
+ from armnet_client.current_gate import (DEFAULT_GATE_DURATION_MS,
48
+ DEFAULT_GATE_PERCENT_ABOVE,
49
+ DEFAULT_GATE_PERCENTILE,
50
+ current_gate_job_args)
62
51
  from armnet_client.execute import _stream_job_logs
63
52
  from armnet_client.rerun_stream import stream_job_rerun
53
+ from armnet_client.runtime_build import (stage_armnet_packages,
54
+ stage_client_modules)
64
55
  from armnet_client.teleop_stream import start_recording_key_listener
56
+ from dotenv import load_dotenv
65
57
 
66
58
  _IMAGE_NAME = "armnet-lerobot-record"
67
59
  # Generous slack on top of pure episode time: every episode boundary waits for
@@ -131,8 +123,9 @@ def _parse_args(argv: list[str] | None = None) -> argparse.Namespace:
131
123
  type=float,
132
124
  default=DEFAULT_GATE_PERCENT_ABOVE,
133
125
  help=(
134
- "Percentage above the selected percentile for the gate "
135
- f"(default: {DEFAULT_GATE_PERCENT_ABOVE:g}; 0 disables)"
126
+ "Optional percentile-mode tightening above the selected percentile "
127
+ f"(default: {DEFAULT_GATE_PERCENT_ABOVE:g}; 0 uses only the "
128
+ "cell-owned gate)"
136
129
  ),
137
130
  )
138
131
  parser.add_argument(
@@ -150,7 +143,7 @@ def _parse_args(argv: list[str] | None = None) -> argparse.Namespace:
150
143
  parser.add_argument("--armnet.completion-grace-s", dest="completion_grace_s", type=float, default=None, help="Seconds to keep recording after the task is scored complete, so the episode ends on you bringing the arm clear rather than on the frame the goal was met (default 1). Only used with --armnet.finish-on-task-completion; 0 ends the episode immediately")
151
144
  parser.add_argument("--lightbox-brightness", dest="lightbox_brightness", type=_lightbox_pct, default=None, help="Override cell lightbox brightness for the session, percent 0-100. Omit to use the cell JSON default. Ignored on cells without a lightbox")
152
145
  parser.add_argument("--lightbox-frequency", dest="lightbox_frequency", type=_lightbox_hz, default=None, help="Override cell lightbox PWM frequency for the session, Hz. Omit to use the cell JSON default. Ignored on cells without a lightbox")
153
- parser.add_argument("--rail", dest="rail", type=float, default=None, help="Position the cell's rail axis (7th-axis slide) before the session, fraction 0..1 of the usable rail. Omit to leave it where it is; ignored on cells without a rail")
146
+ parser.add_argument("--rail", dest="rail", type=float, default=None, help="Position the cell's rail axis (7th-axis slide) before the session, fraction 0..1 of the usable rail. Omit to use the cell JSON rail.default_position_percent; ignored on cells without a rail")
154
147
  parser.add_argument("--armnet.embodiment", dest="embodiment", default="lerobot/so-101", help="Robot embodiment (default lerobot/so-101)")
155
148
  parser.add_argument("--armnet.task", dest="task", default=None, help="Cell task slug; omit to let any cell of the embodiment pick the job up")
156
149
  parser.add_argument(
@@ -33,26 +33,19 @@ import threading
33
33
  from importlib import resources
34
34
  from pathlib import Path
35
35
 
36
- from dotenv import load_dotenv
37
- from armnet_client import (
38
- Image,
39
- JobSpec,
40
- OrchestratorClient,
41
- TeleoperatorConfig,
42
- init_rerun,
43
- stream_job_teleop,
44
- )
36
+ from armnet_client import (Image, JobSpec, OrchestratorClient,
37
+ TeleoperatorConfig, init_rerun, stream_job_teleop)
45
38
  from armnet_client._config import orchestrator_url
46
- from armnet_client.runtime_build import stage_armnet_packages, stage_client_modules
47
- from armnet_client.current_gate import (
48
- DEFAULT_GATE_DURATION_MS,
49
- DEFAULT_GATE_PERCENT_ABOVE,
50
- DEFAULT_GATE_PERCENTILE,
51
- current_gate_job_args,
52
- )
39
+ from armnet_client.current_gate import (DEFAULT_GATE_DURATION_MS,
40
+ DEFAULT_GATE_PERCENT_ABOVE,
41
+ DEFAULT_GATE_PERCENTILE,
42
+ current_gate_job_args)
53
43
  from armnet_client.execute import _stream_job_logs
54
44
  from armnet_client.rerun_stream import stream_job_rerun
45
+ from armnet_client.runtime_build import (stage_armnet_packages,
46
+ stage_client_modules)
55
47
  from armnet_client.teleop_stream import start_recording_key_listener
48
+ from dotenv import load_dotenv
56
49
 
57
50
  _IMAGE_NAME = "armnet-lerobot-teleop"
58
51
  # Wall-clock slack on top of the teleop duration: covers image pull, cell
@@ -105,8 +98,9 @@ def _parse_args(argv: list[str] | None = None) -> argparse.Namespace:
105
98
  type=float,
106
99
  default=DEFAULT_GATE_PERCENT_ABOVE,
107
100
  help=(
108
- "Percentage above the selected percentile for the gate "
109
- f"(default: {DEFAULT_GATE_PERCENT_ABOVE:g}; 0 disables)"
101
+ "Optional percentile-mode tightening above the selected percentile "
102
+ f"(default: {DEFAULT_GATE_PERCENT_ABOVE:g}; 0 uses only the "
103
+ "cell-owned gate)"
110
104
  ),
111
105
  )
112
106
  parser.add_argument(
@@ -120,7 +114,7 @@ def _parse_args(argv: list[str] | None = None) -> argparse.Namespace:
120
114
  )
121
115
  parser.add_argument("--lightbox-brightness", dest="lightbox_brightness", type=_lightbox_pct, default=None, help="Override cell lightbox brightness for the session, percent 0-100. Omit to use the cell JSON default. Ignored on cells without a lightbox")
122
116
  parser.add_argument("--lightbox-frequency", dest="lightbox_frequency", type=_lightbox_hz, default=None, help="Override cell lightbox PWM frequency for the session, Hz. Omit to use the cell JSON default. Ignored on cells without a lightbox")
123
- parser.add_argument("--rail", dest="rail", type=float, default=None, help="Position the cell's rail axis (7th-axis slide) before the session, fraction 0..1 of the usable rail. Omit to leave it where it is; ignored on cells without a rail")
117
+ parser.add_argument("--rail", dest="rail", type=float, default=None, help="Position the cell's rail axis (7th-axis slide) before the session, fraction 0..1 of the usable rail. Omit to use the cell JSON rail.default_position_percent; ignored on cells without a rail")
124
118
  parser.add_argument(
125
119
  "--capture-interval-s",
126
120
  dest="capture_interval_s",
@@ -47,6 +47,11 @@ from armnet_client.current_gate import (
47
47
  current_gate_job_args,
48
48
  )
49
49
  from armnet_client.runtime_build import stage_armnet_packages, stage_client_modules
50
+ from armnet_client.variation import (
51
+ DEFAULT_VARIATION_SEED,
52
+ preflight_manual_overrides,
53
+ variation_job_args,
54
+ )
50
55
  from armnet_client.volume import upload_to_cloud_volume
51
56
 
52
57
  try:
@@ -122,6 +127,15 @@ class ArmnetConfig:
122
127
  # Override cell lightbox PWM frequency for the run, Hz. None uses the cell
123
128
  # JSON default; ignored on cells without a lightbox.
124
129
  lightbox_frequency: Optional[int] = None
130
+ # Perturb the rail position, camera aim and lighting a little each episode,
131
+ # so the score reflects how well the policy generalises rather than how well
132
+ # one pose was staged. Off by default: an unvaried eval is still the right
133
+ # measurement when comparing against earlier unvaried numbers.
134
+ variation: bool = False
135
+ # Fixes the perturbation sequence, so two policies meet the same scenes and
136
+ # a re-run reproduces. Only the device draws use it; the policy's own
137
+ # randomness stays on --seed.
138
+ variation_seed: int = DEFAULT_VARIATION_SEED
125
139
  # Publish this eval's cell-scored results to the shared Armnet leaderboard.
126
140
  # Success counts come from the cell, not from anything reported by the eval;
127
141
  # you only name the policy being evaluated. Needs the container's HF token to
@@ -177,6 +191,12 @@ def _eval_main(cfg: ArmnetOpenpiEvalPipelineConfig) -> None:
177
191
  if not cfg.openpi.config_name:
178
192
  raise ValueError("--openpi.config_name is required")
179
193
 
194
+ preflight_manual_overrides(
195
+ embodiment=cfg.armnet.embodiment,
196
+ task=cfg.armnet.task,
197
+ lightbox_brightness=cfg.armnet.lightbox_brightness,
198
+ )
199
+
180
200
  checkpoint = cfg.openpi.checkpoint_dir
181
201
  if cfg.armnet.volume_checkpoint_path:
182
202
  with OrchestratorClient(orchestrator_url()) as client:
@@ -227,6 +247,7 @@ def _eval_main(cfg: ArmnetOpenpiEvalPipelineConfig) -> None:
227
247
  if cfg.armnet.lightbox_brightness is not None else {}),
228
248
  **({"lightbox_frequency": int(cfg.armnet.lightbox_frequency)}
229
249
  if cfg.armnet.lightbox_frequency is not None else {}),
250
+ **variation_job_args(cfg.armnet.variation, cfg.armnet.variation_seed),
230
251
  **({"submit_to_leaderboard": True}
231
252
  if cfg.armnet.submit_to_leaderboard else {}),
232
253
  **({"leaderboard_policy_repo_id": cfg.armnet.leaderboard_policy_repo_id}
@@ -15,6 +15,12 @@ Quickstart::
15
15
  --armnet.episode_time_s=30 \\
16
16
  --armnet.fps=20 \\
17
17
  --armnet.secrets="{HF_TOKEN: huggingface-token}"
18
+
19
+ Job args:
20
+ - ``variation`` (bool): perturb rail position, camera aim and lighting each
21
+ episode, so the score measures generalisation rather
22
+ than one staged pose.
23
+ - ``variation_seed`` (int, default 42): fixes the perturbation sequence.
18
24
  """
19
25
 
20
26
  from __future__ import annotations
@@ -48,6 +54,7 @@ from lerobot.utils.constants import ACTION, OBS_STR
48
54
  from lerobot.utils.errors import DeviceNotConnectedError
49
55
  from lerobot.utils.robot_utils import precise_sleep
50
56
  from armnet_runtime import Context, ResetTimeoutException, main, require_so101_embodiment
57
+ from armnet_runtime.variation import apply_episode_variation
51
58
 
52
59
  logger = logging.getLogger(__name__)
53
60
 
@@ -778,6 +785,13 @@ def run(ctx: Context) -> dict[str, Any]:
778
785
  except ResetTimeoutException as exc:
779
786
  reset_timeout = exc
780
787
  break
788
+
789
+ # Every episode including the first: the job-start reset put the
790
+ # cell in its unvaried pose, so episode 0 needs perturbing too.
791
+ # Its own generator, so the line below still controls the
792
+ # policy's randomness alone.
793
+ variation = apply_episode_variation(ctx, episode_ix)
794
+
781
795
  if start_seed is not None:
782
796
  np.random.seed(int(start_seed) + episode_ix)
783
797
  broker.reset()
@@ -824,6 +838,9 @@ def run(ctx: Context) -> dict[str, Any]:
824
838
  "success": success,
825
839
  "duration_s": time.perf_counter() - start_t,
826
840
  "ticks": ticks,
841
+ # The scene this episode actually ran in, so a re-run
842
+ # can be checked as like-for-like rather than assumed.
843
+ "variation": variation,
827
844
  }
828
845
  )
829
846
  finally:
@@ -39,6 +39,10 @@ Job args:
39
39
  episode is decided, so it ends on a finished motion.
40
40
  - ``device_recovery_s`` (float): how long to wait for a dropped device.
41
41
  - ``max_device_aborts`` (int): how many episodes may be lost before failing.
42
+ - ``variation`` (bool): perturb rail position, camera aim and lighting each
43
+ episode, so the score measures generalisation rather
44
+ than one staged pose.
45
+ - ``variation_seed`` (int, default 42): fixes the perturbation sequence.
42
46
  """
43
47
 
44
48
  from __future__ import annotations
@@ -84,6 +88,7 @@ from armnet_client.eval_support import (
84
88
  )
85
89
  from armnet_client.robot_telemetry.session import RobotTelemetrySession
86
90
  from armnet_runtime import Context, ResetTimeoutException, main, require_so101_embodiment
91
+ from armnet_runtime.variation import apply_episode_variation
87
92
 
88
93
  logger = logging.getLogger(__name__)
89
94
 
@@ -425,6 +430,10 @@ def run(ctx: Context) -> dict[str, Any]:
425
430
  reset_timeout = exc
426
431
  break
427
432
 
433
+ # Perturb the scene the policy is about to meet. Its own generator,
434
+ # so the lines below still control the policy's randomness alone.
435
+ variation = apply_episode_variation(ctx, episode_ix)
436
+
428
437
  if start_seed is not None:
429
438
  np.random.seed(int(start_seed) + episode_ix)
430
439
  torch.manual_seed(int(start_seed) + episode_ix)
@@ -578,6 +587,7 @@ def run(ctx: Context) -> dict[str, Any]:
578
587
  "duration_s": time.perf_counter() - started,
579
588
  "ticks": ticks,
580
589
  "seed": (int(start_seed) + episode_ix) if start_seed is not None else None,
590
+ "variation": variation,
581
591
  "state_clamped": (
582
592
  state_guard.episode_summary() if state_guard is not None else []
583
593
  ),
@@ -626,6 +636,9 @@ def run(ctx: Context) -> dict[str, Any]:
626
636
  "duration_s": elapsed,
627
637
  "ticks": ticks,
628
638
  "seed": (int(start_seed) + episode_ix) if start_seed is not None else None,
639
+ # The scene this episode actually ran in, so a re-run can be
640
+ # checked as like-for-like rather than assumed to be.
641
+ "variation": variation,
629
642
  "state_clamped": state_clamped,
630
643
  # An eval scored by a machine and one scored by a tired
631
644
  # human are not the same number; keep them tellable apart.
@@ -13,9 +13,10 @@ features it was trained on. Same integration as the LeRobot eval runtime.
13
13
 
14
14
  Supports both single-arm (``lerobot/so-101``) and bimanual
15
15
  (``lerobot/bimanual_so101``) cells; the job's embodiment must match the cell's
16
- arm count. Bimanual cells build a ``BiSOFollower`` and feed the policy a 12-DOF
17
- state (left arm joints then right arm joints) plus all camera images (e.g.
18
- ``top``, ``left_wrist``, ``right_wrist``); see :func:`_build_bimanual_policy_obs`.
16
+ arm count. Both paths forward every camera present on the observation (e.g.
17
+ single-arm ``front`` / ``top`` / ``wrist``, bimanual ``top`` / ``left_wrist`` /
18
+ ``right_wrist``) so the checkpoint's ``SO101Inputs`` can pick the keys it was
19
+ trained on; see :func:`_build_policy_obs`.
19
20
 
20
21
  The checkpoint is the **Orbax step folder** containing both ``params/`` and
21
22
  ``assets/`` (e.g. ``.../checkpoints/5000``). It is uploaded to the volume
@@ -33,6 +34,10 @@ Job args:
33
34
  inferred chunk before re-inferring.
34
35
  - ``policy_device`` (str, default "cuda")
35
36
  - ``start_seed`` (int | None)
37
+ - ``variation`` (bool): perturb rail position, camera aim and
38
+ lighting each episode, so the score measures generalisation rather than one
39
+ staged pose.
40
+ - ``variation_seed`` (int, default 42): fixes the perturbation sequence.
36
41
  - ``language_instruction`` (str | None): falls back to the cell's configured
37
42
  instruction, then the job task.
38
43
 
@@ -96,6 +101,7 @@ from armnet_client.eval_support import (
96
101
  save_episode,
97
102
  )
98
103
  from armnet_runtime import Context, ResetTimeoutException, main, require_so101_embodiment
104
+ from armnet_runtime.variation import apply_episode_variation
99
105
 
100
106
  logger = logging.getLogger(__name__)
101
107
 
@@ -205,8 +211,11 @@ def _build_policy_obs(
205
211
  ) -> dict[str, Any]:
206
212
  """Build the OpenPI input dict from a raw SO-101 observation.
207
213
 
208
- Single-arm keys match openpi's ``SO101Inputs``: 6-DOF state, front + wrist
209
- images, and the language prompt. For bimanual cells, see
214
+ Single-arm: 6-DOF state plus every camera present on the observation (typical
215
+ cell layout is ``front`` / ``top`` / ``wrist``). Emitting all of them keeps
216
+ the runtime agnostic to which subset a given checkpoint's ``SO101Inputs``
217
+ was trained on — older front+wrist policies ignore ``top``, while current
218
+ busybox configs require it as ``base_0_rgb``. For bimanual cells, see
210
219
  :func:`_build_bimanual_policy_obs`.
211
220
  """
212
221
  if bimanual:
@@ -214,17 +223,19 @@ def _build_policy_obs(
214
223
  missing = [f"{name}.pos" for name in MOTOR_NAMES if f"{name}.pos" not in raw_obs]
215
224
  if missing:
216
225
  raise KeyError(f"observation missing joint positions: {missing}")
217
- for cam in ("front", "wrist"):
218
- if cam not in raw_obs:
219
- raise KeyError(
220
- f"observation missing {cam!r} camera; OpenPI SO-101 expects 'front' and 'wrist'. "
221
- f"available keys: {sorted(raw_obs)}"
222
- )
226
+ images = {
227
+ f"observation.images.{name}": np.asarray(value)
228
+ for name, value in raw_obs.items()
229
+ if getattr(value, "ndim", 0) >= 2
230
+ }
231
+ if not images:
232
+ raise KeyError(
233
+ f"observation has no camera images; available keys: {sorted(raw_obs)}"
234
+ )
223
235
  state = np.asarray([raw_obs[f"{name}.pos"] for name in MOTOR_NAMES], dtype=np.float32)
224
236
  return {
225
237
  "observation.state": state,
226
- "observation.images.front": np.asarray(raw_obs["front"]),
227
- "observation.images.wrist": np.asarray(raw_obs["wrist"]),
238
+ **images,
228
239
  "prompt": task or "",
229
240
  }
230
241
 
@@ -338,8 +349,8 @@ def _dataset_features(robot: Any) -> dict[str, Any]:
338
349
 
339
350
  OpenPI checkpoints carry no LeRobot ``TrainPipelineConfig``/``ds_meta``, so
340
351
  (unlike ``lerobot_eval_runtime``) we derive the recorded schema straight
341
- from the SO-101 hardware features: 6-DOF state, ``front``/``wrist`` cameras,
342
- and the 6-DOF action.
352
+ from the SO-101 hardware features: joint state, every camera on the cell,
353
+ and the matching action space.
343
354
  """
344
355
  return combine_feature_dicts(
345
356
  hw_to_dataset_features(robot.action_features, ACTION, use_video=True),
@@ -478,6 +489,11 @@ def run(ctx: Context) -> dict[str, Any]:
478
489
  )
479
490
  reset_timeout = exc
480
491
  break
492
+
493
+ # Perturb the scene the policy is about to meet. Its own generator,
494
+ # so the line below still controls the policy's randomness alone.
495
+ variation = apply_episode_variation(ctx, episode_ix)
496
+
481
497
  if start_seed is not None:
482
498
  np.random.seed(int(start_seed) + episode_ix)
483
499
 
@@ -558,6 +574,9 @@ def run(ctx: Context) -> dict[str, Any]:
558
574
  "duration_s": elapsed,
559
575
  "ticks": ticks,
560
576
  "seed": (int(start_seed) + episode_ix) if start_seed is not None else None,
577
+ # The scene this episode actually ran in, so a re-run can be
578
+ # checked as like-for-like rather than assumed to be.
579
+ "variation": variation,
561
580
  # An eval scored by a machine and one scored by a tired
562
581
  # human are not the same number; keep them tellable apart.
563
582
  "scored_by": scored_by,