Skip to content

Data models

Typed specs and results passed through the pipeline.

Results

RetargetingResult

Bases: BaseModel

Strict pickle-free retargeting checkpoint.

Methods:

Name Description
resampled

Return this result sampled on a new FPS grid.

save_npz

Save result to .npz.

load_npz

Load the current strict .npz checkpoint schema.

Attributes:

Name Type Description
model_config
schema_version int
name str
status RunStatus
qpos FloatArray
fps float
cost FloatArray | None
human_joints FloatArray | None
human_vocabulary VocabularyManifest | None
robot_link_positions FloatArray | None
run RetargetingRunReport | None
playback ResultPlaybackSpec | None
warnings tuple[str, ...]
provenance dict[str, Any]
frame_count int

Number of frames.

Attributes

model_config class-attribute instance-attribute

model_config = ConfigDict(arbitrary_types_allowed=True)

schema_version class-attribute instance-attribute

schema_version: int = 2

name instance-attribute

name: str

status instance-attribute

status: RunStatus

qpos instance-attribute

qpos: FloatArray

fps class-attribute instance-attribute

fps: float = 30.0

cost class-attribute instance-attribute

cost: FloatArray | None = None

human_joints class-attribute instance-attribute

human_joints: FloatArray | None = None

human_vocabulary class-attribute instance-attribute

human_vocabulary: VocabularyManifest | None = None
robot_link_positions: FloatArray | None = None

run class-attribute instance-attribute

run: RetargetingRunReport | None = None

playback class-attribute instance-attribute

playback: ResultPlaybackSpec | None = None

warnings class-attribute instance-attribute

warnings: tuple[str, ...] = ()

provenance class-attribute instance-attribute

provenance: dict[str, Any] = Field(default_factory=dict)

frame_count property

frame_count: int

Number of frames.

Functions

resampled

resampled(fps: float, *, name: str | None = None) -> RetargetingResult

Return this result sampled on a new FPS grid.

save_npz

save_npz(path: str | Path) -> Path

Save result to .npz.

load_npz classmethod

load_npz(path: str | Path) -> RetargetingResult

Load the current strict .npz checkpoint schema.

EvaluationReport

Bases: BaseModel

Evaluation metrics for a result.

Attributes:

Name Type Description
status RunStatus

Overall evaluation outcome.

source_name str | None

Human-readable name of the evaluated result or clip.

frame_count int | None

Number of frames in the evaluated motion.

qpos_dimension int | None

Robot qpos width.

fps float | None

Sampling rate of the evaluated result.

task_kind str | None

Scene task kind string when available.

robot_name str | None

Robot preset or asset name.

motion_name str | None

Source human motion name.

metrics dict[str, float]

Scalar metric values keyed by name.

metric_units dict[str, str]

Unit strings aligned with metrics keys.

details dict[str, Any]

Structured diagnostic payloads (curves, thresholds, …).

warnings tuple[str, ...]

Non-fatal evaluation messages.

Methods:

Name Description
save_json

Save report as JSON.

Attributes

status class-attribute instance-attribute

status: RunStatus = SUCCESS

source_name class-attribute instance-attribute

source_name: str | None = None

frame_count class-attribute instance-attribute

frame_count: int | None = None

qpos_dimension class-attribute instance-attribute

qpos_dimension: int | None = None

fps class-attribute instance-attribute

fps: float | None = None

task_kind class-attribute instance-attribute

task_kind: str | None = None

robot_name class-attribute instance-attribute

robot_name: str | None = None

motion_name class-attribute instance-attribute

motion_name: str | None = None

metrics class-attribute instance-attribute

metrics: dict[str, float] = Field(default_factory=dict)

metric_units class-attribute instance-attribute

metric_units: dict[str, str] = Field(default_factory=dict)

details class-attribute instance-attribute

details: dict[str, Any] = Field(default_factory=dict)

warnings class-attribute instance-attribute

warnings: tuple[str, ...] = ()

Functions

save_json

save_json(path: str | Path) -> Path

Save report as JSON.

EvaluationManifest

Bases: BaseModel

Manifest written by batch evaluation runs.

Attributes:

Name Type Description
schema_version int

On-disk manifest format version.

created_at datetime

UTC timestamp when the manifest was first created.

updated_at datetime

UTC timestamp of the most recent update.

total int

Number of records in records.

success_count int

Records with :attr:~retarget.core.enums.RunStatus.SUCCESS.

partial_count int

Records with :attr:~retarget.core.enums.RunStatus.PARTIAL.

skipped_count int

Records with :attr:~retarget.core.enums.RunStatus.SKIPPED.

failed_count int

Records with :attr:~retarget.core.enums.RunStatus.FAILED.

records tuple[EvaluationRecord, ...]

Per-result evaluation entries.

Methods:

Name Description
from_records

Build a summary manifest from per-result records.

load

Load a batch evaluation manifest JSON file.

save_json

Save manifest JSON.

Attributes

model_config class-attribute instance-attribute

model_config = ConfigDict(arbitrary_types_allowed=True)

schema_version class-attribute instance-attribute

schema_version: int = 1

created_at instance-attribute

created_at: datetime

updated_at instance-attribute

updated_at: datetime

total class-attribute instance-attribute

total: int = 0

success_count class-attribute instance-attribute

success_count: int = 0

partial_count class-attribute instance-attribute

partial_count: int = 0

skipped_count class-attribute instance-attribute

skipped_count: int = 0

failed_count class-attribute instance-attribute

failed_count: int = 0

records class-attribute instance-attribute

records: tuple[EvaluationRecord, ...] = ()

Functions

from_records classmethod

from_records(records: Iterable[EvaluationRecord]) -> EvaluationManifest

Build a summary manifest from per-result records.

load classmethod

load(path: str | Path) -> EvaluationManifest

Load a batch evaluation manifest JSON file.

save_json

save_json(path: str | Path) -> Path

Save manifest JSON.

EvaluationRecord

Bases: BaseModel

Recorded outcome for evaluating one retargeting result.

Attributes:

Name Type Description
result_path Path

Path to the evaluated .npz retargeting output.

status RunStatus

Per-result evaluation outcome.

report_path Path | None

Optional JSON report written for this result.

job_id str | None

Batch or scheduler job identifier.

source_name str | None

Human-readable clip or run name.

frame_count int | None

Frame count observed during evaluation.

message str

Error or skip explanation when status is not success.

metrics dict[str, float]

Scalar metrics copied from the report.

warnings tuple[str, ...]

Warnings surfaced during evaluation.

Attributes

model_config class-attribute instance-attribute

model_config = ConfigDict(arbitrary_types_allowed=True)

result_path instance-attribute

result_path: Path

status instance-attribute

status: RunStatus

report_path class-attribute instance-attribute

report_path: Path | None = None

job_id class-attribute instance-attribute

job_id: str | None = None

source_name class-attribute instance-attribute

source_name: str | None = None

frame_count class-attribute instance-attribute

frame_count: int | None = None

message class-attribute instance-attribute

message: str = ''

metrics class-attribute instance-attribute

metrics: dict[str, float] = Field(default_factory=dict)

warnings class-attribute instance-attribute

warnings: tuple[str, ...] = ()

Scene & motion

SceneObservation dataclass

SceneObservation(
    name: str,
    timeline: SampleTimeline,
    world_frame: FrameConvention,
    actor: MotionSequence[Any],
    landmarks: tuple[PointTrack, ...] = (),
    rigid_bodies: tuple[PoseTrack, ...] = (),
    objects: tuple[ObservedObject, ...] = (),
    contacts: SemanticContactSequence | None = None,
    terrain: TerrainSpec | None = None,
    alignment_reports: tuple[AlignmentReport, ...] = (),
    provenance: dict[str, object] = dict(),
)

Shared-timeline result of capture processing before robot adaptation.

Methods:

Name Description
landmark

Return a semantic landmark track.

observed_object

Return an observed object.

save_npz

Explicitly save this observation checkpoint without pickle.

load_npz

Load an explicit observation checkpoint.

Attributes:

Name Type Description
name str
timeline SampleTimeline
world_frame FrameConvention
actor MotionSequence[Any]
landmarks tuple[PointTrack, ...]
rigid_bodies tuple[PoseTrack, ...]
objects tuple[ObservedObject, ...]
contacts SemanticContactSequence | None
terrain TerrainSpec | None
alignment_reports tuple[AlignmentReport, ...]
provenance dict[str, object]

Attributes

name instance-attribute

name: str

timeline instance-attribute

timeline: SampleTimeline

world_frame instance-attribute

world_frame: FrameConvention

actor instance-attribute

actor: MotionSequence[Any]

landmarks class-attribute instance-attribute

landmarks: tuple[PointTrack, ...] = ()

rigid_bodies class-attribute instance-attribute

rigid_bodies: tuple[PoseTrack, ...] = ()

objects class-attribute instance-attribute

objects: tuple[ObservedObject, ...] = ()

contacts class-attribute instance-attribute

contacts: SemanticContactSequence | None = None

terrain class-attribute instance-attribute

terrain: TerrainSpec | None = None

alignment_reports class-attribute instance-attribute

alignment_reports: tuple[AlignmentReport, ...] = ()

provenance class-attribute instance-attribute

provenance: dict[str, object] = field(default_factory=dict)

Functions

landmark

landmark(role: ObservationRole) -> PointTrack

Return a semantic landmark track.

observed_object

observed_object(role: ObservationRole) -> ObservedObject

Return an observed object.

save_npz

save_npz(path: str | Path) -> Path

Explicitly save this observation checkpoint without pickle.

load_npz classmethod

load_npz(path: str | Path) -> SceneObservation

Load an explicit observation checkpoint.

ObservedObject dataclass

ObservedObject(
    role: ObservationRole,
    pose: PoseTrack,
    geometry: ObjectSpec,
    provenance: dict[str, object] = dict(),
)

Observed object geometry and pose, independent of a target robot.

Attributes:

Name Type Description
role ObservationRole
pose PoseTrack
geometry ObjectSpec
provenance dict[str, object]

Attributes

role instance-attribute

role: ObservationRole

pose instance-attribute

pose: PoseTrack

geometry instance-attribute

geometry: ObjectSpec

provenance class-attribute instance-attribute

provenance: dict[str, object] = field(default_factory=dict)

SemanticContactSequence dataclass

SemanticContactSequence(
    timeline: SampleTimeline,
    tracks: tuple[SemanticContactTrack, ...],
    support: SupportPlane | None = None,
    provenance: dict[str, object] = dict(),
)

Robot-independent semantic contacts and support geometry.

Methods:

Name Description
resolve

Resolve semantic subjects to concrete robot links.

Attributes:

Name Type Description
timeline SampleTimeline
tracks tuple[SemanticContactTrack, ...]
support SupportPlane | None
provenance dict[str, object]

Attributes

timeline instance-attribute

timeline: SampleTimeline

tracks instance-attribute

tracks: tuple[SemanticContactTrack, ...]

support class-attribute instance-attribute

support: SupportPlane | None = None

provenance class-attribute instance-attribute

provenance: dict[str, object] = field(default_factory=dict)

Functions

resolve

resolve(link_mapping: Mapping[ContactSubject, Sequence[RobotLink]]) -> ContactPlan

Resolve semantic subjects to concrete robot links.

SceneSpec

Bases: BaseModel

Scene configuration for a retargeting run.

Attributes:

Name Type Description
task_kind TaskKind

High-level workflow (robot-only, object interaction, climbing).

object ObjectSpec | None

Manipulated or climbable object definition.

terrain TerrainSpec | None

Static ground or climbable terrain definition.

ground_range tuple[float, float]

XY extent of the procedural ground grid (meters).

ground_size int

Number of samples per axis for :meth:ground_points.

provenance dict[str, Any]

Origin and processing history for the scene.

Methods:

Name Description
robot_only

Create a robot-only ground scene.

object_interaction

Create an object interaction scene.

climbing

Create a climbing or terrain-interaction scene.

has_dynamic_object

Whether qpos should include appended object poses.

resampled

Return a scene with dynamic trajectories sampled on a new FPS grid.

ground_points

Create an xy grid of ground points.

Attributes

model_config class-attribute instance-attribute

model_config = ConfigDict(arbitrary_types_allowed=True)

task_kind instance-attribute

task_kind: TaskKind

object class-attribute instance-attribute

object: ObjectSpec | None = None

terrain class-attribute instance-attribute

terrain: TerrainSpec | None = None

ground_range class-attribute instance-attribute

ground_range: tuple[float, float] = (-1.0, 1.0)

ground_size class-attribute instance-attribute

ground_size: int = 15

provenance class-attribute instance-attribute

provenance: dict[str, Any] = Field(default_factory=dict)

Functions

robot_only classmethod

robot_only() -> SceneSpec

Create a robot-only ground scene.

Returns:

Name Type Description
SceneSpec SceneSpec

ROBOT_ONLY task with default flat terrain.

object_interaction classmethod

object_interaction(object_spec: ObjectSpec) -> SceneSpec

Create an object interaction scene.

Parameters:

Name Type Description Default
object_spec ObjectSpec

Manipulated object definition.

required

Returns:

Name Type Description
SceneSpec SceneSpec

OBJECT_INTERACTION task referencing object_spec.

climbing classmethod

climbing(
    terrain: TerrainSpec | None = None, object_spec: ObjectSpec | None = None
) -> SceneSpec

Create a climbing or terrain-interaction scene.

Parameters:

Name Type Description Default
terrain TerrainSpec | None

Climbable terrain mesh or samples.

None
object_spec ObjectSpec | None

Optional climbable object instead of terrain.

None

Returns:

Name Type Description
SceneSpec SceneSpec

CLIMBING task; inserts a default terrain spec when both arguments are omitted.

has_dynamic_object

has_dynamic_object() -> bool

Whether qpos should include appended object poses.

resampled

resampled(fps: float) -> SceneSpec

Return a scene with dynamic trajectories sampled on a new FPS grid.

ground_points

ground_points() -> FloatArray

Create an xy grid of ground points.

ObjectSpec

Bases: BaseModel

Object asset and sampling information.

Attributes:

Name Type Description
name str

Object identifier referenced by the scene and optimizer.

mesh_path Path | None

Optional triangle mesh file for visualization or sampling.

urdf_path Path | None

Optional URDF describing articulated object geometry.

asset_scale tuple[float, float, float]

Scale applied to asset-local geometry.

visual_parts tuple[ObjectVisualPart, ...]

Optional visual mesh parts with typed materials.

sample_points FloatArray | None

Precomputed asset-local surface points with shape (N, 3).

sample_space ObjectSampleSpace

Coordinate space for sample_points.

trajectory ObjectTrajectory | None

Time-varying object pose track.

qpos_mode ObjectQposMode

Whether the trajectory is appended to qpos or treated as an external scene pose.

provenance dict[str, Any]

Origin and processing history for the object.

Methods:

Name Description
scaled_sample_points

Return object sample points in the active object-local geometry frame.

Attributes

model_config class-attribute instance-attribute

model_config = ConfigDict(arbitrary_types_allowed=True)

name instance-attribute

name: str

mesh_path class-attribute instance-attribute

mesh_path: Path | None = None

urdf_path class-attribute instance-attribute

urdf_path: Path | None = None

asset_scale class-attribute instance-attribute

asset_scale: tuple[float, float, float] = (1.0, 1.0, 1.0)

visual_parts class-attribute instance-attribute

visual_parts: tuple[ObjectVisualPart, ...] = ()

sample_points class-attribute instance-attribute

sample_points: FloatArray | None = None

sample_space class-attribute instance-attribute

sample_space: ObjectSampleSpace = OBJECT_LOCAL

trajectory class-attribute instance-attribute

trajectory: ObjectTrajectory | None = None

qpos_mode class-attribute instance-attribute

qpos_mode: ObjectQposMode = APPENDED

provenance class-attribute instance-attribute

provenance: dict[str, Any] = Field(default_factory=dict)

Functions

scaled_sample_points

scaled_sample_points(default: FloatArray | None = None) -> FloatArray | None

Return object sample points in the active object-local geometry frame.

ObjectTrajectory

Bases: BaseModel

Dynamic object poses over time.

Attributes:

Name Type Description
poses PoseSequence

Per-frame object rigid transform track.

name str

Object label used in scene exports and logs.

Methods:

Name Description
identity

Return an identity object trajectory.

resampled

Return this object trajectory sampled on a new FPS grid.

Attributes

poses instance-attribute

poses: PoseSequence

name class-attribute instance-attribute

name: str = 'object'

Functions

identity classmethod

identity(
    frame_count: int, *, fps: float = 30.0, name: str = "object"
) -> ObjectTrajectory

Return an identity object trajectory.

resampled

resampled(fps: float) -> ObjectTrajectory

Return this object trajectory sampled on a new FPS grid.

TerrainSpec

Bases: BaseModel

Static terrain information.

Attributes:

Name Type Description
name str

Terrain label used in scene exports and logs.

mesh_path Path | None

Optional terrain mesh file.

sample_points FloatArray | None

Precomputed terrain surface points with shape (N, 3).

provenance dict[str, Any]

Origin and processing history for terrain.

Attributes

model_config class-attribute instance-attribute

model_config = ConfigDict(arbitrary_types_allowed=True)

name class-attribute instance-attribute

name: str = 'ground'

mesh_path class-attribute instance-attribute

mesh_path: Path | None = None

sample_points class-attribute instance-attribute

sample_points: FloatArray | None = None

provenance class-attribute instance-attribute

provenance: dict[str, Any] = Field(default_factory=dict)

MotionSequence

Bases: BaseModel, Generic[JointT]

Canonical shared-timeline actor motion with a concrete joint vocabulary.

Attributes:

Name Type Description
name str
joints tuple[JointT, ...]
joint_positions FloatArray
timeline SampleTimeline
root_poses PoseSequence | None
provenance dict[str, Any]

Attributes

name instance-attribute

name: str

joints instance-attribute

joints: tuple[JointT, ...]

joint_positions instance-attribute

joint_positions: FloatArray

timeline instance-attribute

timeline: SampleTimeline

root_poses class-attribute instance-attribute

root_poses: PoseSequence | None = None

provenance class-attribute instance-attribute

provenance: dict[str, Any] = Field(default_factory=dict)

MotionFormatSpec

Bases: BaseModel, Generic[JointT]

Concrete source-motion vocabulary and storage conventions.

Methods:

Name Description
joint_index

Return the index of a typed joint.

Attributes:

Name Type Description
model_config
name str
joint_vocabulary type[JointT]
root_joint JointT
quaternion_order QuaternionOrder
frame_convention FrameConvention
default_fps float
default_height_m float | None
description str
joints tuple[JointT, ...]

Ordered joints declared by this format.

Attributes

model_config class-attribute instance-attribute

model_config = ConfigDict(arbitrary_types_allowed=True)

name instance-attribute

name: str

joint_vocabulary instance-attribute

joint_vocabulary: type[JointT]

root_joint instance-attribute

root_joint: JointT

quaternion_order class-attribute instance-attribute

quaternion_order: QuaternionOrder = WXYZ

frame_convention class-attribute instance-attribute

frame_convention: FrameConvention = Z_UP_RIGHT_HANDED

default_fps class-attribute instance-attribute

default_fps: float = 30.0

default_height_m class-attribute instance-attribute

default_height_m: float | None = None

description class-attribute instance-attribute

description: str = ''

joints property

joints: tuple[JointT, ...]

Ordered joints declared by this format.

Functions

joint_index

joint_index(joint: JointT) -> int

Return the index of a typed joint.

load_motion

load_motion(
    path: str | Path,
    motion_format: MotionFormatKind | MotionFormatSpec,
    *,
    name: str | None = None,
) -> MotionSequence

Load a motion sequence using a registered format and suffix loader.

The returned sequence is converted to :attr:~retarget.core.enums.FrameConvention.Z_UP_RIGHT_HANDED.

Parameters:

Name Type Description Default
path str | Path

Motion file path; the suffix selects the loader.

required
motion_format MotionFormatKind | MotionFormatSpec

Typed registered motion format key or a concrete format specification.

required
name str | None

Optional sequence name; defaults to the file stem.

None

Returns:

Name Type Description
MotionSequence MotionSequence

Parsed motion in Z-up world coordinates.

Raises:

Type Description
KeyError

If the format name or file suffix is not registered.

ValueError

If the file content fails validation.

Robots

RobotSpec

Bases: BaseModel, Generic[JointT, LinkT, GeometryT, RoleT]

Robot description that preserves enum identity until backend compilation.

Methods:

Name Description
joint_index

Return the actuated index for a typed joint.

joint_for_role

Resolve a semantic robot role to an actuated joint.

link_for_role

Resolve a semantic robot role to a link.

links_for_role

Resolve a semantic robot role to one or more links.

qpos_size

Return qpos size for this robot and object setting.

load

Load a robot spec whose config names concrete enum vocabulary classes.

resolve_paths

Return a copy with relative asset paths resolved against base_dir.

save_json

Save a JSON representation with explicit vocabulary references.

limits_array

Return joint limits in joint order.

Attributes:

Name Type Description
model_config
name str
height_m float
vocabulary RobotVocabulary[JointT, LinkT, GeometryT, RoleT]
joints tuple[JointT, ...]
links tuple[LinkT, ...]
contact_links tuple[LinkT, ...]
geometries tuple[GeometryT, ...]
joint_limits dict[JointT, tuple[float, float]]
joint_roles dict[RoleT, JointT]
link_roles dict[RoleT, LinkT]
link_groups dict[RoleT, tuple[LinkT, ...]]
mujoco_body_aliases dict[LinkT, str]
simple_kinematics dict[LinkT, SimpleKinematicPoint[JointT]]
urdf_path Path | None
mujoco_xml_path Path | None
qpos_layout QposLayout
provenance dict[str, Any]
dof int

Number of actuated joints.

Attributes

model_config class-attribute instance-attribute

model_config = ConfigDict(arbitrary_types_allowed=True)

name instance-attribute

name: str

height_m instance-attribute

height_m: float

vocabulary instance-attribute

vocabulary: RobotVocabulary[JointT, LinkT, GeometryT, RoleT]

joints instance-attribute

joints: tuple[JointT, ...]
links: tuple[LinkT, ...]
contact_links: tuple[LinkT, ...] = ()

geometries class-attribute instance-attribute

geometries: tuple[GeometryT, ...] = ()

joint_limits class-attribute instance-attribute

joint_limits: dict[JointT, tuple[float, float]] = Field(default_factory=dict)

joint_roles class-attribute instance-attribute

joint_roles: dict[RoleT, JointT] = Field(default_factory=dict)
link_roles: dict[RoleT, LinkT] = Field(default_factory=dict)
link_groups: dict[RoleT, tuple[LinkT, ...]] = Field(default_factory=dict)

mujoco_body_aliases class-attribute instance-attribute

mujoco_body_aliases: dict[LinkT, str] = Field(default_factory=dict)

simple_kinematics class-attribute instance-attribute

simple_kinematics: dict[LinkT, SimpleKinematicPoint[JointT]] = Field(
    default_factory=dict
)

urdf_path class-attribute instance-attribute

urdf_path: Path | None = None

mujoco_xml_path class-attribute instance-attribute

mujoco_xml_path: Path | None = None

qpos_layout class-attribute instance-attribute

qpos_layout: QposLayout = Field(default_factory=QposLayout)

provenance class-attribute instance-attribute

provenance: dict[str, Any] = Field(default_factory=dict)

dof property

dof: int

Number of actuated joints.

Functions

joint_index

joint_index(joint: JointT) -> int

Return the actuated index for a typed joint.

joint_for_role

joint_for_role(role: RoleT) -> JointT

Resolve a semantic robot role to an actuated joint.

link_for_role(role: RoleT) -> LinkT

Resolve a semantic robot role to a link.

links_for_role(role: RoleT) -> tuple[LinkT, ...]

Resolve a semantic robot role to one or more links.

qpos_size

qpos_size(*, has_object: bool = False) -> int

Return qpos size for this robot and object setting.

load classmethod

load(path: str | Path) -> RobotSpec[Any, Any, Any, Any]

Load a robot spec whose config names concrete enum vocabulary classes.

resolve_paths

resolve_paths(base_dir: str | Path) -> RobotSpec[JointT, LinkT, GeometryT, RoleT]

Return a copy with relative asset paths resolved against base_dir.

save_json

save_json(path: str | Path) -> Path

Save a JSON representation with explicit vocabulary references.

limits_array

limits_array() -> tuple[list[float], list[float]]

Return joint limits in joint order.

JointLimit

Bases: BaseModel, Generic[JointT]

Position bounds for one typed actuated joint.

Attributes:

Name Type Description
joint JointT
lower float
upper float

Attributes

joint instance-attribute

joint: JointT

lower instance-attribute

lower: float

upper instance-attribute

upper: float

QposLayout

Bases: BaseModel

Convention for serialized qpos vectors.

Methods:

Name Description
qpos_size

Return qpos size for this layout.

joint_slice

Return the slice containing actuated robot joints.

object_slice

Return the slice containing an appended object pose.

Attributes:

Name Type Description
root_position tuple[int, int]
root_quaternion tuple[int, int]
joint_start int
object_pose_size int

Attributes

root_position class-attribute instance-attribute

root_position: tuple[int, int] = (0, 3)

root_quaternion class-attribute instance-attribute

root_quaternion: tuple[int, int] = (3, 7)

joint_start class-attribute instance-attribute

joint_start: int = 7

object_pose_size class-attribute instance-attribute

object_pose_size: int = 7

Functions

qpos_size

qpos_size(robot_dof: int, *, has_object: bool = False) -> int

Return qpos size for this layout.

joint_slice

joint_slice(robot_dof: int) -> slice

Return the slice containing actuated robot joints.

object_slice

object_slice(robot_dof: int) -> slice

Return the slice containing an appended object pose.

Mesh

InteractionMeshBuilder

InteractionMeshBuilder(
    spec: InteractionMeshSpec | None = None,
    *,
    topology: MeshTopology | str | None = None,
    k_neighbors: int | None = None,
)

Build an interaction mesh from human and object/terrain points.

Parameters:

Name Type Description Default
spec InteractionMeshSpec | None

Full mesh configuration; mutually exclusive with keyword overrides.

None
topology MeshTopology | str | None

Override topology when spec is omitted.

None
k_neighbors int | None

Neighbor count for K_NEAREST topology.

None

Raises: ValueError: If spec is combined with explicit mesh keyword options.

Methods:

Name Description
build

Build an interaction mesh from human and optional environment points.

Attributes:

Name Type Description
spec

Attributes

spec instance-attribute

spec = InteractionMeshSpec(
    topology=resolved_topology,
    k_neighbors=k_neighbors if k_neighbors is not None else 4,
)

Functions

build

build(
    human_points: FloatArray, environment_points: FloatArray | None = None
) -> InteractionMesh

Build an interaction mesh from human and optional environment points.

Parameters:

Name Type Description Default
human_points FloatArray

Body or joint sample sites with shape (N, 3).

required
environment_points FloatArray | None

Object or terrain sites stacked after human points.

None

Returns:

Name Type Description
InteractionMesh InteractionMesh

Combined vertex set and simplex connectivity.

Raises:

Type Description
ValueError

If point arrays have invalid rank or shape.

InteractionMeshSpec

Bases: BaseModel

Configuration for interaction mesh construction.

Attributes:

Name Type Description
topology MeshTopology

Graph construction policy.

k_neighbors int

Neighbor count when topology is K_NEAREST or Delaunay fallback.

laplacian_weighting LaplacianWeighting

Neighbor weighting used by Laplacian objectives.

laplacian_epsilon float

Small positive value used by distance-weighted Laplacians.

Attributes

model_config class-attribute instance-attribute

model_config = ConfigDict(extra='forbid')

topology class-attribute instance-attribute

topology: MeshTopology = DELAUNAY

k_neighbors class-attribute instance-attribute

k_neighbors: int = 4

laplacian_weighting class-attribute instance-attribute

laplacian_weighting: LaplacianWeighting = UNIFORM

laplacian_epsilon class-attribute instance-attribute

laplacian_epsilon: float = 1e-06

MeshTopology

Bases: StrEnum

Interaction mesh topology policy.

Attributes:

Name Type Description
DELAUNAY str

Delaunay triangulation over mesh sites.

CHAIN str

Open chain along ordered sites.

COMPLETE str

Fully connected graph.

K_NEAREST str

k-nearest-neighbor edges (uses k_neighbors).

DELAUNAY member

DELAUNAY = 'delaunay'

CHAIN member

CHAIN = 'chain'

COMPLETE member

COMPLETE = 'complete'

K_NEAREST member

K_NEAREST = 'k_nearest'