Layer 4 — rSkill (S1)
Part of the OpenRAL public-symbol inventory. Hand-curated;
(LNN)markers are refreshed bytools/refresh_methods_linenos.py.
python/rskill/src/openral_rskill/base.py
rSkillBase — abstract base class with lifecycle state machine.
- const
_TRANSITIONS: dict[RSkillState, frozenset[RSkillState]] = {...}— Legal lifecycle edges keyed by current state;_require_transitionchecks membership. (L59) class rSkillBase(abc.ABC)— Abstract base class for all OpenRAL skills (rSkill is the official package-format name). (L68)__init__(name, *, version='0.1.0', role='s1', embodiment_tags=None, latency_budget_ms=None)— Init only; does not configure or load weights. (L98)info -> RSkillInfo[@property] (L122)name -> str[@property] (L130)state -> RSkillState[@property] (L135)configure() -> None—unconfigured → inactive. (L142)activate() -> None—inactive → active. (L167)deactivate() -> None—active → inactive. (L189)shutdown() -> None— Any state →finalized. (L209)step(world_state) -> Action— One inference step (hot path). (L233)on_load_weights() -> None— Hook: load weights. (L279)on_unload_weights() -> None— Hook: release weights, called byshutdown()(VRAM eviction). (L286)on_quantize() -> None— Hook: apply quantization. (L296)on_warmup() -> None— Hook: dummy forward pass, called byactivate()before_activate_impl; default no-op. The deploy path implements it in the runner's policy shim (rskill_runner_node.pyon_warmup), which runsadapter.stepon a synthetic observation and swallows+logs failures asrskill_runner.warmup_failed. (L303)_configure_impl/_activate_impl/_deactivate_impl/_shutdown_impl/_step_impl()[@abstractmethod] (L313)- private:
_transition,_update,_require_transition,_enter_error
python/rskill/src/openral_rskill/runtime.py
Runtime Protocol and NullRuntime — inference backend contract.
class Runtime(Protocol)— Structural protocol for skill inference backends. (L24)is_loaded -> bool[@property] (L40)device -> str[@property] (L45)load(path) -> None(L49)infer(inputs) -> dict[str, Any](L61)quantize(config: QuantizationConfig) -> None(L76)warmup(inputs) -> None(L88)unload() -> None(L96)class NullRuntime— No-op backend for testing; same surface asRuntime, every method a no-op. (L101)__init__(device='cpu')(L123)is_loaded -> bool[@property] (L133)device -> str[@property] (L138)load(path) -> None(L142)infer(inputs) -> dict[str, Any](L150)quantize(config) -> None(L161)warmup(inputs) -> None(L168)unload() -> None(L175)
python/rskill/src/openral_rskill/runtime_pytorch.py
- const
_ALLOW_UNSAFE_PICKLE_ENV = "OPENRAL_ALLOW_UNSAFE_PICKLE"— Env var gatingload()'s pickle deserialization (C2). (L38) class PyTorchRuntime—torch-backedRuntime. (L41)__init__(device='cpu')(L70)is_loaded -> bool[@property] (L81)device -> str[@property] (L86)load(path) -> None— Unpickles a full module — gated behind_ALLOW_UNSAFE_PICKLE_ENV, C2. (L90)load_safetensors(path, *, model, strict=True) -> None— Safe: loads astate_dictinto a caller-supplied module, no code execution — preferred for new skills. (L146)infer(inputs) -> dict[str, Any](L202)quantize(config) -> None— Dynamic INT8 on Linear. (L229)warmup(inputs) -> None(L261)unload() -> None— Frees CUDA cache. (L273)
python/rskill/src/openral_rskill/runtime_onnx.py
- const
_CUDA_PROVIDERS = ["CUDAExecutionProvider", "CPUExecutionProvider"](L30) - const
_CPU_PROVIDERS = ["CPUExecutionProvider"](L31) class ONNXRuntime—onnxruntime-backedRuntime. (L52)__init__(device='cpu')(L80)is_loaded -> bool[@property] (L100)device -> str[@property] (L105)load(path) -> None(L109)infer(inputs) -> dict[str, Any](L132)quantize(config) -> None— Always raises — ONNX quantization is pre-applied. (L157)warmup(inputs) -> None(L173)unload() -> None(L186)
python/rskill/src/openral_rskill/backend_registry.py
Extraction seam: entry-point-based runtime-backend + policy-attach-hook registry.
- const
_RUNTIME_BACKENDS_GROUP = "openral.runtime_backends"(L46) - const
_POLICY_ATTACH_HOOKS_GROUP = "openral.policy_attach_hooks"(L47) - const
_PRO_MODULES_GROUP = "openral.pro_modules"(L48) - const
_BUILTIN_RUNTIME_BACKENDS: dict[str, str] = {...}— Built-inkind→ runtime-class-name map (pytorch/onnx/null). (L54) resolve_runtime_backend(kind: str) -> type[Runtime]— built-in dict (pytorch→PyTorchRuntime,onnx→ONNXRuntime,null→NullRuntime) first, else looked up via theopenral.runtime_backendsentry-point group (e.g.openral-pro-trtregisteringtensorrt). Miss →ROSConfigErrornamingopenral-pro-trt. (L61)maybe_attach_pro_hooks(policy_name: str, skill, **kwargs) -> bool— Generic policy-attach-hook lookup via theopenral.policy_attach_hooksentry-point group (name =policy_name). No hook installed → debug log +False, never a silent skip; hook found → invoked ashook(skill, **kwargs). (L112)resolve_pro_module(name: str) -> ModuleType | None— Logical name → privately installed helper module via theopenral.pro_modulesentry-point group (entry values are bare module paths, e.g.nvbufsurface = openral_pro_trt.nvbufsurface). Absent → debug log +None; anImportErrorinside the module propagates; a non-module target →ROSConfigError. The only way open code reaches a Pro module (tools/check_no_pro_imports.pyrefuses direct imports). (L168)
Moved to OpenRAL Pro:
runtime_tensorrt.py(TensorRTRuntime),smolvla_export.py,smolvla_trt.py, andact_trt.pynow live in the privateopenral-pro-trtpackage asopenral_pro_trt.*, plugging in via theopenral.runtime_backends/openral.policy_attach_hooks/openral.pro_modulesentry-point groups above.
python/rskill/src/openral_rskill/quantization_gate.py
ADR-0123: open runs fp32 / fp16 / bf16; every format of 8 bits or fewer needs the OpenRAL Pro quantization package, registered as openral.pro_modules: quantization. Each check raises ROSConfigError naming the dtype, the caller and OpenRAL Pro, and never falls back to a wider dtype.
- const
PRO_QUANTIZATION_MODULE = "quantization"— the Pro module's logical name inopenral.pro_modules. (L41) - const
SUB_16_BIT_DTYPES: frozenset[str]— every spelling of an 8-bit-or-fewer format (int8,fp8,int4,nf4,4bit,8bit,fp4,nvfp4,fp4_nvfp4). (L45) is_sub_16_bit(dtype: object) -> bool— whether a token orQuantizationDtypeis 8 bits or fewer;None→False. (L50)pro_quantization_installed() -> bool—resolve_pro_module(PRO_QUANTIZATION_MODULE) is not None. (L62)require_pro_for_dtype(dtype: object, *, what: str) -> None— the dtype check, called byopenral_sim._quantization.resolve_quant_planon the resolved token and bytools/quantize_rskill.pyon--scheme. (L81)require_pro_for_manifest(manifest: RSkillManifest) -> None— the declared-dtype check for loaders that bypass the policy resolver:build_manifest_detector,build_topreward_monitor,build_reward_monitor(Robometer),build_scene_vlm. Also runsrequire_pro_for_checkpointon the selectedweights_uri(elsesource_repo) so abf16manifest over an upstream-quantized checkpoint is refused too; alocal://source has no config to read and passes. (L164)pro_quantization(*, what: str) -> ModuleType— the OpenRAL Pro quantization module (openral.pro_modules: quantization), which carries the bitsandbytes NF4 / LLM.int8 rewrites, the pre-quantized pack loaders and the GR00T NF4 scope; open adapters andtools/quantize_rskill.pycall them through it (ADR-0123 step 3). Raises the typedROSConfigErrornaming OpenRAL Pro when it is absent. (L103)sidecar_quantization_args(dtype: str | None, *, what: str, rewrites: bool = False) -> list[str]—["--quantization-config", <json>]for a sub-16-bit sidecar load (nf4,int8,prequantized_nf4), from Pro'shf_quantization_kwargs;[]for fp16 / bf16 / fp32. Every sidecar launcher (XR-1, InternVLA-N1, RLDX, LocateAnything, Qwen VLM, LingBot; the BEHAVIOR GR00T adapter) passes it to a server in a venv without Pro. The server buildsBitsAndBytesConfig(**kwargs)where it quantizes at load, and refuses any sub-16-bit load without it, so open sidecars run 16/32-bit only (ADR-0123 step 3).rewrites=Truealso appends["--pro-quant-module", <path>](Pro'ssidecar_module_path()) for the LingBot and BEHAVIOR GR00T sidecars, which rewrite their own Linears with that file. (L125)require_pro_for_checkpoint(source: str, *, what: str) -> None— refuses a checkpoint whoseconfig.jsoncarries aquantization_config(local dir,local://,hf://org/repo[@rev]ororg/repo); returns at once when Pro is installed; an unreadable config (offline, private, missing) logsquantization.checkpoint_uncheckedand passes, since the load that follows fails the same way. Called byresolve_quant_planonspec.weights_uri. (L218)
python/rskill/src/openral_rskill/loader.py
rSkill loader — HF Hub download, manifest validation, license guard, local registry.
- const
_DATA_HOME = Path(os.environ.get("OPENRAL_DATA_HOME", ...))— Base dir for the local rSkill registry. (L70) - const
_CACHE_HOME = Path(...)— Base dir HF Hub downloads land under. (L71) - const
DEFAULT_REGISTRY_PATH: Path = _DATA_HOME / "rskills.json"— Default JSON registry file written byrSkill.from_pretrained. (L75) - const
_RSKILL_MANIFEST_CACHE: dict[str, RSkillManifest] = {}— In-process memoisation forload_rskill_manifest. (L80) - const
_ALLOW_NONCOMMERCIAL_ENV = "OPENRAL_ALLOW_NONCOMMERCIAL"— Env var gating noncommercial-weight loads (CLAUDE.md §1.9). (L84) - const
_REQUIRE_SIGNED_ENV = "OPENRAL_REQUIRE_SIGNED_SKILLS"— Env var that fails closed when provenance signing is unverified. (L89) - const
_EMBODIMENT_ANY_TAG: str = "any"— Sentinel embodiment tag matching every robot. (L97) class InstalledRSkillEntry(BaseModel)— One row in the local registry. (L145) fields:repo_id, version, revision, local_dir, manifest_path, license, role, embodiment_tags, installed_atclass rSkill— Packaged, capability-tagged robot skill; provenance signing is not yet enforced. (L189)__init__(manifest, local_dir)(L213)from_pretrained(cls, repo_id, *, revision=None, cache_dir=None, force_download=False, commercial_use=True, registry_path=None) -> rSkill[@classmethod] —fetch_manifest+ license guard +install_snapshot. (L226)install_snapshot(cls, repo_id, manifest, manifest_path, *, revision=None, cache_dir=None, force_download=False, registry_path=None) -> rSkill[@classmethod] — The second half offrom_pretrainedfor a caller that gated the manifest itself (the runner'sManifestSkillResolver): unknown-benchmark warning, provenance guard, snapshot download pinned to the commitmanifest_pathwas fetched at (snapshots/<sha>/rskill.yaml, else the requestedrevision), registry entry. (L291)fetch_manifest(repo_id, *, revision=None, cache_dir=None, force_download=False) -> tuple[RSkillManifest, Path][@staticmethod] — Download and validate onlyrskill.yaml(never weights), so a caller can gate a Hub skill before the snapshot download;from_pretrainedstarts here andManifestSkillResolver.manifestuses it for Hub ids.ROSConfigErroron a missinghuggingface_hub, a failed or gated download, or an invalid manifest. (L385)from_yaml(cls, path, *, local_dir=None) -> rSkill[@classmethod] — Load locally without network; an invalid manifest is aROSConfigError(via_parse_manifest). (L438)list_installed(registry_path=None) -> list[InstalledRSkillEntry][@staticmethod] (L473)uninstall(repo_id, registry_path=None) -> bool[@staticmethod] — Remove from registry only. (L504)check_dispatchable(manifest) -> None[@staticmethod] — Refuse (ROSCapabilityMismatch, loggedrskill.dispatch_refused) a manifest whosekindis not inEXECUTE_RSKILL_KINDS, or an actuating kind declaring the"any"embodiment wildcard (it would passcheck_embodiment_tagson every robot; the palette never offers it). First ofopenral_rskill_ros.check_manifest_gates; re-run byManifestSkillResolver.build. (L534)check_embodiment_tags(manifest, robot_capabilities) -> None[@staticmethod] — Verify embodiment tag intersection (raises on disjoint sets). Exempt for perception kinds (detector/segmenter/vlm,_EMBODIMENT_AGNOSTIC_KINDS): they are camera-in → detections/text-out with no action contract, so they match any robot regardless of tags. (L586)check_capability_flags(manifest, robot_capabilities) -> None[@staticmethod] — Verify everymanifest.capabilities_requiredflag againstRobotCapabilities. (L614)check_runtime(manifest, robot_capabilities) -> None[@staticmethod] — Verifymanifest.runtime∈gpu_supported_runtimes; skipped when the legacy capability field is missing or empty (the GPU support fields moved toComputeSpec, so missing means "unknown" for now). (L646)check_quantization_dtype(manifest, robot_capabilities) -> None[@staticmethod] — Verifymanifest.quantization.dtype∈gpu_supported_dtypes; skipped when the legacy capability field is missing or empty. (L675)check_capabilities(manifest, robot_capabilities) -> None[@staticmethod] — Composition of the four narrower checks; raises on first failure. (L703)check_sensors(manifest, robot_sensors) -> None[@staticmethod] — Verify the robot exposes everySensorRequirementthe manifest declares: avla_feature_keyrequirement resolves to exactly one matching robot sensor, otherwise the robot must exposecountsensors of the requested modality meeting any resolution minimum.ROSCapabilityMismatchon any unmet requirement; a missing key names theimage_preprocessing.aliasesfix. The one sensor rule foropenral sim run,openral detectand the deploy runner (_build_runtime_skill_from_manifestcalls it before any weights are loaded into memory — a Hub skill's snapshot is already downloaded by then), so a required camera the robot cannot serve is refused instead of masked: the restock π0.5 (revision3599235f, requiringcontextwhere the OpenArm's head slot istop) ran every real goal with a masked head view. (L741)check_compatibility(manifest, robot, *, scene_gripper_convention=None) -> None[@staticmethod] — Umbrella entry point combiningcheck_capabilities(embodiment tags + capability flags, withcompute=robot.compute_edge or robot.compute_local),check_sensorsagainstrobot.sensors, andcheck_gripper_conventions. (L782)check_gripper_conventions(manifest, robot, *, scene_gripper_convention=None) -> None[@staticmethod] — Refuse (ROSCapabilityMismatch) a skill whoseGRIPPER_*encoding (its gripper actuator'sgripper_convention) differs from what the addressed end effector — or, withscene_gripper_convention, the simulated scene's environment — consumes; targets come from explicit gripper slots or slots expanded fromaction_contract.representation; an undeclared encoding on either side is a mismatch. Called by the runner when it resolves a skill and byopenral sim run. (L822)_check_license(manifest, *, commercial_use) -> None[@staticmethod] — Enforce license guards for the manifest's declared posture. (L1022)_validate_eval_jsons(skill_dir) -> None[@staticmethod] — Validate every<skill_dir>/eval/*.jsonagainstRSkillEvalResult. (L1122)_register(entry, registry_path) -> None[@staticmethod] (L1148)__repr__() -> str(L1172)resolve_rskill_local_dir(uri) -> Path | None— Return the absolute on-disk directory of an in-tree rSkill from a bare skill ref (name,rskills/<name>, or a Hub repo id — matched by the in-tree manifest'sname, asload_rskill_manifestdoes), orNonefor Hub-only refs. Used byopenral benchmark runto write eval results and updaterskill.yamlregardless of cwd. (L1184)parse_rskill_manifest(path, *, source=None) -> RSkillManifest— The loader's one uncached manifest parse (fetch_manifest/from_yaml/load_rskill_manifest/ the runner'sManifestSkillResolver.resolve): apydantic.ValidationErroror invalid YAML becomes aROSConfigError(CLAUDE.md §5) whose message names every failing field (loc: msg); logged at DEBUG asrskill.manifest_refused(CLI commands print JSON on stdout). DirectRSkillManifest.from_yamlcallers keep the schema-layerValidationError. (L104)manifest_paths_by_name(roots) -> dict[str, Path]—{name: path}over<root>/*/rskill.yaml, first match in root order (the reasoner palette seed's precedence). Reads only each file's top-levelname:line (~ms per tree, no validation), so an invalid manifest is still found and its typed parse reports the fault instead of the id looking unknown. Used byManifestSkillResolver.resolveand_intree_manifest_path_by_name. (L1302)_candidate_local_paths(uri) -> list[Path]— Enumerate on-disk candidates (cwd-relative + repo-root anchored) for a skill reference. Also unwraps HF Hub form<org>/rskill-<name>to in-treerskills/<name>. (L1211)discover_intree_rskills() -> list[tuple[str, RSkillManifest]]— Walk<repo>/rskills/*/rskill.yamland return(name, manifest)pairs. Malformed entries are skipped with a stderr warning. (L1243)find_repo_root_from(start) -> Path | None— Walk up fromstartfor the first ancestor containing bothpyproject.tomlandrskills/. Public, re-exported fromopenral_rskill.__init__; used across the package boundary byopenral_sim.cli,openral_cli.main, and the deploy_e2e launch file. (L1352)REPO_ROOT_ENV: str = "OPENRAL_REPO_ROOT"(L1274) — Env var naming the checkout whoserobots/+rskills/trees to use.repo_root_override() -> Path | None(L1278) — The$OPENRAL_REPO_ROOTcheckout when it holds bothrobots/andrskills/, elseNone. The one validity rule shared byopenral_cli.deploy_sim._repo_root_from(which refuses an invalid override),deploy_e2e.launch.py's skill tree and the in-tree resolution here.intree_repo_root() -> Path | None(L1294) — The checkout in-tree rSkills resolve from:repo_root_override(), elsefind_repo_root_fromthis package. Used by_candidate_local_paths,discover_intree_rskills,intree_embodiment_tagsand the name index.SKILL_ONLY_EMBODIMENT_TAGS: frozenset[str]—{"any", "custom", "multi"}: embodiment tags valid on an rSkill manifest that no robot declares. (L1365)intree_embodiment_tags() -> frozenset[str]—SKILL_ONLY_EMBODIMENT_TAGSplus everycapabilities.embodiment_tagsof the checkout'srobots/*/robot.yaml; the typo guard for the openEmbodimentTagid (scaffolders + CI). Public, re-exported. (L1370)known_benchmark_ids() -> frozenset[str] | None—benchmarks/*.yaml∪scenes/benchmark/*.yamlstems of the checkout, orNonewithout one; the membership set for the openBenchmarkNameid (writeback,benchmark sceneguard, CI). Public, re-exported. (L1387)_warn_unknown_benchmarks(manifest, *, source) -> None—rskill.unknown_benchmarkswarning (never a failure) when a Hub manifest cites a benchmark the checkout lacks; called byrSkill.from_pretrained. (L1403)validate_skill_ref(raw) -> str— Validate and return a bare rSkill reference unchanged (bare name,rskills/<name>path, or HF repo id); rejects a known URI scheme (hf://,local://,file://,http(s)://). Public, re-exported fromopenral_rskill.__init__. (L1415)gated_repo_error(repo_id, exc) -> ROSConfigError | None— Map a Hub download failure on a gated repo (GatedRepoError, or 401/403 wheremodel_inforeportsgated) to the actionable "OpenRAL Pro rSkill … is gated — request access at …" error;Nonefor private/missing repos and other errors. Used byrSkill.from_pretrained,load_rskill_manifestandopenral rskill install. Re-exported fromopenral_rskill.__init__. (L1455)load_rskill_manifest(uri) -> RSkillManifest— Resolve a bare skill reference to a parsed manifest. Tries local path → in-tree manifest whosenameis the<org>/rskill-<name>repo id (_intree_manifest_path_by_name: reads only eachname:, skips malformed files silently, logsrskill.manifest_resolved_in_treeat DEBUG) → HF Hub download. In-process memoised. (L1495)resolve_rskill_to_hf(uri) -> str— Resolve a skill reference to either the underlying HF Hub repo id (hf://...) or an absolute local path (local://...); both forms are accepted byfrom_pretrainedhelpers. (L1584)resolve_rskill_to_hf_with_revision(uri) -> tuple[str, str | None]— Likeresolve_rskill_to_hfbut splits the optional@<branch-or-sha>pin off anhf://weights_uriinto a separaterevision, since HF drops a pin glued onto the repo id. A directory that already holdsmodel.safetensors(or a shardedmodel.safetensors.index.json+ shards) next to itsrskill.yaml— the snapshotrSkill.from_pretrainedleaves in~/.cache/openral/rskills— resolves to itself rather than following itshf://pointer, which otherwise re-resolved a just-downloaded repo through the default HF cache (second fetch online, hard failure offline). In-treerskills/<name>/dirs ship no weights and are unaffected. RunsrSkill._check_provenanceon every call (cached or not), soOPENRAL_REQUIRE_SIGNED_SKILLS=1fails closed for the adapters that bypassfrom_pretrained(sim policies,behavior serve). (L1618)
python/rskill/src/openral_rskill/depth_estimator.py
The one rule for which kind: depth_estimator rSkill a depth provider may run, shared by openral deploy (before launch), deploy_e2e.launch.py and depth_provider_node (at configure).
depth_rskill_manifest(ref, rskills_dir) -> Path(L21) — The absoluterskill.yamla depth-skill reference names: a directory underrskills_dir, or a path to anrskill.yaml(a relative one resolves againstrskills_dir's parent, the same root).ROSConfigErrorwhen no manifest is there.openral deployforwards the result asestimated_depth_rskill:=; the launch's_depth_rskill_manifestwraps it.depth_skill(manifest_path, *, metric) -> tuple[DepthEstimatorContract, str](L50) — The contract and model repo (weights_uriminushf://and revision, which every sidecar reply must name), loaded throughrSkill.from_yaml(schema + license gate: Depth Pro 2'sapple-amlrneedsOPENRAL_ALLOW_NONCOMMERCIAL=1).ROSConfigErrorfor a non-depth skill, arelativeskill in metric mode, or one withoutpredicts_intrinsicsin the SLAM mode.
python/rskill/src/openral_rskill/hub_search.py
Free-text + facet search over an HF Hub org's rSkills — backs openral rskill search.
class HubRSkillCard(BaseModel)[frozen] — Catalog summary of a gated repo read from its public model card (reservedrskill-kind:/rskill-role:/embodiment:/rskill-license:tags + theopenral:block). (L47)HubRSkillCard.from_card(tags, card_data) -> HubRSkillCard | None— Build from Hub tags +cardData;Nonewhen the card lacks the contract. (L91)class HubRSkillHit(BaseModel)[frozen] — One matching Hub repo. (L128) fields:repo_id, manifest: RSkillManifest | None, card: HubRSkillCard | None, local: Literal["in-tree","installed"] | None, hub_tags: tuple[str, ...].local == "in-tree"compares the Hubrepo_idagainst thenamedeclared by a realrskills/<dir>/rskill.yaml— never against the fetched (possibly stale) remote manifest's ownnamefield.class HubRSkillSearchResult(BaseModel)— Search result:hits(sorted byrepo_id),skipped_repo_ids— the explicit record of dropped repos, since this module never logs a skip itself — andinspected. (L172)search_hub_rskills(query='', *, kind='', role='', embodiment='', license='', family='', org='OpenRAL', limit=None, max_workers=8) -> HubRSkillSearchResult— Lists every repo the org taggedrskillin one Hub call, fetches each candidate'srskill.yamlconcurrently, then matchesquerylocally (case-insensitive, every token substring-matched against id/name/description/tags) and applies the facet filters. A gated repo whose manifest is unreadable is matched from its card (hit.card).limitcaps hits after sorting byrepo_id. (L316)_manifest_haystack(repo_id, manifest, hub_tags) -> str— Build the lower-cased blob_matches_querysearches. (L203)_matches_query(query, haystack) -> bool— Every whitespace-split token must substring-match. (L220)_matches_facets(m, *, kind, role, embodiment, license_, family) -> bool— Whether a manifest passes every non-empty facet filter. (L226)_fetch_one(model) -> tuple[str, RSkillManifest | None, tuple[str, ...], str]— Worker-thread fetch + validate of one repo'srskill.yaml; narrow-catches expected errors so one bad repo never fails the whole search. The skip reason isn't logged (would corrupt--json | jqoutput) — only the repo id surfaces, viaHubRSkillSearchResult.skipped_repo_ids. (L247)_local_markers() -> tuple[frozenset[str], frozenset[str]]—(in_tree_names, installed_repo_ids)for thelocalmarker. A corrupt registry or an invalid row is treated as no installed entries, withlog.warning("rskill.hub_search.registry_unreadable", ...)— never silently swallowed. (L291)
python/rskill/src/openral_rskill/gpu_passthrough.py
GpuPassthroughSkill — minimal rSkill whose per-step image processing provably runs on GPU (M8 PR I/10).
_REDUCTION_SIZE: int = 64— module constant; reduction-target size used to bound GPU latency. (L48)_RGB_CHANNELS: int = 3— module constant; channel count for the GPU mean-reduction read-back. (L52)class GpuPassthroughSkill(rSkillBase)— Uploads eachSensorFrameto torch.cuda, runs per-channel mean reduction (with explicittorch.cuda.synchronize), emits result asAction.confidence. Refuses silent CPU fallback. (L55)__init__(sensor_id='wrist_rgb', n_joints=6, horizon=1, device='cuda', latency_budget_ms=None)(L76)step_count -> int[@property] (L104)on_load_weights() -> None— no-op (skill is weight-less). (L110)on_quantize() -> None— no-op (skill is weight-less). (L114)on_warmup() -> None— Allocate the GPU input buffer + launch a kernel so the first step doesn't pay cudaMalloc latency. (L118)_configure_impl()— Lazy-import torch, resolve device, raise ifcudarequested andtorch.cuda.is_available()is False. (L144)_activate_impl/_deactivate_impl/_shutdown_impl(L169)_step_impl(world_state) -> Action— Pull frame → CPU→GPU upload → GPU reduction → action with confidence. (L185)- private:
_extract_latest_image(world_state) -> NDArray[np.uint8],_gpu_reduce(frame, *, torch) -> (float, float, float). (L227 / L260) _channels(encoding: FrameEncoding) -> int— Per-pixel channel count for aFrameEncoding; MONO8 → 1, BGR8/RGB8 → 3, everything else falls through to a defensive BGR default of 3. (L297)_zero_frame() -> NDArray[np.uint8]— Resilient placeholder when no sensor frame is available yet. (L310)
python/rskill/src/openral_rskill/_diagnostics.py
Shared load-phase instrumentation seam — generalises the inline _heartbeat originally inside openral_sim.policies.pi05 so every VLA adapter's _build_* factory uses the same <prefix>_<name>_{start,heartbeat,done} event shape (CLAUDE.md §1.13 — single seam, no duplicates).
- const
_PAGE_SIZE = os.sysconf("SC_PAGE_SIZE") if hasattr(os, "sysconf") else 4096— Page size in bytes, for converting/proc/self/statm's page count intorss_mb. (L46) phase_timer(name, *, prefix="phase", interval_s=15.0, log=None, gpu_mb=False, **fields) -> Iterator[None][@contextmanager] — Emits<prefix>_<name>_start/heartbeat/doneevents withelapsed_s,rss_mb, andmajor_faultsso a slow-but-idle load is attributable to page reclaim.gpu_mb=Truealso attaches CUDA memory to the heartbeat; torch import is lazy so CPU-only hosts still work. (L136)gpu_allocated_mb(*, no_import=False) -> float | None— Current CUDA allocator usage in MB (memory_allocated, notmemory_reserved), orNoneif unavailable — the single GPU-memory probe eviction accounting and phase-timer heartbeats both read.no_import=Trueconsults only an already-imported torch. Public, re-exported fromopenral_rskill.__init__. (L49)_rss_majflt() -> tuple[float, int] | None— Process RSS (MB) + lifetime major-fault count from/proc/self/{statm,stat};Noneoff Linux. (L82)- const
_PAGE_SIZE: int = os.sysconf("SC_PAGE_SIZE") if hasattr(os, "sysconf") else 4096— Page size in bytes used to convert/proc/self/statm's page count intorss_mb. (L46)
python/rskill/src/openral_rskill/executor.py
Action-chunk executor shared by every chunked VLA family. Also the home of Real-Time Chunking (RTC): with an enabled lerobot RTCConfig the buffer becomes an ActionQueue whose tail a landing prefetch replaces.
- const
_CHUNK_TENSOR_RANK = 3— Expected(batch, chunk, action_dim)tensor rank for a chunk producer's output. (L98) _check_boundary_blend(steps, dims, *, chunk_size, prefetch_at, rtc_enabled, steps_name, dims_name) -> tuple[int, tuple[int, ...] | None]— Single source of the boundary-blend rules, shared byChunkedExecutor.__init__andbuild_chunk_executor(labels viasteps_name/dims_name).stepsan int>= 0, not with RTC, and<the shortest chunk that can enter behind a previous one:chunk_size, or withprefetch_at >= 1thechunk_size - prefetch_at - 1rows a merged chunk keeps (back tochunk_sizewhen that is0, since every merge is then fully stale);dimsgiven only withsteps >= 1, a non-empty list of distinct non-negative ints.ROSConfigErrorotherwise. (L101)_check_rtc_relative(policy, *, rtc_enabled, rtc_prefix_fn, has_postprocess, name) -> None— Single source of the relative-action RTC guard, shared byChunkedExecutor.__init__andbuild_chunk_executor(which runs it beforeinit_rtc_processor). With RTC enabled:ROSConfigErrorwhenpolicy.config.use_relative_actionsis set and nortc_prefix_fnre-anchors the prefix (the raw leftover is relative to the previous chunk's state, openral/openral#378), or whenrtc_prefix_fnis given withoutpostprocess_action(it reads the postprocessed, absolute rows). (L180)_copy_action(action) -> Any— Independent copy of a NumPy / torch action (clone()/np.array(copy=True)); the stored boundary-blend tail. (L228)_host_norm(value) -> float— L2 norm of a NumPy / torch action for any float dtype (torch reduces via.float(), so bfloat16 works; NumPy in float64); the DEBUGjump_norm. (L233)class ChunkedExecutor— Owns the per-step action buffer for every chunked VLA family, optionally overlapping chunk N+1 inference with execution via a background thread; callspredict_action_chunkdirectly rather than resetting lerobot's shared queue. Default producer ispolicy.predict_action_chunk, or a customchunk_fn;prefetch_at=0is synchronous.postprocess_actionfinishes each chunk where it is produced: one host copy of the whole chunk (any non-CPU device — CUDA, MPS, XPU), then the per-action postprocessor on every row, in the producing (prefetch) thread, so pops never touch the GPU and lerobot'sAbsoluteActionsProcessorStepadds the state cached for that chunk's own inference; under RTC it runs at merge time into theActionQueue's processed copy, which pops serve as NumPy, while the raw rows stay for the guidance blend. Without RTC a pre-fetched chunk is appended behind the tail minus its leading actions that are already in the past (_merge_prefetched): it was planned from the observation of the step that launched it (action i targets that step + i), and the tail served those steps meanwhile; a fully stale chunk is discarded and the step replans synchronously. RTC mode (an enabled lerobotRTCConfig) swaps the buffer for anActionQueueand replaces its tail on each prefetch landing instead of appending, requiringprefetch_at >= 1for real overlap. The guidance prefix is the raw leftover rows (truncated toexecution_horizon) — or, withrtc_prefix_fn(relative-action policies, seerelative_rtc_prefix_fn), the postprocessed absolute leftover re-anchored (in the prefetch thread, so a failure surfaces through the background-error path) to the state of the batch the prefetch was built from; ause_relative_actionspolicy without it is refused (_check_rtc_relative). Every merge logschunked_executor.rtc_mergeat DEBUG withchunk_index,merge_tick(served actions before the merge; actionmerge_tick + 1is the first from the new chunk) and the measuredrtc_delay. Boundary blend (opt-inboundary_blend_stepsK, non-RTC only, openral/openral#378): when a chunk enters behind a previous one (prefetch merge after the stale-row drop, or a synchronous re-plan),delta = last_served - new[0]is added to its first K rows with weight1 - (i+1)/(K+1)onblend_dims(default all), so the boundary step is1/(K+1)of the raw jump and row K onward is the policy's own (K must leave row K inside the entering chunk); runs on the robot-facing actions (NumPy or torch, any float dtype incl. bfloat16), stitches to a copy of the last served action (callers may mutate what they get), leaves dims outsideblend_dimsas produced (non-finite values included, never turned into NaN), never blends the first chunk after construction/reset(), and is refused together with RTC. (L244)__init__(policy=None, *, chunk_fn=None, chunk_size=None, prefetch_at=20, rtc_config=None, postprocess_action=None, boundary_blend_steps=0, blend_dims=None, rtc_prefix_fn=None)— Takes policy OR chunk_fn+chunk_size (ValueErrorotherwise). Negativeprefetch_atraisesROSConfigError; it's clamped tochunk_size - 1at construction. An enabledrtc_configrequires a clampedprefetch_at >= 1(ROSConfigErrorotherwise); a lead shorter thanexecution_horizonwarns rather than errors.boundary_blend_steps/blend_dimsare checked by_check_boundary_blend: steps an int>= 0and< chunk_size, and with a pre-fetch also< chunk_size - prefetch_at - 1(the rows a merged chunk keeps after its stale-row drop; when that is0every boundary is a synchronous re-plan and the bound ischunk_size);blend_dimsa non-empty list of distinct non-negative ints given only with steps>= 1; blending + RTC raisesROSConfigError. Ablend_dimsindex past the action width raisesROSConfigErrorwhen the first chunk lands, before any action is served (the robot-facing width is only known after postprocessing). (L247)start() -> None— Mark as running (call after policy is on-device). (L441)stop() -> None— Signal background thread, join. (L445)reset() -> None— Clear buffer/bg state, the boundary-blend tail, and the RTC queue + last delay;policy.reset()when a policy was given. (L452)select_action(batch_or_fn) -> Any— Next action; cold-start foreground inference / buffer pop / wait-on-prefetch. Delegates to_select_action_rtcin RTC mode. (L472)needs_observation_next() -> bool— Whether the nextselect_actionmay read its observation (cold start / empty buffer, a pre-fetch launch at the next pop, or RTC);Falseonly for a sure buffered pop, so a simulator can skip rendering that observation (openral_sim.policy.policy_needs_observation_next). (L525)- private:
_pop_and_maybe_prefetch(batch)(every pop routes through it so the trigger is branch-independent),_produce(payload, chunk_index, kind, rtc_kwargs=None)(passessynchronize=Trueon the prefetch path only),_materialize,_extend_buffer,_launch_prefetch(batch),_blend_boundary(actions)(every entering chunk passes through it: checks action type andblend_dimswidth, then fades the new chunk's offset from the last served action over its first K rows; DEBUGchunked_executor.boundary_blendwithjump_normandsteps) - private (RTC):
_select_action_rtc(batch)— serve from theActionQueue, re-checking after the prefetch wait so a landed chunk isn't discarded._rtc_merge(chunk, *, idx_before, served_before)— replace the tail;real_delayis the index delta the queue advanced during inference, and the loggedmerge_tickisserved_before(served count at launch) +real_delay, and the producer's batch dim must be 1._raise_bg_error_if_any()— re-raise a latched background error on the foreground thread. The prefetch path truncates the leftover tail toexecution_horizonrows so tail length doesn't depend on how earlyprefetch_atfires.
python/rskill/src/openral_rskill/execution_budget.py
Execution budgets measured on the graph clock (sim seconds under use_sim_time) with wall-clock backstops, shared by the rSkill runner's goal budget and ROSActionRskill's result wait. Without a graph clock the budget is time.monotonic() exactly as before — never the NTP-stepped ROS system clock. Adapted from DsslRobot/openral.
- const
DEFAULT_WALL_CAP_FACTOR = 20.0— a graph-clock budget may stretch to at most this many times its value in wall seconds: intact down to 0.05x real time (the slowest measured rendering graph, 0.09x, needs 11.1x). (L68) - const
DECLARATION_EXPIRY_MARGIN_S = 2.0— seconds before a grasp declaration's expiry at whichdeclaration_expiry_missends the goal (a tick plus the HAL's queued action; calibration point). (L247) - const
DEFAULT_CLOCK_STALL_S = 10.0— wall seconds the graph clock may stand still before the goal is failed. (L71) - const
PARAM_WALL_CAP_FACTOR = "execution_wall_cap_factor"— ROS parameter name a host node declares to overrideDEFAULT_WALL_CAP_FACTOR; read bynode_execution_budget. (L75) - const
PARAM_CLOCK_STALL_S = "graph_clock_stall_s"— ROS parameter name a host node declares to overrideDEFAULT_CLOCK_STALL_S; read bynode_execution_budget. (L76) class BudgetMiss(BaseModel)— Frozen Pydantic record of why a budget lapsed:kind("deadline_exceeded"|"clock_stalled", thefailure_reasonprefix),elapsed_son the budget's clock, and adetailstring. (L79)class ExecutionBudget— One goal's execution budget; starts at construction. (L99)__init__(budget_s, *, graph_now=None, wall_cap_factor=DEFAULT_WALL_CAP_FACTOR, stall_s=DEFAULT_CLOCK_STALL_S, wall_now=time.monotonic)—graph_nowis a graph-clock seconds callable (seegraph_clock_fn) orNonefor wall time;budget_s <= 0disables every check. RaisesROSConfigErroron a non-finitebudget_s(a NaN would never lapse) and, on a graph-clock budget, on a non-positive / non-finite backstop — the backstops cannot be disabled (deadline fallback is mandatory). (L119)on_graph_clock -> bool[@property] (L152)wall_bound_s -> float[@property] (L157) — Wall seconds after whichcheck()has lapsed at the latest: the budget on the wall clock,wall_cap_factor × budget_son the graph clock,0when disabled. The runner announces it for a result-only goal (ResultOnlyGoal).elapsed_s() -> float— Seconds on the budget's clock;0while a sim node has not yet received its first/clock(the budget anchors on the first non-zero reading, so that message is never a jump that lapses it). A backward/clockjump (sim reset) banks the elapsed so far and re-anchors, so elapsed neither freezes nor rewinds. (L191)progress() -> float—elapsed / budgetclamped to[0, 1]. (L199)check() -> BudgetMiss | None—deadline_exceededwhen elapsed > budget (either clock) or wall elapsed >wall_cap_factor x budget;clock_stalledwhen the graph clock has not advanced (or never started) forstall_sof wall time. (L203)declaration_expiry_miss(*, target_id, stamp_ns, timeout_s, now_ns, margin_s=DECLARATION_EXPIRY_MARGIN_S) -> BudgetMiss | None— Adeadline_exceededmiss once a grasp declaration armed atstamp_nsis withinmargin_s(2 s, calibration point) of itstimeout_sexpiry on the same clock;Nonewith time left ortimeout_s <= 0. A stamp of 0 ages like any other and a stamp ahead ofnow_ns(a sim reset) is already a miss, matching the kernel's own expiry test. The rSkill runner ends the goal on it, so a goal never runs past the kernel dropping its contact exemption (pro#51). (L250)graph_clock_fn(node) -> Callable[[], float] | None— The rclpy node's clock as a seconds callable when itsuse_sim_timeparameter is true at call time, elseNone(also fornode=Noneor an undeclared parameter); re-read per call so a node switched off sim time goes back totime.monotonic(). (L305)node_execution_budget(node, budget_s, *, graph_clock=True) -> ExecutionBudget— AnExecutionBudgetonnode's clock (graph clock whengraph_clockand the node is on sim time now), with the backstops taken from the node'sexecution_wall_cap_factor/graph_clock_stall_sparameters when declared, else the defaults — the one builder the rSkill runner andROSActionRskillshare. (L328)
python/rskill/src/openral_rskill/ros_action_rskill.py
ROS-wrapping rSkill adapter — bridges arbitrary ROS 2 action / service servers (MoveIt, Nav2, …) into the rSkillBase lifecycle. Selected by make_default_skill_resolver when manifest.kind in {"ros_action", "ros_service"}.
- const
_RESULT_DEADLINE_MULTIPLIER = 5.0(L87) - const
_MIN_RESULT_DEADLINE_S = 2.0(L92) - const
_FUTURE_POLL_INTERVAL_S = 0.02(L96) - const
_FINAL_WAYPOINT_TOL_RAD = 0.05— worst per-joint error at which the trajectory replay counts the final waypoint as reached (justification in the source comment). (L124) - const
_REPLAY_SETTLE_TIMEOUT_S = 10.0— bound past the plan's lasttime_from_startfor the measured joints to reach the final waypoint beforeROSDeadlineMissed. (L129) - const
_WAIT_FOR_SERVER_TIMEOUT_S = 15.0(L137) - const
_GOAL_STATUS_LABELS: dict[int, str] = {...}— Human-readable labels foraction_msgs/GoalStatuscodes, used in error/log messages. (L146) build_joint_permutation_from_names(*, source_names, target_names) -> list[int]— Build the permutation that reorders a wrapped server'sJointTrajectory.positionsinto the hostRobotDescription.jointsorder. RaisesROSConfigErroron set-inequality so a joint mismatch surfaces loudly instead of silently swapping bytes. (L311)clamped_start_state(desc, measured) -> dict | None— A MoveGrouprequest.start_state(is_diff) clamping each non-gripper joint measured past its manifestposition_limitsback into them;Nonewhen all are in bounds. MoveIt'sCheckStartStateBoundsrefuses any out-of-bounds start (a lift resting at-1e-6m), andfix_start_stateonly wraps continuous joints.ROSActionRskilladds it to a MoveGroup goal from the snapshot it captures before dispatch. (L241)- const
CUMOTION_PIPELINE_ID = "isaac_ros_cumotion"— the cuMotion MoveIt planning-pipeline id. (L280) maybe_inject_cumotion_pipeline(goal_dict, *, interface_type, capabilities) -> dict— On a host clearing the cuMotion GPU floor, setsrequest.pipeline_id = CUMOTION_PIPELINE_IDon aMoveGroupgoal so MoveIt plans with cuMotion; no-op for non-MoveGroup actions, low-VRAM hosts, an already-setpipeline_id, or a goal with norequestblock. Pure — never mutates the input. (L283)class ROSActionRskill(rSkillBase)—rSkillBaseshim wrapping a ROS 2 ActionClient (or service client), in two modes selected bymanifest.ros_integration.result_trajectory_field: trajectory mode replays one waypoint perstep(), paced by the plan'stime_from_starton the host node's clock but never more than one waypoint past the last one the measured joints reached (a kernel hold pauses the replay instead of letting it lead further; the settle bound restarts whenever a new waypoint is reached), and raisesROSRskillGoalSatisfiedonly once the measured joints reach the last waypoint (ROSDeadlineMissedif they do not settle in time); result-only mode awaits the wrapped result and raisesROSRskillGoalSatisfiedcarrying_summarize_wrapped_outcome(status, result, goal)— one line (≤400 chars) of the terminal status, the result's scalar fields (error_code,error_msg, a.valwrapper unwrapped) and the goal sent (dotted leaves, e.g.pose.header.frame_id=map pose.pose.position.x=4); a non-SUCCEEDED status raisesROSRuntimeErrorwith the same line. The runner forwards the success text asExecuteRskill.Result.outcome_summary, which the reasoner renders on its## EXECUTION[ok]line. ROS imports are deferred to_configure_implso the module imports cleanly without ROS sourced._configure_implrefuses a MoveGroup replay goal whose merged goal (incl.goal_params_json) does not keepplanning_options.plan_only: true. (L439)- attr
stop_check: Callable[[], str | None] | None— set byrskill_runner_nodeper goal; returns why the enclosingExecuteRskillgoal ended (cancel, execution budget) orNone, and raisesROSEStopRequestedfor a latched safety stop._poll_futurepolls it on the result wait and raises (ROSDeadlineMissed, or the stop itself) after cancelling the wrapped goal and confirming it ended; a stop whose cancel fails staysROSEStopRequested. The runner ends a stopped goal asFAILURE_SAFETY_ESTOP, a cancelled one as cancelled, not aborted. result_only -> bool[@property] (L1174) —Truewhen there is noresult_trajectory_field(Nav2): the wrapped server moves the robot and no chunks are published, so the runner announces the goal to the deadman watchdog (ResultOnlyGoal).- attr
unterminated_result_future: Any— the result future of a wrapped goal whose cancel the server rejected or never confirmed (it may still be running);rskill_runner_noderejects new goals until it completes. __init__(*, manifest, ros_node, robot_description, prompt, prompt_metadata_json)(L472)_configure_impl()— Lazy-import IDL, build ActionClient/service client, parsedefault_goal_json. (L571)_activate_impl()— no-op; the wrapped action dispatches on firststep(). (L686)_deactivate_impl()/_shutdown_impl()— Release the wrapped client. (L689)_step_impl(world_state) -> Action— First call sends goal and caches result; subsequent calls emit the waypoint due bytime_from_start(timed onnode_execution_budget(self._node, planned + _REPLAY_SETTLE_TIMEOUT_S)), holding the last untilworld_state.joint_stateis within_FINAL_WAYPOINT_TOL_RAD. Unmoved-joint padding is read fromjoint_stateby name into robot order; a malformed snapshot (name/position length mismatch, repeated name) or a plan that holds a joint the snapshot does not measure raisesROSPerceptionStale. (L706)_final_waypoint_error(world_state) -> float | None— worst|measured - final|over the planned joints, by name;None(never "reached") when unmeasurable. (L823)_poll_future(future, *, deadline_s, what, graph_clock=True, stoppable=True)— Polls a wrapped future undernode_execution_budget(self._node, …): on the graph clock whengraph_clockand the host node runs on sim time, else ontime.monotonic(). Raises the typedROSDeadlineMissed(FAILURE_DEADLINE_MISSED) namingdeadline_exceeded/clock_stalled; a non-positivedeadline_slapses at once (fail closed). Only the result-only result wait (Nav2: the server moves the robot) uses the graph clock — goal acceptance, service responses and a MoveIt plan result are compute/IPC and passgraph_clock=False; a lapsed result wait cancels the wrapped goal before re-raising. Withstoppable(all but goal acceptance) a non-Nonestop_check()also raisesROSDeadlineMissed. (L1296)_rejection_reason() -> str(L1213) — Appended to theROSRuntimeErrorof a rejected goal: finds the node serving the action (the name resolved like theActionClient's,Node.resolve_topic_name: namespace and remaps) and reads its lifecycle state viaget_state(_poll_future,_REJECTION_PROBE_TIMEOUT_S= 1 s per wait). Reports a state other thanactive(retrying can succeed if the stack comes up; changing the goal will not), an active server (check the goal), a node the graph lists noget_statefor (not a lifecycle node), or aget_statethat did not answer in time (state unknown);""when no node serves the action.
python/rskill/src/openral_rskill/moveit_goal.py
The one MoveIt rSkill's goal (rskills/rskill-moveit, goal_builder: "moveit"), lowered per robot: target named_pose / joints / pose / look_at in the robot's own names, onto the joint / pose / look-at adapters in a group of its generated MoveIt model.
lower_moveit_goal(goal, desc) -> tuple[Builder, dict](L175) — The adapter and its goal block +request.group_name(openral_home,openral_all, the end effector's or camera's name);ROSConfigErrorfor a goal the robot cannot mean.
python/rskill/src/openral_rskill/look_at_rskill.py
Camera-aiming MoveGroup skill. Selected by make_default_skill_resolver when manifest.ros_integration.goal_builder == "look_at" (new RosIntegration.goal_builder field; RSkillAction gains LOOK = "look").
- const
_DEFAULT_CAMERA = "wrist"(L46) - const
_DEFAULT_POSITION_TOLERANCE_M = 0.02(L50) - const
_DEFAULT_ORIENTATION_TOLERANCE_RAD = 0.15(L51) - const
_TF_LOOKUP_TIMEOUT_S = 5.0(L52) - const
_XYZ_LEN = 3(L53) - const
_MIN_DIRECTION_NORM = 1e-9(L54) resolve_camera_sensor(description, camera) -> SensorSpec— Find the named camera inRobotDescription.sensors;ROSConfigErrorlisting the available sensor names on a miss (explicit beats implicit — default camera is"wrist"). (L57)build_look_at_constraints(*, camera_goal: Pose6D, link_name, link_t_cam=None, position_tolerance_m=0.02, orientation_tolerance_rad=0.15) -> dict— Lower a camera gaze pose into one MoveGroupgoal_constraintsentry by delegating topose_goal_rskill.build_pose_constraintswith the optical (z) axis tolerance set to π (roll free). Withlink_t_camthe goal is re-expressed for the mount link; without it the camera frame is the constrained link. (L103)class LookAtRskill(ROSActionRskill)— Consumes the merged goal'slook_atblock (target_xyzrequired, plusframe_id/camera/standoff_m/tolerances) instead of raw constraints, lowering it lazily on the firststep()viacompute_gaze_pose→build_pose_constraints. The manifest shipsplan_only: trueso MoveIt-side execution never bypasses the safety kernel. (L135)
python/rskill/src/openral_rskill/pose_goal_rskill.py
Generic Cartesian end-effector pose MoveGroup skill. Selected by make_default_skill_resolver when ros_integration.goal_builder == "pose". Home of the shared pose→constraints lowering LookAtRskill reuses.
- const
_SOLID_PRIMITIVE_SPHERE = 2—shape_msgs/SolidPrimitive.SPHERE. (L40) - const
_DEFAULT_POSITION_TOLERANCE_M = 0.01(L41) - const
_DEFAULT_ORIENTATION_TOLERANCE_RAD = 0.05(L42) - const
_XYZ_LEN = 3(L43) - const
_QUAT_LEN = 4(L44) - const
_QUATERNION_ORDERS = ("xyzw", "wxyz")(L45) - const
_TF_LOOKUP_TIMEOUT_S = 5.0(L46) build_pose_constraints(*, pose: Pose6D, link_name, link_t_target=None, position_tolerance_m=0.01, orientation_axis_tolerances_rad=(0.05, 0.05, 0.05)) -> dict— Lower a target pose into one MoveGroupgoal_constraintsentry (sphere position region + per-axis orientation constraint);link_t_targetre-expresses the goal for the constrained link. The one place pose→MoveGroup-constraint math lives — do not re-implement. (L49)pose_from_block(block) -> tuple[Pose6D, str, float, float]— Parse aposegoal block →(pose, link_name, pos_tol, orient_tol). Orientation is a 4-float quaternion array; component order fromblock["quaternion_order"]("xyzw"default /"wxyz").ROSConfigErroron missing/ill-typed fields or an unknown order. (L141)class PoseGoalRskill(ROSActionRskill)— Consumes the merged goal'sposeblock; lowers it viabuild_pose_constraints(full orientation) on the firststep(), then dispatches/replays like the parent.link_t_targetis identity in v1 (the RobotDescription tool-frame offset is a later phase). (L198)
python/rskill/src/openral_rskill/joint_goal_rskill.py
Joint-space MoveGroup skill. Selected when ros_integration.goal_builder == "joint". The LLM-facing replacement for hand-written joint_constraints JSON.
- const
_DEFAULT_JOINT_TOLERANCE_RAD = 0.001(L23) - const
_JOINT_WEIGHT = 1.0(L24) joint_constraints_from_block(block) -> dict— Lower ajointblock (joint_names,positions, optionalposition_tolerance_rad) into onegoal_constraintsentry ({"joint_constraints": [{joint_name, position, tolerance_above, tolerance_below, weight}, …]}).ROSConfigErroron missing/ill-typed fields or a name/position length mismatch. (L27)class JointGoalRskill(ROSActionRskill)— Consumes the merged goal'sjointblock; lowers it into ajoint_constraintsgoal at_configure_impl, then dispatches/replays like the parent. (L69)_configure_impl() -> None(L77)
python/rskill/src/openral_rskill/_vla_core.py
Shared helpers for VLA adapters (Layer 3); internal — no public re-export.
InferenceKind— Re-export ofopenral_observability.InferenceKind(Literal["foreground", "prefetch", "single"]), the closed value set for theinference.kindlabel — a timing axis, deliberately without a"chunk"value since chunk shape ridesinference.chunk_size/chunk_indexinstead. (L47)resolve_device(spec: VLASpec) -> str—"auto"→"cuda:0"/"mps"/"cpu"against real torch. (L50)resolve_rskill_repo_id(weights_uri: str, *, adapter_name: str) -> str— Validate skill reference and resolve to bare HF repo id;adapter_nameis used in theROSConfigErrormessage. (L75)resolve_rskill_repo_revision(weights_uri: str, *, adapter_name: str) -> tuple[str, str | None]— Likeresolve_rskill_repo_idbut also returns the optional@<sha>revision pin, threaded intofrom_pretrained/snapshot_downloadby the sim adapters, and warnsrskill.unpinned_weightswhen anhf://skill is unpinned. (L106)resolve_image_preprocessing(manifest, spec_extra) -> ImagePreprocessing— Build theImagePreprocessingblock an adapter applies, by strict precedence:spec_extraYAML override →manifest.image_preprocessingper-checkpoint contract → schema defaults. No auto-derivation frompolicy.config.input_features— missing hints surface as the schema default rather than a guessed heuristic. RaisesROSConfigErrorwhen a manifest alias key is not a slot declared bysensors_required[].vla_feature_key. (L149)resolve_state_dim(manifest, spec_extra) -> int | None— Per-checkpoint proprio state dimension:spec_extra["state_dim"]override →manifest.state_contract.dim→None(adapter falls back to the policy's own preprocessor width). (L254)resolve_camera_keys(manifest, spec_extra, *, scene_cameras=None, default=("camera1", "camera2")) -> tuple[str, ...]— Resolve which scene camera keys an adapter pulls from the observation:spec_extra["camera_keys"]override →scene_cameras(the SimEnvironment YAML'sscene.cameras) →default. (L275)manifest_camera_slots(manifest) -> tuple[str, ...]— The RGB VLA slots an rSkill declares, insensors_requiredorder (vla_feature_keysuffix). Theresolve_camera_keysdefault for adapters whose cameras are the manifest's slots (openvla, rldx, lingbot, diffusion). (L307)checkpoint_image_keys(image_preprocessing, camera_keys) -> tuple[str, ...]— The one slot→checkpoint rename:input_template.format(cam=aliases.get(slot, slot))per slot. Used by the xvla / gr00t / diffusion / lingbot / molmoact2 adapters so manifestaliasesis the only rename mechanism. (L328)resolve_n_action_steps(manifest, extra, *, default, chunk_size=None) -> int— The one chunk-slicing rule every policy adapter calls (xr1, xvla, gr00t, lingbot_vla/vla2, rldx, molmoact2, openvla, and viaapply_chunk_replaysmolvla/pi05/act):extra["n_action_steps"](--n-action-steps) >manifest.n_action_steps> deprecatedextra["replan_steps"](warnsvla.deprecated_replan_steps) >default; bounded bychunk_size(elsemanifest.chunk_size, logsvla.n_action_steps_clamped);ValueErrorbelow 1. (L356)apply_chunk_replay(policy, spec_extra, *, manifest=None, default_n_action_steps=None) -> int— Setpolicy.config.n_action_stepsviaresolve_n_action_steps, defaulting to and bounded by the policy's ownconfig.chunk_size; used by the lerobot-style adapters (smolvla,act,pi05,xvla). (L407)_CUDAGRAPH_COMPILE_MODES—frozenset({"reduce-overhead", "max-autotune"}); thetorch.compilemodes that may capture CUDA graphs and therefore require output cloning (static replay buffers would otherwise be overwritten under lerobot's queued action views /ChunkedExecutorpre-fetch). (L462)_has_bnb_quantized_modules(policy) -> bool— True when any submodule's class comes frombitsandbytes(Linear4bit/Linear8bitLtrewrites fromopenral_sim._quantization). Class-module-path check; never imports bnb. (L474)_clone_chunk_output(out, torch) -> Any— Recursively.clone()every tensor in a chunk forward's output (tensor / tuple / list / dict; non-tensor leaves pass through) so downstream holders own their storage, detached from CUDA-graph static buffers. (L488)maybe_compile_chunk_forward(policy, spec_extra, device, torch, *, method_name="_get_action_chunk") -> bool— Best-efforttorch.compileof the chunk forward with a runtime fallback that latches into eager mode on backend errors; skipped on CPU or whenvla.extra.compileis false; a non-boolcompile(e.g. YAML string"false") raisesROSConfigError. Never compiles bitsandbytes-quantized policies (dtype-mismatch under mixed nf4/bf16), and routes cudagraph-mode output through_clone_chunk_outputon both branches. (L506)class CudaGraphChunkForward— Replays a chunk forward as one captured CUDA graph (policy_extras.cuda_graph; π0.5 today). The first plain call copies the batch into static inputs, warms up on a side stream and captures (capture_error_mode="thread_local",capture_ctxaround warm-up + capture only); later calls copy into the static inputs, replay and return_clone_chunk_outputof the static output, so held chunks are never overwritten. Default-generator noise is fresh per replay. Eager for a keyword call (RTC); a changed tensor layout latches eager and logsvla.cuda_graph_disabled; a failed capture raisesROSRuntimeErrorand latches it, so every later call (keyword calls too) re-raises instead of running eager (an aborted capture leaves the CUDA generator unusable for eager too; the runner's best-effort warm-up logs it and the first real chunk fails loudly). Optionaldevice(the adapter's): warm-up, capture and replay run undertorch.cuda.device(device). Propertiescaptured,disabled_reason. Logsvla.cuda_graph_capturedwith the capture time. (L616)__init__(forward, *, torch, name, capture_ctx=None, warmup_runs=2) -> None— No capture yet;forwardmust run its ownno_grad/ autocast withcache_enabled=False. (L674)captured -> bool[property] — A graph is captured and replay is live. (L700)disabled_reason -> str | None[property] — Why replay latched off (input_layout_changed,capture_failed), elseNone. (L705)run_inference(policy, batch, *, chunk_index=None, kind="single", chunk_size=None, engine=None, call=None, call_kwargs=None, synchronize=False) -> Tensor— Single seam wrapping a policy inference call ininference_span+torch.no_grad()— the only placeinference.kind/chunk_index/chunk_size/inference.engineattributes are emitted.callreplaces the defaultpolicy.select_action(batch)for custom chunk producers;ChunkedExecutorpassessynchronize=Trueon its prefetch so the span times compute, not just kernel launch. Must staytorch.no_grad(), nevertorch.inference_mode()— RTC's guidance callsautograd.grad, which raises under inference mode. (L800)resolve_inference_engine(owner, declared=None) -> str— Resolve the backend actually executing after optional runtime attachment: explicit_openral_inference_enginemarker wins, then theopenral-pro-trtmodule, then the manifest name (normalizedpytorch→torch/tensorrt→trt). Keeps the dashboard from reporting a stale pre-attachment runtime. (L889)_RTC_ADAPTERS—frozenset({"smolvla", "pi05"}); the flow-matching adapters whose lerobot policies carry anrtc_config. molmoact2 / pi0_fast support RTC upstream but are out of scope — extend this set and the adapter's chunk_fn kwargs pass-through together. (L929)- const
_RTC_KEYS—frozenset({"enabled", "execution_horizon", "max_guidance_weight", "prefix_attention_schedule", "debug"}); the closed key set_parse_rtc_configaccepts in apolicy_extras.rtcblock. (L936) _parse_rtc_config(spec_extra, *, adapter_name, default_horizon=10) -> RTCConfig | None— Parse the manifest'spolicy_extras.rtcblock into a lerobotRTCConfig, orNoneif absent.ROSConfigErroron a non-mapping block, an unknown key or schedule, a non-positive horizon,RTCConfigrejection, or an adapter outside_RTC_ADAPTERS; lerobot imports are deferred. (L941)rtc_enabled_in_extra(spec_extra, *, adapter_name) -> bool— True only for a present, well-formed, enabledrtcblock — keyed on the parsedenabledflag, not just presence, sortc: {enabled: false}still compiles. Lets a factory (e.g. smolvla skippingmaybe_compile_chunk_forward) decide before the executor exists. (L1011)- const
_CHUNK_BOUNDARY_BLEND_KEYS—frozenset({"steps", "dims"}); the closed key set of apolicy_extras.chunk_boundary_blendblock. _parse_chunk_boundary_blend(spec_extra, *, adapter_name) -> tuple[int, tuple[int, ...] | None]— Parse the YAML shape ofpolicy_extras.chunk_boundary_blend: {steps: K, dims: [...]}into(steps, dims);(0, None)without a block.ROSConfigErroron a non-mapping block, unknown keys,stepsnot an int>= 1, ordimsmissing or not a list (no all-dims default in a manifest: a binarized gripper or delta-action dim must not be faded). The rules themselves areexecutor._check_boundary_blend's, applied bybuild_chunk_executorunder this block's key.build_chunk_executor(spec_extra, *, policy=None, chunk_fn=None, chunk_size=None, adapter_name="policy", postprocess_action=None, rtc_prefix_fn=None) -> ChunkedExecutor | None— Shared executor construction:chunk_prefetchenables overlap,chunk_prefetch_atcalibrates the lead (default 20, clamped to the chunk). An enabledpolicy_extras.rtcblock setspolicy.config.rtc_configand callsinit_rtc_processor()before building the executor; a block withoutexecution_horizongets the clampedchunk_prefetch_at(guidance over the whole overlap); RTC is refused withROSConfigError(never a silent downgrade) on chunk size 1,chunk_prefetch: false, a policy withoutinit_rtc_processor, bitsandbytes-quantized weights, or ause_relative_actionspolicy withoutrtc_prefix_fn(checked before the policy is mutated). With nortcblock, construction and served actions are byte-identical to before. Apolicy_extras.chunk_boundary_blendblock is checked withexecutor._check_boundary_blend(before any RTC policy mutation) and handed to the executor asboundary_blend_steps/blend_dims; it is refused withROSConfigErroron chunk size 1, astepsnot below the chunk size (or, withchunk_prefetch, belown - chunk_prefetch_at - 1), or alongside an enabledrtcblock. (L1090)relative_rtc_prefix_fn(preprocessor, *, device) -> Callable[[Tensor], Tensor] | None— Thertc_prefix_fnfor a relative-action checkpoint (an enabledRelativeActionsProcessorStepin its preprocessor), elseNone. Mirrors lerobot 0.6.0's RTC rollout: absolute leftover rows →lerobot.policies.rtc.reanchor_relative_rtc_prefixagainst the relative step's cached state (the latest preprocessor call) → the preprocessor's normalizer, ondevice. The hook raisesROSRuntimeErrorwhen no state is cached, where lerobot would silently keep the stale rows; building it raisesROSConfigErrorwhen no normalizer carries action stats (the prefix would reach the model in raw units). pi05 and SmolVLA pass it tobuild_chunk_executor. (L1273)image_to_chw_tensor(img, *, torch, device) -> Tensor— HWC uint8 frame →(3, H, W)float32 in[0, 1], uploaded as uint8 and converted on the device; the one per-tick image conversion every VLA adapter (ACT, Diffusion, π0.5, SmolVLA, GR00T, X-VLA) uses — a host-side float32 build cost ~10 ms/frame/tick. (L1344)to_numpy_action(action_tensor) -> NDArray[np.float32]—(1, A)torch tensor → 1-D float32 NumPy. (L1363)release_torch_modules(owner, *attrs, device="", torch=None) -> None— Drop an adapter's references to its loaded torch modules, thengc.collect()and (on CUDA)torch.cuda.empty_cache()— order matters:empty_cache()only returns already-free blocks, so it must run after the reference is dropped, andgc.collect()is needed since a policy is typically part of a reference cycle. Best-effort; called fromclose()in every sim VLA adapter. (L1925)split_repo_revision(ref: str) -> tuple[str, str | None]—owner/repo@<rev>→(repo_id, revision)forrevision=kwargs (HF rejects@in a repo id); an existing local path is returned whole; re-exported fromopenral_rskill. Used by the OmDet / SAM 2.1 / TOPReward / 3DDA / MolmoAct2 loaders. (L1496)parse_hf_file_uri(uri: str) -> tuple[str, str | None, str]— Splitshf://owner/repo[@rev]/path/to/file.extinto(repo_id, revision, filename)for per-filehf_hub_downloadcalls. Rejects bare-repo URIs with a typedROSConfigError. (L1516)materialize_processor_dir(manifest: RSkillManifest) -> str— Downloads the manifest's per-fileprocessorsartefacts viahf_hub_downloadand symlinks them under lerobot-canonical filenames in a fresh temp directory, also fetching each processor JSON's siblingstate_filesoPolicyProcessorPipeline.from_pretrainedresolves every step locally. Used by the SmolVLA and modern-ACT adapters; raisesROSConfigErrorifmanifest.processors is Noneor a processor JSON failsvalidate_processor_steps. (L1624)validate_processor_steps(json_path: str) -> list[str]— Vets a lerobotpolicy_{pre,post}processor.jsonbefore lerobot instantiates it: every step must name aregistry_name(a bareclasspath would make lerobot import and call an arbitrary symbol) and everystate_filemust be a plain file name (no path traversal). Returns thestate_filenames in order; raisesROSConfigError. Called bymaterialize_processor_dirand, on a localpretrained_path, bycall_make_processors_cached_first. (L1566)hf_download_cached_first(hf_hub_download, local_not_found_exc, *, repo_id, filename, revision=None, **extra) -> str— Cache-first wrapper aroundhuggingface_hub.hf_hub_download: trieslocal_files_only=Truefirst, falling back to a normal call onLocalEntryNotFoundError. Avoids the per-file HEAD validation that turns a cached load into seconds of latency on a cold connection;HF_HUB_OFFLINE=1extends the skip to inner lerobot/transformers calls this helper doesn't wrap. Public, re-exported fromopenral_rskill.__init__. (L1379)local_snapshot_dir(repo_id, *, revision=None, ignore_patterns=("*.md",), **extra) -> str(L1442) — The resolved checkpoint as a local directory: a directory (an installed rSkill snapshot, whichresolve_rskill_to_hf_with_revisionreturns for a snapshot holdingmodel.safetensorsor a sharded index) is returned as is, a Hub repo id issnapshot_downloaded withignore_patterns/extraforwarded.snapshot_downloadrejects a filesystem path as a repo id, so ACT, Diffusion, GR00T and the processor-sidecar fallback all broke on an installed skill until they routed through this (2026-09-23). Public, re-exported fromopenral_rskill.__init__.stage_safetensors_on_host() -> Iterator[None](L2103) [@contextmanager] — lerobot'sPreTrainedPolicy.from_pretrainedreadsmodel.safetensorsthrough host memory (load_model(..., device="cpu"), thenpolicy.to(device)as before) instead of per-tensor mmap-to-GPU copies, which run at ~190 MB/s on the GB10: SmolVLA load 8.5 s -> 2.0 s, identical weights. Process-global patch oflerobot.policies.pretrained, restored on exit; a no-op without lerobot.suppress_hf_weight_init() -> Iterator[None][@contextmanager] — Context manager that patchestransformers.PreTrainedModel._init_weightsto a no-op and enterstransformers.initialization.no_init_weights(no-ops thetorch.nn.initfunctionsnn.Linear/nn.Embeddingconstructors call), skipping SmolVLA's full random backbone init when the checkpoint setsload_vlm_weights=False(SO-101 eraser-placefrom_pretrained6.7 s → 4.3 s, bit-identical weights). Only sound when the checkpoint covers every parameter: while active, a lerobotload_model_as_safetensorcall reporting a missing key raisesROSConfigError(private_refuse_missing_checkpoint_keys); pair withassert_all_parameters_finite. Process-global while active; the skill runner serialises loads behind its resident-skill lock. (L1980)assert_all_parameters_finite(policy, *, repo_id) -> None— RaisesROSConfigErrorif any floating-point parameter is NaN/Inf — the guard that makessuppress_hf_weight_initsafe, since uninitialised memory read as float is overwhelmingly non-finite. (L2147)call_make_processors_cached_first(make_pre_post_processors, policy_config, *, pretrained_path, **kwargs) -> tuple[Any, Any]— Wraps lerobot'smake_pre_post_processorsso the tokenizer'sAutoTokenizer.from_pretrainedcall skips its HF HEAD revalidation when that tokenizer is already cached, by flippingHF_HUB_OFFLINEfor the inner call. Passthrough on a cold cache (the vocabulary file, not onlytokenizer_config.json, must be cached) or for adapters with no tokenizer step (ACT, Diffusion Policy). Every result goes throughcheck_preprocessor_tokenizer; processor JSONs underpretrained_pathgo throughvalidate_processor_stepsfirst. (L1777)check_preprocessor_tokenizer(preprocessor) -> None— RaisesROSConfigErrorwhen a preprocessor's tokenizer step encodes a fixed English instruction to no word tokens or half or more<unk>(a cache with configs but no vocabulary, loaded offline). Steps withoutinput_tokenizerpass. (L1864)- private:
_read_tokenizer_repo_from_preprocessor(pretrained_path) -> str | None— Parses<pretrained_path>/policy_preprocessor.jsonfor thetokenizer_processorstep'sconfig.tokenizer_name. ReturnsNoneon missing/malformed JSON or absent step (ACT / Diffusion Policy). Used bycall_make_processors_cached_first. - private:
_hf_tokenizer_is_cached(repo_id) -> bool— Probeshuggingface_hub.try_to_load_from_cache(repo_id, "tokenizer_config.json")and returnsTrueonly when the result is a real cached path (str), notNoneor the_CACHED_NO_EXISTsentinel. ReturnsFalseon any import error so callers fall back to a normal online load.
python/rskill/src/openral_rskill/_policy_io.py
The one policy <-> robot I/O codec (joint order, deg<->rad, gripper scale, clamp), applied on every deploy dispatch path; internal — no public re-export.
class PolicyIOCodec(BaseModel)— Frozen codec built once per skill from the manifest'saction_contract(joint_units,joint_names,gripper_scale,joint_calibration, legacypolicy_extras.gripper_scalewith a deprecation warning) + theRobotDescription. State: permute robot→policy order, thenscale * value + offsetfor a calibrated channel (calibration, per policy channel), elsegripper * gripper_scale/degrees(joint). Action:(value - offset) / scale, elsegripper / gripper_scale/radians(joint)back in robot order; on the slot path the same per-channel conversion in policy order per slot (JOINT_POSITION/JOINT_VELOCITY + GRIPPER_POSITION), no permutation, and JOINT_POSITION slot channels clamped by the same_CLAMP_EPSasclamp— keyed by the slot'sjoint_names, orRobotDescription.jointsorder when it declares none (this replaced the runner's own_clamp_joint_position_slice, which skipped unnamed slots); a GRIPPER_POSITION slot's channel clamped strictly inside itsee's kernel bound (gripper_ranges, fromEndEffectorSpec.resolved_command_range), a move wider than the epsilon logged once per end effector (policy_io.gripper_command_clamped). (L199)from_manifest(manifest, description, *, adapter=None) -> PolicyIOCodec— Whenslot_state_joint_namesyields a strict subset of the robot's joints (an OpenArm skill on the OpenAMRobot v2), the codec gathers them:state_indexset,policy_is_gripper/policy_joint_namesper gathered channel, loggedpolicy_io.slot_state_subset; otherwise joint order:action_contract.joint_names(robot names in policy order; unknown name →ROSConfigError) > the adapter'spolicy.config.action_feature_names(.pos/_joint_normalised; mismatch → identity +policy_io.feature_names_unmatched) > identity.ROSConfigErrorfor a joint-position contract withoutjoint_units, a legacy extras scale contradicting the contract, or ajoint_calibrationnaming a joint the robot lacks / declared without a description to resolve it; a declared calibration is logged once (policy_io.joint_calibration). (L254)is_identity -> bool[@property] — True when the codec changes nothing (radians,gripper_scale == 1, robot joint order, nostate_indexgather);openral_sim.sim_runnerrefuses a non-identity codec on a scene withoutconverts_policy_units. (L448)to_policy_state(robot_state) -> NDArray— Robot-order radians → policy order + units; withstate_indexthe slot-named joints are gathered first (ROSConfigErroron a state too short for them). (L472)to_robot_action(policy_action, *, slots=None) -> NDArray— Policy action → robot units (+ robot order without slots; + JOINT_POSITION limit clamp with slots). (L501)clamp(robot_action) -> NDArray— Pull each joint strictly (1e-3) insideRobotDescriptionposition limits; no-op on a width mismatch. (L591)slot_state_joint_names(manifest, description) -> list[str] | None— The robot joints a slot contract's policy state reads, in slot range order: eachJOINT_*slot'sjoint_names, each one-channelGRIPPER_*slot the joint itseedrives (the joint of that name, else an end effector's name resolves to the robot's single gripper joint; private_ee_joint).Nonewhen the contract does not determine the state (no slots / description, a jointless / discard / unnamed slot, aneethat is no joint, astate_contract.dimthat is unset or other than the count).ROSConfigErrorfor aJOINT_*slot joint the robot lacks. Shared byPolicyIOCodec.from_manifest, the reasoner's state-contract palette filter andrskill_runner_node.expand_starting_pose. (L126)- private:
_effective_perm(robot_to_policy, n) -> list[int]— Identity unless a valid length-npermutation, so unit conversion runs on the no-reorder path too. (L68)
python/rskill/src/openral_rskill/testing.py
Test helpers for skill latency-budget enforcement (CLAUDE.md §2).
class LatencyBudgetExceededError(AssertionError)— Raised byassert_within_budgeton overrun; a plainAssertionErrorsubclass (notROSRuntimeError) so pytest reports a crisp failure with the budget delta rather than the operational exception the safety supervisor would catch. (L42)__init__(*, stage, measured_ms, budget_ms, rskill_id=None)— Builds the failure message and storesstage/measured_ms/budget_ms/rskill_idon the instance. (L56)assert_within_budget(*, measured_ms, budget: RSkillLatencyBudget, stage="per_chunk", rskill_id=None, tolerance_pct=0.0) -> None— Assertmeasured_msdoes not exceedbudget's field forstage(per_chunk_ms/warmup_ms/load_ms), with an optional percent tolerance. Unset optional budget stages (warmup_ms/load_msareNone) pass silently — enforcement is opt-in per manifest. RaisesLatencyBudgetExceededErroron overrun,ValueErroron a negative input. (L78)
python/rskill/src/openral_rskill/_lerobot_compat.py
Compatibility helpers for checkpoints saved by a different lerobot version.
strip_unknown_config_keys(config_cls, cfg_path) -> list[str]— Rewrites a checkpointconfig.jsonwithout the keys the installed lerobot config dataclass does not declare (keepstype); draccus rejects unknown keys beforefrom_pretrainedbuilds the policy. Returns the dropped keys; idempotent. Shared bysanitize_smolvla_configand ACT's_sanitize_act_config_json. (L22)sanitize_smolvla_config(repo_id, *, revision=None) -> None— Strip config keys lerobot'sSmolVLAConfigrejects (viastrip_unknown_config_keys) from a checkpoint'sconfig.json, in place, beforeSmolVLAPolicy.from_pretrained. Idempotent; no-op when the config is already clean or lerobot/the config are unavailable. (L65)