hylo.manip.datatypes¶
Package: hylo-manip · Core contracts
datatypes ¶
Data types of the toolkit (re-exported by hylo.manip.tools). Frames: world, metres, radians, +z up; poses are
4x4 homogeneous matrices; the TCP follows hylo.core.robot (+x approach, +y closing axis, origin between the pads).
Verb
module-attribute
¶
CameraView
dataclass
¶
CameraView(rgb: ndarray, depth: ndarray | None, K: ndarray | None, T_world_cam: ndarray | None, seg: ndarray | None = None)
One camera: rgb (H, W, 3) uint8; depth (H, W) metres or None; K (3, 3); T_world_cam (4, 4) in the OpenCV optical frame; seg (H, W) int32 instance ids when the environment gives segmentation.
View
dataclass
¶
View(cams: dict[str, CameraView], points: ndarray, segments: dict[int, str] = dict(), step: int = 0)
One observation: cams {name: CameraView}; points (N, 3) world points fused from every depth camera (voxel-downsampled, robot included); segments {instance id: label} when given; step at which it was taken.
Mask
dataclass
¶
An instance mask in one camera: label (the text label it answers), camera, mask (H, W) bool, score in [0, 1] (1: exact label match), instance (the environment's instance id, when known; label: view.segments[instance]).
Table
dataclass
¶
Detection
dataclass
¶
Box
dataclass
¶
Oriented box: center (3,), size (3,) = length along yaw >= width, height; yaw in (-pi/2, pi/2] about +z;
bottom z. box.pose is the 4x4 object frame (origin at center, x along length, z up).
Fit
dataclass
¶
Goal
dataclass
¶
Goal(verb: Verb, arm: str | None = None, tcp: ndarray | None = None, pre: ndarray | None = None, hand_before: Sequence[float] | None = None, hand: Sequence[float] | None = None, joints: ndarray | None = None, rank: float = 0.0, free: Literal['x', 'z'] | None = None, attached: ndarray | None = None)
One motion the planner may choose. verb: grasp, place, reach, lift, push, press, retreat, home. arm: arm name
(None: the robot's only arm).
tcp: (4, 4) TCP pose to end at. pre: (4, 4) approach pose: the planner reaches pre around obstacles, then moves
in a straight line to tcp (that line is checked against the table and the robot only, not observed points, so it
may touch the object). Without pre, verbs lift, retreat, push and press move in a straight line from the current
TCP; other verbs plan a collision-free joint path to tcp. joints: a joint-space goal instead of tcp (e.g.
home). hand_before: hand command while moving (None: keep the current one). hand: hand command at the end, held
until the hand settles (None: no change). rank: lower is tried first among goals passed together. free: "x" or "z"
lets the planner rotate freely about that TCP axis (e.g. "x" for a top-down approach to a round object).
attached: (N, 3) points of a held object in the TCP frame: they move with the hand and are checked against the
table and observed points like the hand itself (place_at fills it); observed points of the object where it is
now are ignored.
Plan
dataclass
¶
Plan(goal: Goal, actions: ndarray, start_q: dict[str, ndarray], info: dict[str, Any] = dict(), path: dict[str, list] = dict())
A timed motion: goal (the one chosen; several arms: the first, all in info["goals"]), actions (T, action_dim) joint targets at control rate, start_q {arm: q} it was planned from (run refuses if the robot moved away), info (ik residual, path length, duration, method), path {arm: joint waypoints} before timing.