hylo.codeagents.scene_check¶
Package: hylo-code-agents · Core contracts
scene_check ¶
The scene checker (RFC-0006 part 8): is a hylo.scene/v0.1 file a fair task for the robot?
report = check_scene("scene.json") # env "mujoco.panda_scene", seeds (0, 1)
report.ok, [p.message for p in report.problems]
Checks, in order (later ones need the earlier ones to pass):
- schema the file parses and validates against hylo.core.scene.Scene
- static names and labels unique, references resolve, no attachment cycles, the predicate can hold at all (hylo.core.scene.scene_problems)
- physics per seed, through the Environment contract with privileged observations: the scene loads; start poses fit (no free position in a region, overlaps deeper than 3 mm); after settling 2 s nothing fell off, nothing moved more than 2 cm or tilted more than 10 degrees, joints stayed put, nothing penetrates (objects, table, robot); the success predicate is false at the start and stays false while settling
- reach on the settled state, with hylo-manip's IK on the env's RobotSpec: every movable object has a top-down (or side) grasp the arm reaches, with a pre-grasp 10 cm back, and fits the open hand; every jointed part is reachable at its centre and at the end of its travel; every place target (b of on / inside / above, inside regions, near points) is reachable 5 cm above its top
Problems are hylo.core.scene.Problem records (code, message, objects, severity); warnings do not fail a scene.
SceneChecker ¶
SceneChecker(env_type: str = DEFAULT_ENV, seeds: Sequence[int] = (0, 1), settle_s: float = 2.0, reach: bool = True, satisfiable: bool = True)
Runs the checks; holds one environment (built through the registry, cameras off, privileged on).
problem ¶
A checker Problem (shared by the fixed-format and the free checker).
parse_scene ¶
A Scene from a path, JSON text, a mapping or a Scene; or the schema problems.
quat_matrix ¶
Rotation matrix of a (w, x, y, z) quaternion.
tilt_deg ¶
The angle (degrees) between two orientations given as (w, x, y, z) quaternions.
leaves ¶
The atomic terms an arrangement aims at (all_of flattened, the first option of any_of).
arrangement ¶
arrangement(terms: Sequence[Any], objs: dict[str, Any], scene: Scene, skip: set[str] = frozenset()) -> tuple[dict, dict] | None
Poses {name: (pos, quat)} and joint values that should make terms hold, from the settled state objs
(privileged objects). None when a term cannot be arranged (lifted, not, a non-movable subject).
dedupe ¶
The problems without repeats (the same code and message on another seed counts as a repeat).
check_scene ¶
check_scene(source: str | Path | dict | Scene, path: str | Path | None = None, **kw: Any) -> CheckReport