Scene and robot installation feasibility

Contents

Scene and robot installation feasibility#

The joint search keeps task semantics, robot model/tool, joint limits and physics fixed while varying declared scene groups and installation XY/yaw. It returns conditional proposal regions and exact execution evidence. A workspace point, an IK solution and a complete physically successful task are different results.

Install EmbodiChain and run the authored UR5 example from the repository root. The collision query reuses the Newton/Warp packages provided by DexSim:

pip install -e .
embodichain search-scene-feasibility \
  --config examples/expansion/scene_robot_feasibility/search.ur5.yaml \
  --output outputs/scene_feasibility

The example uses the existing UR5 Task Program integration and an explicitly versioned one-cycle program. Its declared mounting/structural contact exemptions must be reviewed when adapting it to another robot. Generated files include atlas.json, session.json, report.html and accepted episodes/*.npz. The NPZ sink confirms atomic writes through the existing ExpansionSession; its causal records contain measured joint/object states and submitted qpos controller targets. It does not implicitly write a LeRobot dataset.

Input and evidence contracts#

PoseSearchVariable expresses one permitted group displacement. All members share that transform: composed dual arms keep their relative mounting, and support groups retain their internal geometry. Coordinates are arena-local Z-up metres and yaw radians. Bounds parameterize XY/yaw offsets about the reference group origin, not independent member poses.

TaskFeasibilityRequest fixes semantic, robot, policy, validator and parent scene identities, authored poses, variables and explicit operation modes. TaskPhase targets are simultaneous TCP requirements; dependencies must be in topological order. Incoming held-object transforms and phase-local contact permissions are explicit. Post-phase object poses are planning projections, never measured evidence. Multiple legal modes require a Python adapter that binds the selected mode to the canonical runtime. The closed YAML adapter supports one configured runtime-policy mode.

RobotFeasibilityBackend keeps complete joint states, projects mimic joints, uses hypothetical full-chain roots, retains bounded IK branches and checks full-joint connections. A bounded RRT fallback can explore detours. A failure means no solution found in that declared budget, not mathematical infeasibility. Unknown geometry, coupled solvers outside the supported contract, or missing adaptation are reported explicitly.

The default physical adapter reads materialized native robot-link and rigid-body collision descriptors, including the engine’s cooked convex geometry, rather than render meshes or uncooked URDF surfaces. It requires unit robot asset scale; other scales use a trusted explicit geometry adapter. Native CONVEX shapes remain explicitly convex; they are not inferred from render surfaces or triangle winding. The global ground is a halfspace checked with analytic physical-shape support. Triangle mesh and SDF inputs return unsupported rather than being silently convexified.

NewtonCollisionChecker owns an independent query model and scratch state. It does not step physics or mutate the host’s positions, filters or clock. Robot/environment, self, inter-arm and held-object queries use stage-local permissions. Shape/pair/contact budgets are bounded, and overflow or nonfinite results cannot accept a candidate. Query arrays and graphs are released by the host after each attempt.

CPU is the default query device. collision_device selects CPU/CUDA, independently of the environment-owned physical backend and proposal device; collision_use_cuda_graph controls CUDA replay. Reported clearance is a nonnegative estimate capped by the declared contact detection band, never an infinite or exact global minimum distance when no contact is generated. Backend version, device, tolerances, detection band, budgets and verification identity are retained in execution evidence. Path checks are discrete and runtime checks occur at observed control boundaries; they do not certify continuous collision freedom.

Transforms are translated to a query-local origin before applying shape-local offsets. Native queries additionally use an owned scale-aware tolerance value, updated before CUDA graph replay. Unrepresentable geometry, nonfinite composed poses/distances, or precision uncertainty beyond the contact-band budget return unsupported. The largest applied tolerance and coordinate policy are recorded in metadata; one checker instance expects serialized calls.

Search, sampling and independent validation#

Search preserves global exploration for every operation mode and locally refines promising joint cells. The archive retains quality tradeoffs and region selection keeps separated modes/layouts. Regions are unions of conditional joint cells; their coordinate projections must not be independently recombined.

After search the region distribution is frozen. Held-out trials use independent IID streams, with fixed planned counts. Reported Clopper-Pearson intervals are marginal 95% intervals for the raw joint-region proposal distribution, including semantic/geometric rejections. Search samples do not enter those counts. Incomplete validation has no confidence interval. A region is not a guarantee that every point succeeds, and no simultaneous or global optimality claim is made.

sample_feasibility draws complete correlated candidates, then requires fresh semantic and geometric prechecks. A generated candidate must still pass full physical task acceptance before becoming successful data. Filtering changes the sampling distribution; raw-region statistics should not be presented as a new filtered-distribution confidence statement.

The default budget is 600 seconds with 60% reserved for search and 40% for validation. Nested runtime IK/planning and Atomic recovery calls share the host’s context-local quota and deadline. Native calls are checked before/after return; cooperative cancellation cannot preempt an uninterruptible native call. Numerical CPU/CUDA batches do not change the B=1 physical execution boundary.

Host integration#

TaskProgramFeasibilityHost rebuilds a copied robot deployment, prepares the scene through SimulationSceneExpansionHost, screens the phase graph, restores the actual initial state, and invokes execute_scene_variants. The canonical Task Program remains the action producer and Gym owns every physics step. Initial validation requires both semantics and geometry. Actual controller provenance selects runtime contact permissions. Missing mappings fail explicitly.

MeasuredTaskMonitor supports explicit pose, lift, joint-range, velocity, arena-axis relation and physical-support-bounds predicates. Ordered events retain actual step receipts and consecutive-sample requirements. A final goal that is already satisfied at initialization is rejected by the configured adapter. TaskSpec/GenSim adapters can supply the same fixed request and trusted host ports without importing their model clients into the scene core.

Public interface#

Task-conditioned joint scene and robot installation feasibility search.

Geometry/kinematics/planning evidence remains distinct from measured task success. Importing this package never imports Newton or creates a simulator.

Classes:

CandidateEvaluation

Independent preparation, planning and actual task execution evidence.

CollisionBody

One physical shape in an explicitly named link/entity frame.

FeasibilityAtlas

Frozen request, regions, observations and accounting suitable for replay.

FeasibilityBudget

One monotonic budget shared by preparation, planning and execution.

FeasibilityCheck

One stage outcome with explicit unsupported and budget-limited evidence.

FeasibilityEvaluator

Trusted host port: checks retain their stage and actual evidence scope.

FeasibilityObservation

One search or held-out evaluation and its exact proposal.

FeasibleRegion

A conditional joint box; unsampled points are proposals, not certificates.

HeldObject

Rigid attachment during travel; never a physical-success assertion.

JointSceneCandidate

Owned joint scene/deployment proposal, not a success certificate.

NewtonCollisionChecker

Check an isolated B=1 convex collision state without advancing physics.

PhaseTarget

One simultaneous TCP target in an explicit arena or entity frame.

PoseSearchVariable

One XY/yaw displacement applied to a scene group or robot installation.

PreparedFeasibilitySearch

Owned fixed request/configuration and typed joint-domain materialization.

RobotDeploymentCandidate

Explicit physical robot root poses, retaining group mounting relations.

RobotFeasibilityBackend

Selected-row Robot adapter with multi-seed IK and full-joint RRT fallback.

RobotWorkspaceProposalSource

Copy current-model FK samples into an independent numerical proposal prior.

SceneRobotFeasibilityCfg

Search, branch, region and independent validation budgets.

TaskFeasibilityRequest

Versioned fixed semantics, robot, scene, and allowed joint search domain.

TaskOperationMode

One permitted grasp/assignment/handover branch of the original task.

TaskPhase

A synchronized stage and its explicit planning-state transition.

TaskPlan

One complete branch with stage-indexed paths; no physical-success claim.

TaskPlanningBackend

Full-state solver port; each target set represents simultaneous resources.

Exceptions:

FeasibilityBudgetExhausted

The shared deadline, cancellation or one call quota has been reached.

UnsupportedFeasibilityError

Required geometry, task adaptation or runtime capability is unavailable.

Functions:

binomial_interval(successes, trials, *[, ...])

Compute a two-sided Clopper-Pearson interval for fixed-count iid trials.

load_feasibility_atlas(path)

Validate source identity, every candidate, region and statistical receipt.

plan_task_mode(mode, backend, entity_poses, ...)

Connect compatible IK branches across an explicitly ordered task graph.

prepare_feasibility(request[, cfg])

Snapshot declared permissions and search settings without mutating a scene.

request_from_mapping(value)

Decode a provider-independent request through closed production contracts.

sample_feasibility(atlas, *, count, seed, ...)

Sample correlated region proposals and recheck geometry/semantics.

save_feasibility_atlas(atlas, path)

Atomically publish a frozen, content-addressed evidence snapshot.

search_feasibility(prepared, evaluator, *[, ...])

Explore globally and refine promising cells, then validate frozen regions.

validate_feasibility(atlas, evaluator, *[, ...])

Validate previously frozen regions with independent fixed-count trials.

class embodichain.lab.sim.scene.feasibility.CandidateEvaluation[source]#

Independent preparation, planning and actual task execution evidence.

Passing check names alone cannot replace normal program completion and measured task success. committed is set only by a confirmed host receipt.

Methods:

__init__(candidate_id, checks[, ...])

Attributes:

accepted

Return exact-scene measured success with every mandatory stage passed.

__init__(candidate_id, checks, program_completed=False, measured_success=False, initial_state_id=None, clearance_m=0.0, execution_cost_s=0.0, committed=False, evidence=<factory>)#
property accepted: bool#

Return exact-scene measured success with every mandatory stage passed.

class embodichain.lab.sim.scene.feasibility.CollisionBody[source]#

One physical shape in an explicitly named link/entity frame.

Parameters:
  • collision_id (str) – Stable physical ID for phase-specific contact permissions.

  • frame_uid (str) – Pose-provider frame identity; several shapes can share it.

  • kind (str) – box, sphere, capsule, cylinder, halfspace, convex, or mesh. Convex means the physical collider is the convex hull of its vertices. A generic triangle mesh is retained as mesh and cannot be implicitly converted into a convex collider.

  • dimensions (tuple[float, ...]) – Full box extents, radius, or radius/full cylinder height.

  • local_pose (tuple) – Shape-to-frame transform.

  • vertices (tuple[tuple[float, float, float], ...]) – Mesh-local positions; scale must already be applied.

  • triangles (tuple[tuple[int, int, int], ...]) – Mesh triangle indices.

  • robot (bool) – Whether this shape belongs to a robot.

  • source_collision_id (str | None) – Physical collider shared by its convex parts.

Methods:

__init__(collision_id, frame_uid, kind[, ...])

__init__(collision_id, frame_uid, kind, dimensions=(), local_pose=((1.0, 0.0, 0.0, 0.0), (0.0, 1.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0), (0.0, 0.0, 0.0, 1.0)), vertices=(), triangles=(), robot=False, source_collision_id=None)#
class embodichain.lab.sim.scene.feasibility.FeasibilityAtlas[source]#

Frozen request, regions, observations and accounting suitable for replay.

Incomplete validation is descriptive only: its interval is deliberately omitted because interruption may depend on outcomes or execution time.

Methods:

__init__(request, cfg, regions, ...[, metrics])

Attributes:

atlas_id

Return a content identity for this exact evidence snapshot.

__init__(request, cfg, regions, observations, stop_reason, metrics=<factory>)#
property atlas_id: str#

Return a content identity for this exact evidence snapshot.

class embodichain.lab.sim.scene.feasibility.FeasibilityBudget[source]#

One monotonic budget shared by preparation, planning and execution.

Parameters:
  • cfg (SceneRobotFeasibilityCfg) – Validated search limits.

  • clock (Callable[[], float]) – Monotonic clock; injectable for deterministic tests.

  • cancelled (Event | None) – Optional caller-owned cancellation event.

Methods:

__init__(cfg, *[, clock, cancelled])

charge(kind[, amount])

Reserve call quota before invoking work; failures still consume it.

check()

Raise at cooperative boundaries when time or cancellation is exhausted.

Attributes:

remaining_s

Return remaining time in the current search/validation allocation.

__init__(cfg, *, clock=<built-in function monotonic>, cancelled=None)[source]#
charge(kind, amount=1)[source]#

Reserve call quota before invoking work; failures still consume it.

Parameters:
  • kind (str) – candidates, ik, planning or rollouts.

  • amount (int) – Number of actual requests, including internal retries.

Return type:

None

check()[source]#

Raise at cooperative boundaries when time or cancellation is exhausted.

Return type:

None

property remaining_s: float#

Return remaining time in the current search/validation allocation.

exception embodichain.lab.sim.scene.feasibility.FeasibilityBudgetExhausted[source]#

The shared deadline, cancellation or one call quota has been reached.

class embodichain.lab.sim.scene.feasibility.FeasibilityCheck[source]#

One stage outcome with explicit unsupported and budget-limited evidence.

Methods:

__init__(stage, status[, reason, phase_id, ...])

__init__(stage, status, reason='', phase_id=None, affected_variables=())#
class embodichain.lab.sim.scene.feasibility.FeasibilityEvaluator[source]#

Trusted host port: checks retain their stage and actual evidence scope.

Methods:

__init__(*args, **kwargs)

evaluate(candidate, budget)

Evaluate one exact scene; charge nested IK/planning/rollout calls.

prepare(request, budget)

Prepare immutable geometry/policy inputs inside the shared deadline.

__init__(*args, **kwargs)#
evaluate(candidate, budget)[source]#

Evaluate one exact scene; charge nested IK/planning/rollout calls.

Return type:

CandidateEvaluation

prepare(request, budget)[source]#

Prepare immutable geometry/policy inputs inside the shared deadline.

Return type:

None

class embodichain.lab.sim.scene.feasibility.FeasibilityObservation[source]#

One search or held-out evaluation and its exact proposal.

Methods:

__init__(candidate, evaluation[, region_id, ...])

__init__(candidate, evaluation, region_id=None, completed=True)#
class embodichain.lab.sim.scene.feasibility.FeasibleRegion[source]#

A conditional joint box; unsampled points are proposals, not certificates.

mode_id and all request constraints condition this box. Sampling never independently recombines bounds from different regions. Validation trials count raw box proposals, including semantic/geometric rejections.

Methods:

__init__(region_id, mode_id, lower, upper, ...)

Attributes:

validation_complete

Return whether every trial in the frozen validation allocation finished.

__init__(region_id, mode_id, lower, upper, reference_candidate_ids, validation_planned=0, validation_completed=0, validation_successes=0, confidence_interval=None)#
property validation_complete: bool#

Return whether every trial in the frozen validation allocation finished.

class embodichain.lab.sim.scene.feasibility.HeldObject[source]#

Rigid attachment during travel; never a physical-success assertion.

Parameters:
  • entity_uid (str) – Held object UID.

  • control_part (str) – Owner TCP/control part.

  • tcp_from_object (tuple) – Object-to-TCP transform used by collision FK.

Methods:

__init__(entity_uid, control_part[, ...])

__init__(entity_uid, control_part, tcp_from_object=((1.0, 0.0, 0.0, 0.0), (0.0, 1.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0), (0.0, 0.0, 0.0, 1.0)))#
class embodichain.lab.sim.scene.feasibility.JointSceneCandidate[source]#

Owned joint scene/deployment proposal, not a success certificate.

Methods:

__init__(request_id, scene, deployment, ...)

Attributes:

candidate_id

Return an identity including scene, mounting, mode and source ordinal.

__init__(request_id, scene, deployment, mode_id, parameters)#
property candidate_id: str#

Return an identity including scene, mounting, mode and source ordinal.

class embodichain.lab.sim.scene.feasibility.NewtonCollisionChecker[source]#

Check an isolated B=1 convex collision state without advancing physics.

Parameters:
  • bodies (Sequence[CollisionBody]) – Physical shapes, including fixed scene geometry. Triangle mesh and SDF inputs require an explicit adapter and return unsupported.

  • ignored_pairs (Sequence[tuple[str, str]]) – Permanent structural exemptions, as physical IDs or frame aliases. Adjacency is never inferred from link names.

  • clearance_m (float) – Required separation for non-exempt pairs, in metres.

  • device (str) – Owning Warp CPU/CUDA device; CPU is the default.

  • detection_gap_m (float) – Contact detection band, enlarged to cover clearance.

  • numeric_tolerance_m (float) – Conservative contact threshold and returned-distance allowance for float32 geometry.

  • use_cuda_graph (bool) – Capture repeated CUDA queries after a warm call.

  • max_shapes (int | None) – Optional caller limit on physical shapes. Storage is budgeted separately for eligible collision pairs and actual contacts.

  • max_contacts (int) – Upper contact-buffer budget; saturation is unsupported.

Returns from check contain a capped conservative clearance estimate, not a global minimum distance or a continuous collision certificate. Halfspaces use analytic physical-shape support. Only query-owned transforms and masks change; the live simulator’s states, filters and clock are never touched. Calls on one instance must be serialized; geometry and settings are fixed at construction. Queries are translated to a local origin, and unsafe representation/precision budgets return unsupported.

Methods:

__init__(bodies, *[, ignored_pairs, ...])

check(frame_poses, *[, allowed_contacts, ...])

Check synchronized frames and return a capped clearance estimate.

check_batch(frame_poses, *[, ...])

Check independent measured rows in bounded numerical batches.

close()

Release owned query arrays/graphs; repeated cleanup is harmless.

Attributes:

ignored_pairs

Return the expanded physical IDs for callers exporting the query.

metadata

Return owned backend, precision, distance-scope and query identity data.

__init__(bodies, *, ignored_pairs=(), clearance_m=0.0, device='cpu', detection_gap_m=0.03, numeric_tolerance_m=1e-06, use_cuda_graph=True, max_shapes=None, max_contacts=1048576)[source]#
check(frame_poses, *, allowed_contacts=(), moving_objects=(), all_pairs=False)[source]#

Check synchronized frames and return a capped clearance estimate.

Parameters:
  • frame_poses (Mapping[str, object]) – Arena transforms for every physical body frame.

  • allowed_contacts (Sequence[tuple[str, str]]) – Current-stage explicit ID/frame pair exemptions.

  • moving_objects (Sequence[str]) – Payload/dynamic frames requiring environment checks.

  • all_pairs (bool) – Also inspect static layout pairs during preparation.

Return type:

tuple[FeasibilityCheck, float]

Returns:

Discrete collision evidence and a nonnegative clearance estimate capped at detection_gap_m; unreported contacts never imply infinity. last_clearance_interval records the lower/upper estimates under the query’s conversion-precision policy. Its upper endpoint remains infinite when no native contact was reported in the detection band. An interval spanning a consumer threshold cannot classify that threshold. Acquisition failures leave the interval unavailable.

check_batch(frame_poses, *, allowed_contacts=(), moving_objects=(), all_pairs=False, env_ids=None)[source]#

Check independent measured rows in bounded numerical batches.

Parameters:
  • frame_poses (Mapping[str, object]) – Every declared frame with arena poses (B, 4, 4). Tensor inputs are copied to the query-owned CPU boundary.

  • allowed_contacts (Sequence[tuple[str, str]]) – Shared explicit contact exemptions for these rows.

  • moving_objects (Sequence[str]) – Dynamic frames requiring environment checks.

  • all_pairs (bool) – Also inspect static layout pairs.

  • env_ids (Sequence[int] | None) – Ordered selected rows; None selects all B rows. Unselected transforms do not participate in geometry or precision checks.

Return type:

tuple[FeasibilityCheck, ...]

Returns:

Discrete checks in selected-row order. last_batch_pairs records each failure’s physical IDs. This API does not report a distance or overwrite the scalar check’s clearance interval. It never advances or changes the live simulation. Geometry, precision and saturation rejection follow check().

close()[source]#

Release owned query arrays/graphs; repeated cleanup is harmless.

Return type:

None

property ignored_pairs: frozenset[frozenset[str]]#

Return the expanded physical IDs for callers exporting the query.

property metadata: dict[str, str | float | int | bool]#

Return owned backend, precision, distance-scope and query identity data.

class embodichain.lab.sim.scene.feasibility.PhaseTarget[source]#

One simultaneous TCP target in an explicit arena or entity frame.

Parameters:
  • control_part (str) – Explicit solver name, preserving custom names.

  • pose (tuple) – TCP-to-frame rigid transform.

  • frame_uid (str | None) – Entity frame UID, or None for the arena frame.

Methods:

__init__(control_part, pose[, frame_uid])

__init__(control_part, pose, frame_uid=None)#
class embodichain.lab.sim.scene.feasibility.PoseSearchVariable[source]#

One XY/yaw displacement applied to a scene group or robot installation.

Parameters:
  • name (str) – Unique variable name.

  • kind (Literal['scene', 'robot']) – scene or robot; robot members are physical robot UIDs.

  • reference_pose (tuple) – Group-to-arena Z-up transform, including mounting height.

  • lower (tuple[float, float, float]) – Lower XY metre / yaw radian displacement bounds.

  • upper (tuple[float, float, float]) – Upper displacement bounds; equal endpoints fix a parameter.

  • members (Mapping[str, tuple]) – Member UID to member-to-group transforms. All members move together, preserving dual-arm mounting and support-group relations.

Methods:

__init__(name, kind, reference_pose, lower, ...)

__init__(name, kind, reference_pose, lower, upper, members)#
class embodichain.lab.sim.scene.feasibility.PreparedFeasibilitySearch[source]#

Owned fixed request/configuration and typed joint-domain materialization.

Methods:

__init__(request, cfg)

candidate(parameters, *, mode_id, ordinal[, ...])

Materialize a full correlated proposal from normalized coordinates.

Attributes:

dimensions

Return XY/yaw coordinates, including fixed coordinates.

__init__(request, cfg)#
candidate(parameters, *, mode_id, ordinal, seed=None)[source]#

Materialize a full correlated proposal from normalized coordinates.

Parameters:
  • parameters (Sequence[float]) – One value in [0,1] per declared coordinate.

  • mode_id (str) – Explicit permitted operation mode.

  • ordinal (int) – Logical proposal ordinal, independent of simulation slots.

  • seed (int | None) – Stream identity; defaults to the search seed.

Return type:

JointSceneCandidate

Returns:

Owned scene and robot poses preserving group member transforms.

property dimensions: int#

Return XY/yaw coordinates, including fixed coordinates.

class embodichain.lab.sim.scene.feasibility.RobotDeploymentCandidate[source]#

Explicit physical robot root poses, retaining group mounting relations.

Methods:

__init__(poses)

Attributes:

deployment_id

Return a content identity independent of physical environment slots.

__init__(poses)#
property deployment_id: str#

Return a content identity independent of physical environment slots.

class embodichain.lab.sim.scene.feasibility.RobotFeasibilityBackend[source]#

Selected-row Robot adapter with multi-seed IK and full-joint RRT fallback.

Parameters:
  • robot (Robot) – Prepared robot at the candidate’s actual installation.

  • collision (NewtonCollisionChecker) – Complete physical collision geometry including both arms.

  • cfg (SceneRobotFeasibilityCfg) – Bounded branch and discretization settings.

  • entity_poses (Mapping[str, object]) – Settled arena poses for static and movable scene entities.

  • seed (int) – Candidate-local planner randomness.

  • env_id (int) – Explicit prototype row for numeric solver and geometry bindings.

  • initial_qpos (ndarray | None) – Optional owned nominal full-joint planning start. This avoids using another rollout’s current state during rolling admission.

The fallback plans in full joint coordinates, with the same collision checks for straight connections and sampled detours. It does not replace runtime motion policies; actual Task Program execution replans from fresh state.

Methods:

__init__(robot, collision, cfg, entity_poses, *)

check_state(qpos, phase, entities, *[, measured])

Check synchronized arms, payload and environment at one configuration.

connect(start, goal, phase, entities, budget)

Try a straight edge, then bounded joint-space sampling around obstacles.

frame_poses(qpos, phase, entities, *[, measured])

Compute full-link and payload transforms without writing simulator state.

resulting_poses(qpos, phase, entities)

Propagate held-object and authored post-stage planning projections.

solutions(phase, start, entities, budget)

Solve all simultaneous TCPs, retaining distinct full-state branches.

__init__(robot, collision, cfg, entity_poses, *, seed=0, env_id=0, initial_qpos=None)[source]#
check_state(qpos, phase, entities, *, measured=False)[source]#

Check synchronized arms, payload and environment at one configuration.

Return type:

bool

connect(start, goal, phase, entities, budget)[source]#

Try a straight edge, then bounded joint-space sampling around obstacles.

Return type:

ndarray | None

frame_poses(qpos, phase, entities, *, measured=False)[source]#

Compute full-link and payload transforms without writing simulator state.

Return type:

dict[str, ndarray]

resulting_poses(qpos, phase, entities)[source]#

Propagate held-object and authored post-stage planning projections.

Return type:

Mapping[str, ndarray]

solutions(phase, start, entities, budget)[source]#

Solve all simultaneous TCPs, retaining distinct full-state branches.

Return type:

Sequence[ndarray]

class embodichain.lab.sim.scene.feasibility.RobotWorkspaceProposalSource[source]#

Copy current-model FK samples into an independent numerical proposal prior.

Parameters:
  • robot (Robot) – Warm B=1 robot; no live robot reference is retained.

  • request (TaskFeasibilityRequest) – Fixed task and legal layout/installation domain.

  • budget (FeasibilityBudget) – Shared preparation deadline.

  • phase_id (str) – Explicit task phase selecting object-local TCP geometry.

  • control_part (str) – Explicit solver/cache part, preserving custom names.

  • variable_name (str) – Scene group containing that target’s frame UID.

  • sample_count (int) – Bounded cached-qpos or joint-uniform FK population.

  • uniform_fraction (float) – Independent fraction retaining full-domain proposals.

A missing cache permits finite joint-uniform FK proposals. A configured missing/corrupt cache fails explicitly. Projection onto authored height/tilt invalidates cached reachability: actual pose IK and full task checks remain mandatory. The source owns numeric copies and survives warm-host destruction.

Methods:

__init__(robot, request, budget, *, ...[, ...])

propose(parameters, mode_id, ordinal, budget)

Condition object/group XY/yaw on FK samples at the proposed installation.

Attributes:

metrics

Return prior identity, population and actual proposal usage counts.

__init__(robot, request, budget, *, phase_id, control_part, variable_name, sample_count=4096, uniform_fraction=0.5)[source]#
property metrics: dict[str, str | int]#

Return prior identity, population and actual proposal usage counts.

propose(parameters, mode_id, ordinal, budget)[source]#

Condition object/group XY/yaw on FK samples at the proposed installation.

Parameters:
  • parameters (Sequence[float]) – Original normalized full-domain low-discrepancy draw.

  • mode_id (str) – Allowed operation mode.

  • ordinal (int) – Logical source ordinal.

  • budget (FeasibilityBudget) – Shared deadline; no physical execution occurs.

Return type:

tuple[float, ...]

Returns:

Full correlated parameter vector, retaining a uniform fallback.

class embodichain.lab.sim.scene.feasibility.SceneRobotFeasibilityCfg[source]#

Search, branch, region and independent validation budgets.

All calls share max_wall_time_s including preparation. Hosts must honor the supplied deadline at their planning/control boundaries. Numerical batch size does not enable batched physical execution. Region widths are fractions of the declared parameter ranges; fixed parameters keep zero width.

Methods:

__init__([seed, max_wall_time_s, ...])

copy(**kwargs)

Return a new object replacing specified fields with new values.

from_mapping(values)

Decode settings without importing or executing configuration values.

replace(**kwargs)

Return a new object replacing specified fields with new values.

to_dict()

Convert an object into dictionary recursively.

validate([prefix])

Check the validity of configclass object.

__init__(seed=<factory>, max_wall_time_s=<factory>, search_fraction=<factory>, max_candidates=<factory>, batch_size=<factory>, global_fraction=<factory>, local_radius=<factory>, min_region_width=<factory>, archive_bins=<factory>, archive_per_bin=<factory>, max_regions=<factory>, validation_samples=<factory>, max_ik_calls=<factory>, max_planning_calls=<factory>, max_rollouts=<factory>, recording_max_bytes=<factory>, beam_width=<factory>, ik_seeds=<factory>, joint_resolution_rad=<factory>, max_motion_samples=<factory>, planning_timeout_s=<factory>, max_rrt_nodes=<factory>, device=<factory>, collision_device=<factory>, collision_use_cuda_graph=<factory>)#
copy(**kwargs)#

Return a new object replacing specified fields with new values.

This is especially useful for frozen classes. Example usage:

@configclass(frozen=True)
class C:
    x: int
    y: int

c = C(1, 2)
c1 = c.replace(x=3)
assert c1.x == 3 and c1.y == 2
Parameters:
  • obj (object) – The object to replace.

  • **kwargs – The fields to replace and their new values.

Return type:

object

Returns:

The new object.

classmethod from_mapping(values)[source]#

Decode settings without importing or executing configuration values.

Parameters:

values (Mapping[str, object]) – Closed field mapping.

Return type:

SceneRobotFeasibilityCfg

Returns:

Validated configuration.

replace(**kwargs)#

Return a new object replacing specified fields with new values.

This is especially useful for frozen classes. Example usage:

@configclass(frozen=True)
class C:
    x: int
    y: int

c = C(1, 2)
c1 = c.replace(x=3)
assert c1.x == 3 and c1.y == 2
Parameters:
  • obj (object) – The object to replace.

  • **kwargs – The fields to replace and their new values.

Return type:

object

Returns:

The new object.

to_dict()#

Convert an object into dictionary recursively.

Note

Ignores string names starting with “__” (i.e. built-in methods). Non-string mapping keys retain their original type.

Parameters:

obj (object) – An instance of a class to convert.

Raises:

ValueError – When input argument is not an object.

Return type:

dict[Any, Any]

Returns:

Converted dictionary mapping.

validate(prefix='')#

Check the validity of configclass object.

This function checks if the object is a valid configclass object. A valid configclass object contains no MISSING entries.

Parameters:
  • obj (object) – The object to check.

  • prefix (str) – The prefix to add to the missing fields. Defaults to ‘’.

Return type:

list[str]

Returns:

A list of missing fields.

Raises:

TypeError – When the object is not a valid configuration object.

class embodichain.lab.sim.scene.feasibility.TaskFeasibilityRequest[source]#

Versioned fixed semantics, robot, scene, and allowed joint search domain.

Parameters:
  • task_id (str) – Semantic identity including original roles/goals/invariants.

  • robot_profile_id (str) – Robot, tool and calibrated configuration identity.

  • policy_id (str) – Planner/runtime policy version.

  • validator_id (str) – Measured acceptance version.

  • parent_scene_id (str) – Base scene revision/content identity.

  • entity_poses (Mapping[str, tuple]) – Authored arena poses, including every variable member.

  • variables (tuple[PoseSearchVariable, ...]) – Permitted scene and mounting changes.

  • modes (tuple[TaskOperationMode, ...]) – Allowed operation modes, preserving resource constraints.

Methods:

__init__(task_id, robot_profile_id, ...)

Attributes:

request_id

Return the content identity of all fixed conditions and permissions.

__init__(task_id, robot_profile_id, policy_id, validator_id, parent_scene_id, entity_poses, variables, modes)#
property request_id: str#

Return the content identity of all fixed conditions and permissions.

class embodichain.lab.sim.scene.feasibility.TaskOperationMode[source]#

One permitted grasp/assignment/handover branch of the original task.

Methods:

__init__(mode_id, phases)

__init__(mode_id, phases)#
class embodichain.lab.sim.scene.feasibility.TaskPhase[source]#

A synchronized stage and its explicit planning-state transition.

Parameters:
  • phase_id (str) – Stable stage identity.

  • targets (tuple[PhaseTarget, ...]) – Simultaneous targets, at most one per control part.

  • dependencies (tuple[str, ...]) – Predecessors; input order must be a topological order.

  • held_objects (tuple[HeldObject, ...]) – Attachments during incoming motion, one owner per object.

  • allowed_contacts (tuple[tuple[str, str], ...]) – Physical collision IDs allowed to touch in this stage.

  • resulting_poses (tuple[ScenePoseChange, ...]) – Projected object states after this stage, used only for subsequent planning; runtime must still read fresh physical state.

  • joint_targets (tuple[tuple[str, float], ...]) – Explicit joint-name commands, e.g. open/closed fingers.

Methods:

__init__(phase_id[, targets, dependencies, ...])

__init__(phase_id, targets=(), dependencies=(), held_objects=(), allowed_contacts=(), resulting_poses=(), joint_targets=())#
class embodichain.lab.sim.scene.feasibility.TaskPlan[source]#

One complete branch with stage-indexed paths; no physical-success claim.

Methods:

__init__(checks[, paths, phase_ids, clearance_m])

Attributes:

accepted

Return whether all stages have a complete connected solution.

__init__(checks, paths=(), phase_ids=(), clearance_m=0.0)#
property accepted: bool#

Return whether all stages have a complete connected solution.

class embodichain.lab.sim.scene.feasibility.TaskPlanningBackend[source]#

Full-state solver port; each target set represents simultaneous resources.

Methods:

__init__(*args, **kwargs)

connect(start, goal, phase, entities, budget)

Return a collision-checked full-joint path or no solution in budget.

resulting_poses(qpos, phase, entities)

Update projected planning state, never measured task evidence.

solutions(phase, start, entities, budget)

Return bounded complete-joint configurations for all phase targets.

__init__(*args, **kwargs)#
connect(start, goal, phase, entities, budget)[source]#

Return a collision-checked full-joint path or no solution in budget.

Return type:

ndarray | None

resulting_poses(qpos, phase, entities)[source]#

Update projected planning state, never measured task evidence.

Return type:

Mapping[str, ndarray]

solutions(phase, start, entities, budget)[source]#

Return bounded complete-joint configurations for all phase targets.

Return type:

Sequence[ndarray]

exception embodichain.lab.sim.scene.feasibility.UnsupportedFeasibilityError[source]#

Required geometry, task adaptation or runtime capability is unavailable.

embodichain.lab.sim.scene.feasibility.binomial_interval(successes, trials, *, confidence=0.95)[source]#

Compute a two-sided Clopper-Pearson interval for fixed-count iid trials.

Parameters:
  • successes (int) – Accepted full executions.

  • trials (int) – Completed fixed-allocation trials.

  • confidence (float) – Coverage level, strictly between zero and one.

Return type:

tuple[float, float] | None

Returns:

Exact binomial interval, or None for no trials. This is a marginal interval per region, not a simultaneous or adaptively stopped guarantee.

embodichain.lab.sim.scene.feasibility.load_feasibility_atlas(path)[source]#

Validate source identity, every candidate, region and statistical receipt.

Parameters:

path (str | Path) – Saved JSON artifact; only the explicit v1 schema is accepted.

Return type:

FeasibilityAtlas

Returns:

Owned atlas, with proposals reconstructed from its fixed joint domain.

embodichain.lab.sim.scene.feasibility.plan_task_mode(mode, backend, entity_poses, budget)[source]#

Connect compatible IK branches across an explicitly ordered task graph.

Parameters:
  • mode (TaskOperationMode) – Task-preserving ordered phases; synchronized targets stay together.

  • backend (TaskPlanningBackend) – Full-joint state, geometry and kinematic implementation.

  • entity_poses (Mapping[str, object]) – Actual initial arena poses.

  • budget (FeasibilityBudget) – Shared call/deadline and beam limits.

Return type:

TaskPlan

Returns:

A complete plan, or the first unresolved stage with its true failure scope.

embodichain.lab.sim.scene.feasibility.prepare_feasibility(request, cfg=None)[source]#

Snapshot declared permissions and search settings without mutating a scene.

Parameters:
Return type:

PreparedFeasibilitySearch

Returns:

A reusable prepared materializer. Hosts prepare geometry inside search.

embodichain.lab.sim.scene.feasibility.request_from_mapping(value)[source]#

Decode a provider-independent request through closed production contracts.

Parameters:

value (Mapping[str, object]) – JSON/YAML task, scene, mounting and phase declarations.

Return type:

TaskFeasibilityRequest

Returns:

Validated immutable request. No dotted import or model client is loaded.

embodichain.lab.sim.scene.feasibility.sample_feasibility(atlas, *, count, seed, precheck, max_attempts=1000, device='cpu')[source]#

Sample correlated region proposals and recheck geometry/semantics.

Parameters:
  • atlas (FeasibilityAtlas) – Region constraints and fixed task identities.

  • count (int) – Requested output count.

  • seed (int) – Independent generation seed.

  • precheck (Callable[[JointSceneCandidate], Sequence[FeasibilityCheck]]) – Trusted current semantic/geometric checks; both stages required.

  • max_attempts (int) – Hard proposal/rejection limit.

  • device (str) – Numeric proposal materialization device; defaults to CPU for portable consumption of an atlas created on another CUDA device.

Return type:

tuple[JointSceneCandidate, ...]

Returns:

At most count proposals. These require new full execution acceptance; region success evidence is never inherited by a generated episode.

embodichain.lab.sim.scene.feasibility.save_feasibility_atlas(atlas, path)[source]#

Atomically publish a frozen, content-addressed evidence snapshot.

Parameters:
  • atlas (FeasibilityAtlas) – Complete owned region and observation artifact.

  • path (str | Path) – Destination JSON path.

Return type:

None

embodichain.lab.sim.scene.feasibility.search_feasibility(prepared, evaluator, *, budget=None, validate_regions=True, on_observation=None)[source]#

Explore globally and refine promising cells, then validate frozen regions.

Parameters:
  • prepared (PreparedFeasibilitySearch) – Fixed request and search configuration.

  • evaluator (FeasibilityEvaluator) – Trusted bounded geometry/planning/physical host.

  • budget (FeasibilityBudget | None) – Optional caller-owned clock/cancellation budget.

  • validate_regions (bool) – Freeze and return regions without held-out trials when false; the caller can later invoke validate_feasibility once.

  • on_observation (Callable[[FeasibilityObservation], None] | None) – Optional diagnostic/checkpoint consumer for completed or explicitly interrupted observations. Errors propagate to the caller.

Return type:

FeasibilityAtlas

Returns:

Actual observed regions and evidence; no global optimality certificate.

embodichain.lab.sim.scene.feasibility.validate_feasibility(atlas, evaluator, *, budget=None, prepare=True, on_observation=None)[source]#

Validate previously frozen regions with independent fixed-count trials.

Parameters:
  • atlas (FeasibilityAtlas) – Frozen regions; an already validated atlas cannot be revalidated.

  • evaluator (FeasibilityEvaluator) – Same request/policy/validator host as the search.

  • budget (FeasibilityBudget | None) – Shared search budget, or a fresh validation-only budget.

  • prepare (bool) – Prepare the host for standalone validation.

  • on_observation (Callable[[FeasibilityObservation], None] | None) – Optional checkpoint consumer, including interrupted trials.

Return type:

FeasibilityAtlas

Returns:

A new atlas containing held-out evidence and intervals for completed allocations only. Interrupted trials never count as completed successes. Costs include the saved search and this validation call, even when the caller provides a fresh budget.

Implementation modules#

SceneRobotFeasibilityCfg

Search, branch, region and independent validation budgets.

PoseSearchVariable

One XY/yaw displacement applied to a scene group or robot installation.

PhaseTarget

One simultaneous TCP target in an explicit arena or entity frame.

HeldObject

Rigid attachment during travel; never a physical-success assertion.

TaskPhase

A synchronized stage and its explicit planning-state transition.

TaskOperationMode

One permitted grasp/assignment/handover branch of the original task.

TaskFeasibilityRequest

Versioned fixed semantics, robot, scene, and allowed joint search domain.

RobotDeploymentCandidate

Explicit physical robot root poses, retaining group mounting relations.

JointSceneCandidate

Owned joint scene/deployment proposal, not a success certificate.

FeasibilityCheck

One stage outcome with explicit unsupported and budget-limited evidence.

CandidateEvaluation

Independent preparation, planning and actual task execution evidence.

FeasibilityBudget

One monotonic budget shared by preparation, planning and execution.

FeasibilityBudgetExhausted

The shared deadline, cancellation or one call quota has been reached.

CollisionBody

One physical shape in an explicitly named link/entity frame.

NewtonCollisionChecker

Check an isolated B=1 convex collision state without advancing physics.

UnsupportedFeasibilityError

Required geometry, task adaptation or runtime capability is unavailable.

TaskPlanningBackend

Full-state solver port; each target set represents simultaneous resources.

TaskPlan

One complete branch with stage-indexed paths; no physical-success claim.

plan_task_mode(mode, backend, entity_poses, ...)

Connect compatible IK branches across an explicitly ordered task graph.

RobotFeasibilityBackend

Selected-row Robot adapter with multi-seed IK and full-joint RRT fallback.

FeasibilityEvaluator

Trusted host port: checks retain their stage and actual evidence scope.

PreparedFeasibilitySearch

Owned fixed request/configuration and typed joint-domain materialization.

FeasibilityObservation

One search or held-out evaluation and its exact proposal.

FeasibleRegion

A conditional joint box; unsampled points are proposals, not certificates.

FeasibilityAtlas

Frozen request, regions, observations and accounting suitable for replay.

prepare_feasibility(request[, cfg])

Snapshot declared permissions and search settings without mutating a scene.

search_feasibility(prepared, evaluator, *[, ...])

Explore globally and refine promising cells, then validate frozen regions.

sample_feasibility(atlas, *, count, seed, ...)

Sample correlated region proposals and recheck geometry/semantics.

validate_feasibility(atlas, evaluator, *[, ...])

Validate previously frozen regions with independent fixed-count trials.

binomial_interval(successes, trials, *[, ...])

Compute a two-sided Clopper-Pearson interval for fixed-count iid trials.

request_from_mapping(value)

Decode a provider-independent request through closed production contracts.

save_feasibility_atlas(atlas, path)

Atomically publish a frozen, content-addressed evidence snapshot.

load_feasibility_atlas(path)

Validate source identity, every candidate, region and statistical receipt.

write_feasibility_report(atlas, path)

Write a standalone SVG/HTML slice inspector without external resources.

Configured rigid Task Program feasibility workflow and measured event adapter.

Classes:

MeasuredTaskMonitor

Measure explicit rigid-body predicates and ordered intermediate events.

Functions:

build_feasibility_host(config, *[, ...])

Build the closed, configuration-defined Task Program search adapter.

cli([argv])

Run joint scene/deployment search from a closed workflow configuration.

run_feasibility(config_path, output_directory)

Search a configured task, persist exact evidence and write a slice report.

class embodichain.lab.task_program.integrations.feasibility.MeasuredTaskMonitor[source]#

Measure explicit rigid-body predicates and ordered intermediate events.

Parameters:
  • final_checks (Sequence[Mapping[str, object]]) – Required terminal predicates.

  • events (Sequence[Mapping[str, object]]) – Ordered event_id, conditions, consecutive_steps maps.

Predicates use physical arena poses/velocities and explicit joint names. They never infer task roles or lower thresholds from candidate outcomes.

Methods:

__init__(final_checks, events, *[, env_id])

batch_scope(env, monitors, *[, extra_conditions])

Share one measured numeric boundary across independent event monitors.

observe(env, action)

Record consecutive event predicates at actual control boundaries.

predicate(env, condition)

Read one explicitly declared condition from current physical state.

reset(env)

Seed measured initial heights and reset ordered event history.

validation(env)

Return measured terminal, ordering and intermediate-event checks.

__init__(final_checks, events, *, env_id=0)[source]#
static batch_scope(env, monitors, *, extra_conditions=())[source]#

Share one measured numeric boundary across independent event monitors.

Parameters:
  • env (Any) – Live environment or complete measured-state facade.

  • monitors (Sequence[MeasuredTaskMonitor]) – Distinct physical-row monitors, already reset for this episode.

  • extra_conditions (Sequence[Mapping[str, object]]) – Additional validated initial checks to read in this scope.

Return type:

object

Returns:

Context manager. Inside it, predicate arithmetic uses one packed readback; ordered events, counters and reports still belong to each native monitor. Unsupported fast paths keep the scalar predicate. No cached physical values survive the scope.

observe(env, action)[source]#

Record consecutive event predicates at actual control boundaries.

Return type:

None

predicate(env, condition)[source]#

Read one explicitly declared condition from current physical state.

Parameters:
  • env (Any) – Current environment; reads use the explicit physical row.

  • condition (Mapping[str, object]) – A validated predicate mapping.

Return type:

bool

Returns:

Physical truth value; unknown entities/joints are configuration errors.

reset(env)[source]#

Seed measured initial heights and reset ordered event history.

Return type:

None

validation(env)[source]#

Return measured terminal, ordering and intermediate-event checks.

Return type:

ValidationResult

embodichain.lab.task_program.integrations.feasibility.build_feasibility_host(config, *, config_directory='.', output_directory)[source]#

Build the closed, configuration-defined Task Program search adapter.

Parameters:
  • config (Mapping[str, object]) – request, search and task_program mapping. No executable imports.

  • config_directory (str | Path) – Base for deployment/config resource paths.

  • output_directory (str | Path) – Accepted episode and report destination.

Return type:

tuple[Any, TaskProgramFeasibilityHost]

Returns:

Prepared joint domain and a closeable canonical Task Program host.

embodichain.lab.task_program.integrations.feasibility.cli(argv=None)[source]#

Run joint scene/deployment search from a closed workflow configuration.

Return type:

int

embodichain.lab.task_program.integrations.feasibility.run_feasibility(config_path, output_directory)[source]#

Search a configured task, persist exact evidence and write a slice report.

Parameters:
  • config_path (str | Path) – Closed YAML/JSON workflow configuration.

  • output_directory (str | Path) – Output root for atlas, session audit and accepted data.

Return type:

Any

Returns:

A measured atlas; unsupported candidates remain explicit diagnostics.

Gym-owned joint scene/deployment preparation and measured Task Program trials.

Classes:

TaskProgramFeasibilityHost

Evaluate full task modes through canonical Gym execution and shared sessions.

Functions:

save_feasibility_episode(episode, directory)

Atomically persist measured tensors and return an idempotent commit receipt.

class embodichain.lab.task_program.integrations.simulation.feasibility.TaskProgramFeasibilityHost[source]#

Evaluate full task modes through canonical Gym execution and shared sessions.

Parameters:
  • environment_factory (Callable[[RobotDeploymentCandidate], Any]) – Construct a B=1 environment from copied config at these robot root poses. It owns robot/profile/policy selection.

  • initial_validator (Callable[[Any, JointSceneCandidate], ValidationResult]) – Required original semantics and physical-layout checks after settling. Check IDs must include semantics and geometry.

  • measured_validator (Callable[[Any, JointSceneCandidate], ValidationResult]) – Required state/event task evidence after execution.

  • collision_factory (Callable[[Any], NewtonCollisionChecker]) – Build complete physical robot/environment geometry.

  • runtime_phase (Callable[[Any, Any, JointSceneCandidate], TaskPhase]) – Resolve current contact/held-object permissions from the actual controller action provenance, never a guessed path index.

  • configure_mode (Callable[[Any, JointSceneCandidate], None] | None) – Bind the selected legal grasp/assignment mode to runtime. Required for multiple modes; single-mode default is runtime policy.

  • observe (Callable[[Any, Any], None] | None) – Optional per-control-step measured event monitor.

  • sink (Callable[[ExpertEpisode], CommitReceipt] | None) – Optional accepted ExpertEpisode writer returning CommitReceipt.

  • workspace_proposal (Mapping[str, object] | None) – Optional explicit phase/part/group workspace prior settings.

  • observation_keys (Sequence[str]) – Required flattened environment observation paths. Saved under env/ with T+1 actual reset/step samples; missing channels fail.

  • settle_steps (int) – Existing host settling substeps (stability still requires explicit initial validation).

Methods:

__init__(*, environment_factory, ...[, ...])

close()

Release the owned native environment without committing live recordings.

evaluate(candidate, budget)

Prepare, plan, restore and independently measure one exact deployment.

prepare(request, budget)

Bind immutable task semantics and instantiate the existing session budget.

propose(parameters, mode_id, ordinal, budget)

Supply optional workspace guidance for full-domain exploration draws.

Attributes:

proposal_metrics

Return the numerical workspace prior identity and usage, if enabled.

session_snapshot

Return canonical attempt/receipt accounting without exposing mutable state.

__init__(*, environment_factory, initial_validator, measured_validator, collision_factory, runtime_phase, configure_mode=None, observe=None, sink=None, settle_steps=0, observation_keys=(), workspace_proposal=None)[source]#
close()[source]#

Release the owned native environment without committing live recordings.

Return type:

None

evaluate(candidate, budget)[source]#

Prepare, plan, restore and independently measure one exact deployment.

Return type:

CandidateEvaluation

prepare(request, budget)[source]#

Bind immutable task semantics and instantiate the existing session budget.

Return type:

None

property proposal_metrics: Mapping[str, str | int] | None#

Return the numerical workspace prior identity and usage, if enabled.

propose(parameters, mode_id, ordinal, budget)[source]#

Supply optional workspace guidance for full-domain exploration draws.

Return type:

tuple[float, ...]

property session_snapshot: Mapping[str, Any]#

Return canonical attempt/receipt accounting without exposing mutable state.

embodichain.lab.task_program.integrations.simulation.feasibility.save_feasibility_episode(episode, directory)[source]#

Atomically persist measured tensors and return an idempotent commit receipt.

Parameters:
  • episode (ExpertEpisode) – Accepted session-owned execution evidence.

  • directory (str | Path) – Destination root; filename uses only the generated commit ID.

Return type:

CommitReceipt

Returns:

Confirmed receipt after atomic file publication; writing errors propagate.

Physical collision extraction for the joint feasibility simulation adapter.

Functions:

collision_bodies_from_simulation(env, *[, ...])

Read materialized robot-link and rigid-body physical collision shapes.

embodichain.lab.task_program.integrations.simulation.feasibility_geometry.collision_bodies_from_simulation(env, *, env_id=0)[source]#

Read materialized robot-link and rigid-body physical collision shapes.

Parameters:
  • env (Any) – Prepared Gym host with full-link Robot kinematics.

  • env_id (int) – Physical arena whose collision resources are inspected.

Return type:

tuple[CollisionBody, ...]

Returns:

Link-local physical shapes with IDs robot_uid/link/index and object_uid/index. Render geometry is never substituted.

Unsupported physical geometry APIs/scales and shapes fail explicitly. The caller owns permanent structural and phase-specific contact permissions.

Batched arena-Z planar displacement of rigid group frames.

Functions:

compose_planar_offsets(reference, offsets)

Compose arena XY translations and yaw rotations around group origins.

embodichain.compute.geometry.planar.compose_planar_offsets(reference, offsets)[source]#

Compose arena XY translations and yaw rotations around group origins.

Parameters:
  • reference (Tensor) – Group-to-arena matrices, shape (V, 4, 4).

  • offsets (Tensor) – XY metre/yaw radian displacements, shape (..., V, 3).

Return type:

Tensor

Returns:

Independent transformed groups, shape (..., V, 4, 4). Height and authored tilt are preserved. Inputs share floating dtype/device.

collision_shapes_from_articulation_link(...)

Read materialized physical shapes of one named articulation link.

collision_shapes_from_articulation_link(...)

Read materialized physical shapes of one named articulation link.

Workspace proposal prior#

RobotWorkspaceProposalSource copies valid cached FK samples, or prepares a bounded joint-uniform FK population when no cache is configured. The configured workspace_proposal selects an explicit phase, control part and scene group. Group positions are proposed using object-local TCP geometry at the candidate robot installation. Height/tilt projection is followed by actual IK; a prior sample never certifies the projected target. A retained independent uniform component explores poses absent from sparse caches. Malformed configured caches fail rather than becoming ordinary scene rejections.

search_feasibility(validate_regions=False) returns frozen regions for a later standalone validate_feasibility call. Adaptive proposal replay requires the same feedback stream; seeds do not guarantee identical physics/timeouts. Numeric batching preserves proposal prefixes for fixed feedback. Fixed search coordinates have canonical normalized value zero. Atlas loading validates canonical CPU geometry within 1e-12 while retaining original saved poses and identities, and does not require the originating CUDA device. New sampling uses CPU by default.

observation_keys selects required flattened reset/step channels in the configured adapter; records use env/<key>. The host captures the actual reset return value rather than recomputing observations/history. Missing channels cannot accept data. recording_max_bytes bounds owned raw recording data; shared-session reservations account for stacking/copying, and overflow interrupts the attempt without publishing partial successful data. Diagnostic observations are appended to diagnostics/attempts.jsonl and session accounting is retained on errors. Execution cost for ranking is simulated controller duration; wall latency is reported separately.

RobotWorkspaceProposalSource

Copy current-model FK samples into an independent numerical proposal prior.

Read actual physical collision geometry for one articulation link.

Parameters:
  • link_name (str) – Asset-defined link identity.

  • env_id (int) – Physical environment row whose cooked shapes are requested.

Return type:

list[CollisionShapeDesc]

Returns:

Owned link-local descriptors with native scale/approximation applied. Links without physical collision geometry return an empty list.

Raises:
  • ValueError – For an unknown link.

  • IndexError – For an invalid environment row.

  • RuntimeError – When the active backend cannot expose physical shapes.

The initial physical collision gate includes static/static layout overlap; intended support/mount contacts must be declared explicitly. Runtime checks cover all dynamic scene bodies as well as robot and held-object geometry. Preparation and settling update calls share the deadline; cleanup restores the original ports and drains resources after interruption. The current episode-session writer uses position-mode qpos labels; position-velocity expert deployments are explicitly unsupported by this writer rather than silently dropping required velocity labels.