Full reference¶
Complete API for the retarget package (all public members). For a guided tour, start with the overview.
Public API for the retarget research toolkit.
Modules:
| Name | Description |
|---|---|
assets |
Asset manifests and stores. |
capture |
Typed native recordings and capture processing. |
cli |
CLI package. |
core |
Core primitives shared across retarget. |
export |
Export utilities. |
kinematics |
Kinematics backends. |
mesh |
Mesh utilities. |
metrics |
Evaluation metrics. |
motion |
Motion specs, registries, and loaders. |
observation |
Target-independent scene observations. |
optimization |
Optimization models and solvers. |
pipeline |
Retargeting pipeline. |
recipes |
Built-in observation and retargeting recipes. |
results |
Result schemas. |
robots |
Robot specs and registry. |
scene |
Scene configuration. |
visualization |
Visualization adapters. |
Classes:
| Name | Description |
|---|---|
AssetInstallManifest |
Human-editable manifest describing assets to install or reference. |
AssetManifest |
Collection of asset records. |
AssetRecord |
One tracked asset. |
AssetRequirement |
One asset declared by a human-editable install manifest. |
AssetStore |
Local manifest-backed asset store. |
AlignmentError |
Registration failure carrying the rejected quality report. |
AlignmentReport |
Quality report for one temporal or spatial registration. |
CategoricalTrack |
A named categorical sequence sampled by nearest neighbor. |
ClockTransform |
Affine mapping from a native clock into an observation clock. |
GvhmrEstimator |
Run a configured local GVHMR checkout in an ephemeral workspace. |
GvhmrOutputSource |
Load existing GVHMR arrays as a native human-pose recording. |
HumanPoseEstimator |
Estimate a typed human-pose recording from video. |
HumanPoseRecording |
Estimated or measured human pose in one native clock. |
HumanPoseSourceSchema |
Map semantic motion-joint vocabularies to source array columns. |
InMemorySource |
Source returning an already constructed recording. |
JointTrack |
A native or estimated human-joint trajectory. |
MarkerTrack |
A native motion-capture marker trajectory. |
MocapRecording |
Joints, rigid bodies, and markers sampled in one native mocap clock. |
ObservationSource |
Load one native recording without creating a shared timeline. |
PointTrack |
A named 3D point trajectory. |
PoseTrack |
A named rigid-body pose trajectory. |
RigidBodyTrack |
A native motion-capture rigid-body trajectory. |
RigidTransform |
Rigid point transform |
SampleTimeline |
Strictly increasing sample timestamps in one recording's native clock. |
TemporalRegistrationConfig |
Quality and search policy for offset registration. |
ViconBagSource |
Read a ROS 2 Vicon bag directly into a native mocap recording. |
ViconBagTopics |
ROS topics carrying Vicon rigid-body transforms and marker samples. |
ViconRecordingSource |
Load a preconverted Vicon recording directly into typed tracks. |
ViconSourceSchema |
Map Vicon table names into typed native vocabularies. |
VideoPoseSource |
Compose a video recording source with a pose estimator. |
VideoRecording |
A video stream and its native frame timeline. |
AssetKind |
Types of assets tracked by an asset manifest. |
Constraint |
Built-in constraint term registry keys. |
ConstraintKind |
Base enum for constraint registrations. |
ContactLayerKind |
Persisted contact layer storage kind. |
ContactPatch |
Base enum for contact patch labels. |
ContactState |
Base enum for symbolic contact state labels. |
ContactSubject |
Base enum for contact subjects such as feet, shoes, or hands. |
ConvergenceMode |
SQP inner-loop convergence policy. |
CropPolicy |
How a shared observation timeline handles source support. |
ExporterKind |
Base enum for exporter registrations. |
ExportFormat |
Built-in exporter registry keys. |
FrameConvention |
Coordinate frame conventions understood by the package. |
HumanoidRobotRole |
Standard semantic roles exposed by humanoid robot specs. |
KinematicsBackendName |
Built-in kinematics backend registry keys. |
KinematicsKind |
Base enum for kinematics-backend registrations. |
MetricKind |
Base enum for metric registrations. |
MetricName |
Built-in evaluation metric names. |
MocapMarker |
Base enum for native motion-capture marker names. |
MocapRigidBody |
Base enum for native motion-capture rigid-body names. |
MotionFormat |
Built-in motion format registry keys. |
MotionFormatKind |
Base enum for motion-format registrations. |
MotionJoint |
Base enum for source motion joint names. |
MotionLoaderKind |
Base enum for motion-loader registrations. |
MotionLoaderSuffix |
Built-in motion loader suffix registry keys. |
NameEnum |
Base class for user-defined symbolic vocabularies. |
NominalFallback |
Fallback target for nominal qpos tracking. |
NonPenetrationSource |
Sources used by the non-penetration constraint. |
Objective |
Built-in objective term registry keys. |
ObjectiveKind |
Base enum for objective registrations. |
ObjectQposMode |
How a dynamic object trajectory participates in qpos. |
ObjectSampleSpace |
Coordinate space for object sample points. |
ObservationRecipeKind |
Built-in observation-recipe kinds for declarative run configs. |
ObservationRecipeKindBase |
Base enum for observation-recipe registrations. |
ObservationRole |
Base enum for target-independent semantic observation roles. |
QposVariableKind |
Which qpos coordinates the optimizer may change. |
QuaternionOrder |
Quaternion storage order. |
RetargetEnum |
Base class for string-valued retarget enums. |
RetargetingRecipeKind |
Built-in robot-adaptation recipe kinds for declarative run configs. |
RetargetingRecipeKindBase |
Base enum for retargeting-recipe registrations. |
Robot |
Built-in robot registry keys. |
RobotGeometry |
Base enum for robot collision and visual geometry names. |
RobotJoint |
Base enum for robot joint names. |
RobotKind |
Base enum for robot registrations. |
RobotLink |
Base enum for robot link names. |
RobotProviderKind |
Base enum for robot-provider registrations. |
RobotProviderName |
Built-in robot provider registry keys. |
RobotRole |
Base enum for semantic roles resolved by a robot specification. |
RunStatus |
Retargeting or evaluation lifecycle state. |
SceneGeometry |
Base enum for target-independent scene geometry groups. |
SolverBackend |
Optimization backend choices. |
SolverKind |
Base enum for solver registrations. |
TaskKind |
Supported high-level retargeting workflows. |
TimelineSelection |
Native timeline selected as the observation sampling grid. |
VisualizerKind |
Base enum for visualizer registrations. |
VisualizerName |
Built-in visualizer registry keys. |
Pose |
Rigid transform from a local frame into a named world convention. |
PoseSequence |
Time-indexed sequence of poses. |
ConstraintTerm |
Optimization constraint term. |
Exporter |
Export a retargeting result to an external workflow format. |
KinematicsBackend |
Robot kinematics operations needed by retargeting and metrics. |
Metric |
Evaluate one metric. |
MotionLoader |
Load a motion file into a |
ObjectiveTerm |
Optimization objective term. |
RobotProvider |
Resolve robot specs from names or external asset locations. |
Solver |
Solve a quadratic retargeting subproblem. |
Visualizer |
Render or summarize a retargeting result. |
ExportResult |
Summary of an export operation. |
ExportSpec |
Configuration for exporting a retargeting result. |
GeometryDistance |
Signed or unsigned distance between two geometry-like objects. |
GeometryDistanceJacobian |
Linearized distance row for a geometry pair. |
InteractionMeshBuilder |
Build an interaction mesh from human and object/terrain points. |
InteractionMeshSpec |
Configuration for interaction mesh construction. |
LaplacianWeighting |
Neighbor weighting policy for Laplacian coordinates. |
MeshTopology |
Interaction mesh topology policy. |
ContactFrame |
Per-frame view of a :class: |
ContactPlan |
Typed contact states and support geometry for a retargeting problem. |
ContactTrack |
One semantic subject's typed contact state over time. |
LafanMotionJoint |
|
LinkTargetPlan |
Validated frame-aligned targets using one robot-link vocabulary. |
LinkTargetSample |
One active typed robot-link target at one frame. |
LinkTargetTrack |
World-space target trajectory for one typed robot link. |
MinimalMotionJoint |
|
MocapMotionJoint |
|
NominalQposFrame |
Per-frame view of a nominal qpos trajectory. |
NominalQposPlan |
Frame-aligned nominal generalized-coordinate trajectory. |
SmplhMotionJoint |
|
SmplxMotionJoint |
|
SupportPlane |
Planar support surface used by contact-aware terms. |
TargetFrame |
Per-frame view of link targets. |
MotionFormatSpec |
Concrete source-motion vocabulary and storage conventions. |
MotionSequence |
Canonical shared-timeline actor motion with a concrete joint vocabulary. |
FootSupportClassificationConfig |
Thresholds for ground and moving-object foot support. |
FootSupportStates |
Typed categorical values emitted by support classification. |
ObservedObject |
Observed object geometry and pose, independent of a target robot. |
SceneObservation |
Shared-timeline result of capture processing before robot adaptation. |
SemanticContactSequence |
Robot-independent semantic contacts and support geometry. |
SemanticContactTrack |
Categorical contact state for one observed subject and patch. |
ConstraintContribution |
Bounds and linear constraints from one constraint term. |
ObjectiveContribution |
Least-squares contribution from one objective term. |
TermContext |
Per-frame data available to objective and constraint terms. |
ConstraintConfig |
Base class for constraint configs keyed by an extensible enum member. |
DiagonalRegularizationObjectiveConfig |
Penalize selected qpos variables toward zero with diagonal weights. |
FootLockConstraintConfig |
Pin exact typed support links or subjects during configured windows. |
FootStickingConstraintConfig |
Constrain active support links near their previous tangent-plane position. |
JointLimitsConstraintConfig |
Box limits on actuated joints. |
LaplacianObjectiveConfig |
Interaction-mesh Laplacian deformation objective. |
LinkTrackingObjectiveConfig |
Track robot links to a typed target plan. |
NominalTrackingObjectiveConfig |
Track a nominal posture for typed robot joints or explicit qpos coordinates. |
NonPenetrationConstraintConfig |
Separate selected typed robot links from support and explicit geometry. |
ObjectiveConfig |
Base class for objective configs keyed by an extensible enum member. |
OptimizationProfile |
Reusable typed objective/constraint composition. |
SelfCollisionConstraintConfig |
Maintain minimum separation between explicit typed robot geometry pairs. |
SmoothnessObjectiveConfig |
Penalize changes from the previous frame. |
SolverSpec |
Solver selection and common options. |
TrustRegionConstraintConfig |
Cap the Euclidean norm of each SQP update. |
QposVariableSpec |
Configuration describing which qpos coordinates the optimizer may change. |
ResolvedQposVariables |
Resolved qpos coordinates used as one SQP subproblem variable. |
BatchJob |
One retargeting job in a batch run. |
BatchManifest |
Manifest written by resumable batch runs. |
BatchRunner |
Execute jobs with resume-aware manifest updates. |
BatchRunRecord |
Recorded outcome for one batch job. |
InteractionMeshRetargetingEngine |
Backend-agnostic interaction-mesh SQP retargeter. |
RetargetingExperiment |
Compose observation processing, robot adaptation, and optimization. |
RetargetingProblem |
Complete typed run specification before backend compilation. |
ObservationRecipe |
Process native recordings into a target-independent observation. |
RetargetingRecipe |
Adapt a scene observation to one target robot. |
SceneRecipe |
Build target-independent runtime scene data from an observation. |
Retargeter |
Run a |
MotionFileObservationRecipe |
Load a registered motion file into a typed scene observation. |
RobotOnlySceneRecipe |
Build a flat-ground robot-only scene. |
RoleRetargetingRecipe |
Resolve typed motion joints through semantic robot roles. |
StaticSceneRecipe |
Return a predeclared target-independent scene specification. |
EvaluationManifest |
Manifest written by batch evaluation runs. |
EvaluationRecord |
Recorded outcome for evaluating one retargeting result. |
EvaluationReport |
Evaluation metrics for a result. |
RetargetingResult |
Strict pickle-free retargeting checkpoint. |
JointLimit |
Position bounds for one typed actuated joint. |
QposLayout |
Convention for serialized qpos vectors. |
RobotSpec |
Robot description that preserves enum identity until backend compilation. |
RobotVocabulary |
Concrete enum classes used by one robot specification. |
SimpleKinematicPoint |
Explicit fixture kinematics for one robot link. |
ObjectSpec |
Object asset and sampling information. |
ObjectTrajectory |
Dynamic object poses over time. |
ObjectVisualPart |
A renderable object mesh part with optional material styling. |
SceneSpec |
Scene configuration for a retargeting run. |
TerrainSpec |
Static terrain information. |
Functions:
| Name | Description |
|---|---|
estimate_clock_offset |
Estimate an offset mapping |
register_rigid_points |
Estimate a Kabsch rigid transform from corresponding finite points. |
convert_points_frame |
Convert point coordinates between supported right-handed frame conventions. |
frame_transform_matrix |
Return the rotation matrix that maps coordinates from |
reorder_quaternion |
Convert quaternion storage order without changing the represented rotation. |
reorder_quaternions |
Convert quaternion storage order along one array axis. |
resample_linear |
Linearly resample an array whose first axis is time. |
resampling_times |
Return source and target sample times for endpoint-preserving interpolation. |
sample_mesh_points |
Return deterministic surface samples for a mesh file. |
classify_foot_support |
Classify feet as air, ground, or supported by an observed object. |
Attributes:
| Name | Type | Description |
|---|---|---|
exporters |
Registry[ExporterKind, Exporter]
|
|
kinematics_backends |
Registry[KinematicsKind, KinematicsBackendFactory]
|
Registry of kinematics backend factories keyed by backend name. |
motion_formats |
Registry[MotionFormatKind, MotionFormatSpec]
|
Registry of built-in :class: |
motion_loaders |
Registry[MotionLoaderKind, MotionLoader]
|
Registry of file-suffix :class: |
constraint_terms |
Registry[ConstraintKind, ConstraintTerm[Any]]
|
Registry of built-in and user-registered constraint terms keyed by name. |
objective_terms |
Registry[ObjectiveKind, ObjectiveTerm[Any]]
|
Registry of built-in and user-registered objective terms keyed by name. |
solver_factories |
Registry[SolverKind, SolverFactory]
|
Registry of solver factories keyed by :class: |
ConstraintConfigUnion |
TypeAlias
|
|
ObjectiveConfigUnion |
TypeAlias
|
|
robot_providers |
Registry[RobotProviderKind, RobotProvider]
|
|
Attributes¶
exporters
module-attribute
¶
exporters: Registry[ExporterKind, Exporter] = Registry(
"exporter", ExporterKind, decorator_transform=_exporter_from_decorator
)
kinematics_backends
module-attribute
¶
kinematics_backends: Registry[KinematicsKind, KinematicsBackendFactory] = Registry(
"kinematics backend", KinematicsKind
)
Registry of kinematics backend factories keyed by backend name.
motion_formats
module-attribute
¶
motion_formats: Registry[MotionFormatKind, MotionFormatSpec] = Registry(
"motion format", MotionFormatKind, decorator_transform=_motion_format_from_decorator
)
Registry of built-in :class:~retarget.motion.spec.MotionFormatSpec entries.
motion_loaders
module-attribute
¶
motion_loaders: Registry[MotionLoaderKind, MotionLoader] = Registry(
"motion loader", MotionLoaderKind, decorator_transform=_motion_loader_from_decorator
)
Registry of file-suffix :class:~retarget.core.protocols.MotionLoader implementations.
constraint_terms
module-attribute
¶
constraint_terms: Registry[ConstraintKind, ConstraintTerm[Any]] = Registry(
"constraint term",
ConstraintKind,
decorator_transform=_constraint_term_from_decorator,
)
Registry of built-in and user-registered constraint terms keyed by name.
objective_terms
module-attribute
¶
objective_terms: Registry[ObjectiveKind, ObjectiveTerm[Any]] = Registry(
"objective term", ObjectiveKind, decorator_transform=_objective_term_from_decorator
)
Registry of built-in and user-registered objective terms keyed by name.
solver_factories
module-attribute
¶
solver_factories: Registry[SolverKind, SolverFactory] = Registry(
"solver factory", SolverKind
)
Registry of solver factories keyed by :class:~retarget.core.enums.SolverBackend name.
ConstraintConfigUnion
module-attribute
¶
ConstraintConfigUnion: TypeAlias = (
JointLimitsConstraintConfig
| TrustRegionConstraintConfig
| FootStickingConstraintConfig
| FootLockConstraintConfig
| NonPenetrationConstraintConfig
| SelfCollisionConstraintConfig
)
ObjectiveConfigUnion
module-attribute
¶
ObjectiveConfigUnion: TypeAlias = (
LaplacianObjectiveConfig
| LinkTrackingObjectiveConfig
| SmoothnessObjectiveConfig
| NominalTrackingObjectiveConfig
| DiagonalRegularizationObjectiveConfig
)
robot_providers
module-attribute
¶
robot_providers: Registry[RobotProviderKind, RobotProvider] = Registry(
"robot provider",
RobotProviderKind,
decorator_transform=_robot_provider_from_decorator,
)
Classes¶
AssetInstallManifest
¶
Bases: BaseModel
Human-editable manifest describing assets to install or reference.
Attributes:
| Name | Type | Description |
|---|---|---|
schema_version |
int
|
Manifest format version (default |
assets |
tuple[AssetRequirement, ...]
|
Assets to install or reference. |
provenance |
dict[str, Any]
|
Origin and processing history for the manifest. |
Methods:
| Name | Description |
|---|---|
load |
Load a TOML, YAML, or JSON install manifest. |
resolve_sources |
Return a copy with local relative sources resolved. |
Attributes¶
provenance
class-attribute
instance-attribute
¶
provenance: dict[str, Any] = Field(default_factory=dict)
Functions¶
load
classmethod
¶
load(path: str | Path) -> AssetInstallManifest
Load a TOML, YAML, or JSON install manifest.
resolve_sources
¶
resolve_sources(base_dir: Path) -> AssetInstallManifest
Return a copy with local relative sources resolved.
AssetManifest
¶
Bases: BaseModel
Collection of asset records.
Attributes:
| Name | Type | Description |
|---|---|---|
records |
list[AssetRecord]
|
Installed or referenced assets tracked by the store. |
Methods:
| Name | Description |
|---|---|
find |
Return the first record by name. |
Attributes¶
records
class-attribute
instance-attribute
¶
records: list[AssetRecord] = Field(default_factory=list)
Functions¶
AssetRecord
¶
Bases: BaseModel
One tracked asset.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Unique asset name in the store manifest. |
kind |
AssetKind
|
Asset category (robot, object, terrain, motion, fixture). |
path |
Path
|
Resolved on-disk path to the asset file or directory. |
source |
str | None
|
Original import path or download URL, if recorded. |
sha256 |
str | None
|
Expected or verified SHA-256 hex digest for file assets. |
license |
str | None
|
SPDX identifier or short license note. |
notice |
str | None
|
Attribution or NOTICE text. |
installed_at |
datetime | None
|
UTC timestamp when the asset was registered or installed. |
provenance |
dict[str, Any]
|
Origin and processing history for the asset. |
AssetRequirement
¶
Bases: BaseModel
One asset declared by a human-editable install manifest.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Asset name to register in the store. |
kind |
AssetKind
|
Asset category (robot, object, terrain, motion, fixture). |
source |
str
|
Local path or HTTP(S) URL to fetch or reference. |
copy_to_store |
bool
|
When |
destination |
Path | None
|
Optional store-relative or absolute install path. |
sha256 |
str | None
|
Expected SHA-256 hex digest for file assets. |
license |
str | None
|
SPDX identifier or short license note. |
notice |
str | None
|
Attribution or NOTICE text. |
provenance |
dict[str, Any]
|
Origin and processing history supplied by the manifest. |
Methods:
| Name | Description |
|---|---|
resolve_source |
Resolve local relative sources against a manifest directory. |
Attributes¶
copy_to_store
class-attribute
instance-attribute
¶
copy_to_store: bool = Field(default=False, alias='copy')
provenance
class-attribute
instance-attribute
¶
provenance: dict[str, Any] = Field(default_factory=dict)
Functions¶
resolve_source
¶
resolve_source(base_dir: Path) -> AssetRequirement
Resolve local relative sources against a manifest directory.
AssetStore
¶
AssetStore(root: str | Path = '.retarget_assets')
Local manifest-backed asset store.
Methods:
| Name | Description |
|---|---|
load |
Load manifest, returning an empty manifest if none exists. |
save |
Persist manifest. |
list |
List tracked assets. |
import_path |
Track or copy an asset path into the store. |
install |
Install or reference one manifest requirement. |
install_manifest |
Install every asset in a manifest. |
Attributes:
| Name | Type | Description |
|---|---|---|
root |
|
|
manifest_path |
|
Attributes¶
Functions¶
import_path
¶
import_path(
source: str | Path,
*,
name: str,
kind: AssetKind,
copy: bool = False,
target_path: str | Path | None = None,
sha256: str | None = None,
license: str | None = None,
notice: str | None = None,
provenance: dict[str, Any] | None = None,
) -> AssetRecord
Track or copy an asset path into the store.
install
¶
install(requirement: AssetRequirement, *, allow_downloads: bool = False) -> AssetRecord
Install or reference one manifest requirement.
install_manifest
¶
install_manifest(
manifest: AssetInstallManifest | str | Path, *, allow_downloads: bool = False
) -> list[AssetRecord]
Install every asset in a manifest.
AlignmentError
¶
AlignmentError(message: str, report: AlignmentReport)
AlignmentReport
dataclass
¶
AlignmentReport(
strategy: str,
accepted: bool,
score: float,
sample_count: int,
overlap_s: float | None = None,
clock_transform: ClockTransform | None = None,
rms_error: float | None = None,
diagnostics: dict[str, object] = dict(),
)
Quality report for one temporal or spatial registration.
Attributes:
| Name | Type | Description |
|---|---|---|
strategy |
str
|
|
accepted |
bool
|
|
score |
float
|
|
sample_count |
int
|
|
overlap_s |
float | None
|
|
clock_transform |
ClockTransform | None
|
|
rms_error |
float | None
|
|
diagnostics |
dict[str, object]
|
|
CategoricalTrack
dataclass
¶
CategoricalTrack(
role: NameEnum,
values: tuple[NameEnum, ...],
validity: ndarray | None = None,
provenance: dict[str, object] | None = None,
)
A named categorical sequence sampled by nearest neighbor.
Methods:
| Name | Description |
|---|---|
resample |
Sample this track at the nearest native timestamp. |
Attributes:
| Name | Type | Description |
|---|---|---|
role |
NameEnum
|
|
values |
tuple[NameEnum, ...]
|
|
validity |
ndarray | None
|
|
provenance |
dict[str, object] | None
|
|
sample_count |
int
|
Number of samples. |
Attributes¶
Functions¶
resample
¶
resample(
source: SampleTimeline,
target: SampleTimeline,
*,
clock: ClockTransform | None = None,
) -> Self
Sample this track at the nearest native timestamp.
ClockTransform
dataclass
¶
ClockTransform(
scale: float = 1.0,
offset_s: float = 0.0,
source_clock: str = "native",
target_clock: str = "observation",
)
Affine mapping from a native clock into an observation clock.
The mapping is observation_time = scale * native_time + offset_s.
Methods:
| Name | Description |
|---|---|
apply |
Map timestamps into the target clock. |
timeline |
Map a complete timeline into the target clock. |
inverse |
Return the inverse clock mapping. |
Attributes:
| Name | Type | Description |
|---|---|---|
scale |
float
|
|
offset_s |
float
|
|
source_clock |
str
|
|
target_clock |
str
|
|
Attributes¶
Functions¶
timeline
¶
timeline(timeline: SampleTimeline) -> SampleTimeline
Map a complete timeline into the target clock.
GvhmrEstimator
dataclass
¶
GvhmrEstimator(
checkout: Path,
command: tuple[str, ...],
schema: HumanPoseSourceSchema,
fps: float,
frame: FrameConvention = Y_UP_RIGHT_HANDED,
source_height_m: float | None = None,
)
Run a configured local GVHMR checkout in an ephemeral workspace.
Command entries may contain {video}, {workspace}, {output}, and
{checkout} placeholders. The configured command must write
joints.npy into {output}.
Methods:
| Name | Description |
|---|---|
estimate |
Run GVHMR and load its output before deleting temporary files. |
Attributes:
| Name | Type | Description |
|---|---|---|
checkout |
Path
|
|
command |
tuple[str, ...]
|
|
schema |
HumanPoseSourceSchema
|
|
fps |
float
|
|
frame |
FrameConvention
|
|
source_height_m |
float | None
|
|
Attributes¶
Functions¶
estimate
¶
estimate(recording: VideoRecording) -> HumanPoseRecording
Run GVHMR and load its output before deleting temporary files.
GvhmrOutputSource
dataclass
¶
GvhmrOutputSource(
path: Path,
schema: HumanPoseSourceSchema,
fps: float,
frame: FrameConvention = Y_UP_RIGHT_HANDED,
name: str = "",
source_height_m: float | None = None,
load_vertices: bool = False,
)
Load existing GVHMR arrays as a native human-pose recording.
Methods:
| Name | Description |
|---|---|
load |
Load GVHMR joint output without creating a synchronized file. |
Attributes:
| Name | Type | Description |
|---|---|---|
path |
Path
|
|
schema |
HumanPoseSourceSchema
|
|
fps |
float
|
|
frame |
FrameConvention
|
|
name |
str
|
|
source_height_m |
float | None
|
|
load_vertices |
bool
|
|
HumanPoseEstimator
¶
HumanPoseRecording
dataclass
¶
HumanPoseRecording(
name: str,
timeline: SampleTimeline,
frame: FrameConvention,
joints: tuple[JointTrack, ...],
root_pose: PoseTrack | None = None,
source_height_m: float | None = None,
vertices: FloatArray | None = None,
provenance: dict[str, object] | None = None,
)
Estimated or measured human pose in one native clock.
Methods:
| Name | Description |
|---|---|
joint |
Return one joint track. |
to_motion_sequence |
Materialize the canonical shared-timeline actor motion after fusion. |
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
|
timeline |
SampleTimeline
|
|
frame |
FrameConvention
|
|
joints |
tuple[JointTrack, ...]
|
|
root_pose |
PoseTrack | None
|
|
source_height_m |
float | None
|
|
vertices |
FloatArray | None
|
|
provenance |
dict[str, object] | None
|
|
joint_roles |
tuple[NameEnum, ...]
|
Ordered joint vocabulary. |
Attributes¶
Functions¶
to_motion_sequence
¶
to_motion_sequence(root_joint: MotionJoint) -> MotionSequence[MotionJoint]
Materialize the canonical shared-timeline actor motion after fusion.
HumanPoseSourceSchema
dataclass
¶
HumanPoseSourceSchema(joint_indices: Mapping[MotionJoint, int])
Map semantic motion-joint vocabularies to source array columns.
Attributes:
| Name | Type | Description |
|---|---|---|
joint_indices |
Mapping[MotionJoint, int]
|
|
Attributes¶
InMemorySource
dataclass
¶
InMemorySource(recording: RecordingT)
JointTrack
dataclass
¶
JointTrack(
role: NameEnum,
values: FloatArray,
validity: ndarray | None = None,
provenance: dict[str, object] | None = None,
)
MarkerTrack
dataclass
¶
MarkerTrack(
role: NameEnum,
values: FloatArray,
validity: ndarray | None = None,
provenance: dict[str, object] | None = None,
)
MocapRecording
dataclass
¶
MocapRecording(
name: str,
timeline: SampleTimeline,
frame: FrameConvention,
joints: tuple[JointTrack, ...] = (),
rigid_bodies: tuple[RigidBodyTrack, ...] = (),
markers: tuple[MarkerTrack, ...] = (),
provenance: dict[str, object] | None = None,
)
Joints, rigid bodies, and markers sampled in one native mocap clock.
Methods:
| Name | Description |
|---|---|
rigid_body |
Return one rigid-body track. |
joint |
Return one mocap joint track. |
marker |
Return one marker track. |
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
|
timeline |
SampleTimeline
|
|
frame |
FrameConvention
|
|
joints |
tuple[JointTrack, ...]
|
|
rigid_bodies |
tuple[RigidBodyTrack, ...]
|
|
markers |
tuple[MarkerTrack, ...]
|
|
provenance |
dict[str, object] | None
|
|
ObservationSource
¶
PointTrack
dataclass
¶
PointTrack(
role: NameEnum,
values: FloatArray,
validity: ndarray | None = None,
provenance: dict[str, object] | None = None,
)
A named 3D point trajectory.
Methods:
| Name | Description |
|---|---|
resample |
Linearly interpolate this track onto |
Attributes:
| Name | Type | Description |
|---|---|---|
role |
NameEnum
|
|
values |
FloatArray
|
|
validity |
ndarray | None
|
|
provenance |
dict[str, object] | None
|
|
sample_count |
int
|
Number of samples. |
Attributes¶
Functions¶
resample
¶
resample(
source: SampleTimeline,
target: SampleTimeline,
*,
clock: ClockTransform | None = None,
) -> Self
Linearly interpolate this track onto target.
PoseTrack
dataclass
¶
PoseTrack(
role: NameEnum,
positions: FloatArray,
quaternions: FloatArray,
quaternion_order: QuaternionOrder = WXYZ,
validity: ndarray | None = None,
provenance: dict[str, object] | None = None,
)
A named rigid-body pose trajectory.
Methods:
| Name | Description |
|---|---|
resample |
Linearly interpolate translation and SLERP orientation. |
Attributes:
| Name | Type | Description |
|---|---|---|
role |
NameEnum
|
|
positions |
FloatArray
|
|
quaternions |
FloatArray
|
|
quaternion_order |
QuaternionOrder
|
|
validity |
ndarray | None
|
|
provenance |
dict[str, object] | None
|
|
sample_count |
int
|
Number of samples. |
Attributes¶
Functions¶
resample
¶
resample(
source: SampleTimeline,
target: SampleTimeline,
*,
clock: ClockTransform | None = None,
) -> Self
Linearly interpolate translation and SLERP orientation.
RigidBodyTrack
dataclass
¶
RigidBodyTrack(
role: NameEnum,
positions: FloatArray,
quaternions: FloatArray,
quaternion_order: QuaternionOrder = WXYZ,
validity: ndarray | None = None,
provenance: dict[str, object] | None = None,
)
RigidTransform
dataclass
¶
RigidTransform(rotation: FloatArray, translation: FloatArray)
Rigid point transform target = source @ rotation.T + translation.
Methods:
| Name | Description |
|---|---|
apply |
Transform points with trailing dimension 3. |
Attributes:
| Name | Type | Description |
|---|---|---|
rotation |
FloatArray
|
|
translation |
FloatArray
|
|
SampleTimeline
dataclass
¶
SampleTimeline(timestamps: FloatArray, clock: str = 'native')
Strictly increasing sample timestamps in one recording's native clock.
Methods:
| Name | Description |
|---|---|
uniform |
Create a uniform timeline. |
slice |
Return a timeline subset. |
Attributes:
| Name | Type | Description |
|---|---|---|
timestamps |
FloatArray
|
|
clock |
str
|
|
sample_count |
int
|
Number of timestamps. |
start_s |
float
|
First timestamp. |
end_s |
float
|
Last timestamp. |
duration_s |
float
|
Duration between first and last timestamps. |
nominal_fps |
float | None
|
Median sampling rate, or |
Attributes¶
Functions¶
uniform
classmethod
¶
uniform(
sample_count: int, fps: float, *, start_s: float = 0.0, clock: str = "native"
) -> SampleTimeline
Create a uniform timeline.
TemporalRegistrationConfig
dataclass
¶
TemporalRegistrationConfig(
max_abs_offset_s: float,
min_overlap_s: float = 0.5,
minimum_score: float = 0.2,
coarse_steps: int = 1001,
activity_weighted: bool = True,
)
Quality and search policy for offset registration.
Attributes:
| Name | Type | Description |
|---|---|---|
max_abs_offset_s |
float
|
|
min_overlap_s |
float
|
|
minimum_score |
float
|
|
coarse_steps |
int
|
|
activity_weighted |
bool
|
|
Attributes¶
ViconBagSource
dataclass
¶
ViconBagSource(
path: Path,
schema: ViconSourceSchema,
topics: ViconBagTopics = ViconBagTopics(),
frame: FrameConvention = Z_UP_RIGHT_HANDED,
name: str = "",
transform_scale_m: float = 1.0,
marker_scale_m: float = 0.001,
)
Read a ROS 2 Vicon bag directly into a native mocap recording.
The optional capture-ros dependency is imported only when :meth:load
runs. The bag is never converted into a persistent table or archive.
Methods:
| Name | Description |
|---|---|
load |
Deserialize configured bag topics into typed Vicon tracks. |
Attributes:
| Name | Type | Description |
|---|---|---|
path |
Path
|
|
schema |
ViconSourceSchema
|
|
topics |
ViconBagTopics
|
|
frame |
FrameConvention
|
|
name |
str
|
|
transform_scale_m |
float
|
|
marker_scale_m |
float
|
|
ViconBagTopics
dataclass
¶
ViconBagTopics(
transforms: tuple[str, ...] = ("/tf",),
markers: tuple[str, ...] = ("/vicon/markers",),
)
ROS topics carrying Vicon rigid-body transforms and marker samples.
Attributes:
| Name | Type | Description |
|---|---|---|
transforms |
tuple[str, ...]
|
|
markers |
tuple[str, ...]
|
|
ViconRecordingSource
dataclass
¶
ViconRecordingSource(
path: Path,
schema: ViconSourceSchema,
frame: FrameConvention = Z_UP_RIGHT_HANDED,
name: str = "",
)
Load a preconverted Vicon recording directly into typed tracks.
Methods:
| Name | Description |
|---|---|
load |
Load |
Attributes:
| Name | Type | Description |
|---|---|---|
path |
Path
|
|
schema |
ViconSourceSchema
|
|
frame |
FrameConvention
|
|
name |
str
|
|
ViconSourceSchema
dataclass
¶
ViconSourceSchema(
rigid_bodies: Mapping[str, MocapRigidBody],
markers: Mapping[str, MocapMarker],
rigid_body_order: tuple[str, ...] | None = None,
marker_order: tuple[str, ...] | None = None,
)
Map Vicon table names into typed native vocabularies.
Attributes:
| Name | Type | Description |
|---|---|---|
rigid_bodies |
Mapping[str, MocapRigidBody]
|
|
markers |
Mapping[str, MocapMarker]
|
|
rigid_body_order |
tuple[str, ...] | None
|
|
marker_order |
tuple[str, ...] | None
|
|
VideoPoseSource
dataclass
¶
VideoPoseSource(video: VideoRecording, estimator: HumanPoseEstimator)
Compose a video recording source with a pose estimator.
Methods:
| Name | Description |
|---|---|
load |
Estimate and return human pose. |
Attributes:
| Name | Type | Description |
|---|---|---|
video |
VideoRecording
|
|
estimator |
HumanPoseEstimator
|
|
VideoRecording
dataclass
¶
VideoRecording(
name: str,
path: Path,
timeline: SampleTimeline,
frame_size: tuple[int, int] | None = None,
provenance: dict[str, object] | None = None,
)
A video stream and its native frame timeline.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
|
path |
Path
|
|
timeline |
SampleTimeline
|
|
frame_size |
tuple[int, int] | None
|
|
provenance |
dict[str, object] | None
|
|
Attributes¶
AssetKind
¶
Constraint
¶
Bases: ConstraintKind
Built-in constraint term registry keys.
Attributes:
| Name | Type | Description |
|---|---|---|
JOINT_LIMITS |
str
|
Enforce joint limits. |
TRUST_REGION |
str
|
Limit per-step configuration change. |
FOOT_STICKING |
str
|
Foot support consistency constraints. |
FOOT_LOCK |
str
|
Lock feet during planted phases. |
NON_PENETRATION |
str
|
Prevent interpenetration with scene geometry. |
SELF_COLLISION |
str
|
Self-collision avoidance. |
Attributes¶
ConstraintKind
¶
Bases: RegistryKind
Base enum for constraint registrations.
ContactLayerKind
¶
Bases: RetargetEnum
Persisted contact layer storage kind.
Members:
| Name | Type | Description |
|---|---|---|
BINARY |
int |
Value
'binary'.
|
CATEGORICAL |
int |
Value
'categorical'.
|
ConvergenceMode
¶
Bases: RetargetEnum
SQP inner-loop convergence policy.
Members:
| Name | Type | Description |
|---|---|---|
STEP_NORM |
int |
Value
'step_norm'.
|
COST_PLATEAU |
int |
Value
'cost_plateau'.
|
NONE |
int |
Value
'none'.
|
CropPolicy
¶
Bases: RetargetEnum
How a shared observation timeline handles source support.
Members:
| Name | Type | Description |
|---|---|---|
OVERLAP |
int |
Value
'overlap'.
|
FULL |
int |
Value
'full'.
|
ExporterKind
¶
Bases: RegistryKind
Base enum for exporter registrations.
ExportFormat
¶
Bases: ExporterKind
Built-in exporter registry keys.
Attributes:
| Name | Type | Description |
|---|---|---|
MUJOCO_NPZ |
str
|
MuJoCo-compatible NPZ export bundle. |
FrameConvention
¶
Bases: StrEnum
Coordinate frame conventions understood by the package.
Attributes:
| Name | Type | Description |
|---|---|---|
Z_UP_RIGHT_HANDED |
str
|
Z-up, right-handed world frame. |
Y_UP_RIGHT_HANDED |
str
|
Y-up, right-handed world frame (common in video/SMPL). |
HumanoidRobotRole
¶
Bases: RobotRole
Standard semantic roles exposed by humanoid robot specs.
Attributes:
| Name | Type | Description |
|---|---|---|
PELVIS |
|
|
TORSO |
|
|
HEAD |
|
|
LEFT_HIP |
|
|
LEFT_KNEE |
|
|
LEFT_ANKLE |
|
|
LEFT_FOOT |
|
|
RIGHT_HIP |
|
|
RIGHT_KNEE |
|
|
RIGHT_ANKLE |
|
|
RIGHT_FOOT |
|
|
LEFT_HAND |
|
|
RIGHT_HAND |
|
Attributes¶
KinematicsBackendName
¶
Bases: KinematicsKind
Built-in kinematics backend registry keys.
Attributes:
| Name | Type | Description |
|---|---|---|
SIMPLE |
str
|
Lightweight analytic / table backend. |
MUJOCO |
str
|
MuJoCo model backend. |
KinematicsKind
¶
Bases: RegistryKind
Base enum for kinematics-backend registrations.
MetricKind
¶
Bases: RegistryKind
Base enum for metric registrations.
MetricName
¶
Bases: MetricKind
Built-in evaluation metric names.
Attributes:
| Name | Type | Description |
|---|---|---|
OPTIMIZATION_COST |
str
|
Final optimization cost. |
FOOT_SLIDING |
str
|
Foot sliding during contact. |
CONTACT_PRESERVATION |
str
|
Agreement with input contact signal. |
PENETRATION |
str
|
Mesh penetration depth metric. |
MotionFormat
¶
MotionFormatKind
¶
Bases: RegistryKind
Base enum for motion-format registrations.
MotionLoaderKind
¶
Bases: RegistryKind
Base enum for motion-loader registrations.
MotionLoaderSuffix
¶
Bases: MotionLoaderKind
Built-in motion loader suffix registry keys.
Attributes:
| Name | Type | Description |
|---|---|---|
JSON |
str
|
|
CSV |
str
|
|
NPY |
str
|
|
NPZ |
str
|
|
NameEnum
¶
Bases: RetargetEnum
Base class for user-defined symbolic vocabularies.
NominalFallback
¶
Bases: RetargetEnum
Fallback target for nominal qpos tracking.
Members:
| Name | Type | Description |
|---|---|---|
ZERO |
int |
Value
'zero'.
|
CURRENT |
int |
Value
'current'.
|
NonPenetrationSource
¶
Bases: RetargetEnum
Sources used by the non-penetration constraint.
Members:
| Name | Type | Description |
|---|---|---|
SUPPORT |
int |
Value
'support'.
|
SCENE_POINTS |
int |
Value
'scene_points'.
|
GEOMETRY |
int |
Value
'geometry'.
|
Objective
¶
Bases: ObjectiveKind
Built-in objective term registry keys.
Attributes:
| Name | Type | Description |
|---|---|---|
LAPLACIAN |
str
|
Interaction-mesh Laplacian deformation objective. |
LINK_TRACKING |
str
|
Track named robot links to per-frame world-space target points. |
SMOOTHNESS |
str
|
Temporal smoothness on generalized coordinates. |
NOMINAL_TRACKING |
str
|
Track a nominal pose trajectory. |
DIAGONAL_REGULARIZATION |
str
|
Penalize selected qpos coordinates toward zero. |
ObjectiveKind
¶
Bases: RegistryKind
Base enum for objective registrations.
ObjectQposMode
¶
Bases: RetargetEnum
How a dynamic object trajectory participates in qpos.
Members:
| Name | Type | Description |
|---|---|---|
APPENDED |
int |
Value
'appended'.
|
EXTERNAL |
int |
Value
'external'.
|
ObjectSampleSpace
¶
Bases: RetargetEnum
Coordinate space for object sample points.
Members:
| Name | Type | Description |
|---|---|---|
OBJECT_LOCAL |
int |
Value
'object_local'.
|
OBJECT_ASSET_LOCAL |
int |
Value
'object_asset_local'.
|
SCALED_OBJECT_LOCAL |
int |
Value
'scaled_object_local'.
|
WORLD |
int |
Value
'world'.
|
ObservationRecipeKind
¶
Bases: ObservationRecipeKindBase
Built-in observation-recipe kinds for declarative run configs.
Attributes:
| Name | Type | Description |
|---|---|---|
MOTION_FILE |
|
|
SKATEBOARDING |
|
|
HOLOSOMA_CLIMB |
|
ObservationRecipeKindBase
¶
Bases: RegistryKind
Base enum for observation-recipe registrations.
QposVariableKind
¶
Bases: RetargetEnum
Which qpos coordinates the optimizer may change.
Members:
| Name | Type | Description |
|---|---|---|
ACTUATED |
int |
Value
'actuated'.
|
QPOS_SLICE |
int |
Value
'qpos_slice'.
|
QPOS_INDICES |
int |
Value
'qpos_indices'.
|
QuaternionOrder
¶
RetargetEnum
¶
Bases: StrEnum
Base class for string-valued retarget enums.
RetargetingRecipeKind
¶
Bases: RetargetingRecipeKindBase
Built-in robot-adaptation recipe kinds for declarative run configs.
Attributes:
| Name | Type | Description |
|---|---|---|
ROLE_MAPPING |
|
|
SKATEBOARDING |
|
|
HOLOSOMA_CLIMB |
|
RetargetingRecipeKindBase
¶
Bases: RegistryKind
Base enum for retargeting-recipe registrations.
Robot
¶
Bases: RobotKind
Built-in robot registry keys.
Attributes:
| Name | Type | Description |
|---|---|---|
SYNTHETIC_HUMANOID |
str
|
Lightweight test humanoid. |
G1_LIKE |
str
|
Unitree G1-style humanoid preset. |
T1_LIKE |
str
|
Booster T1-style humanoid preset. |
RobotKind
¶
Bases: RegistryKind
Base enum for robot registrations.
RobotProviderKind
¶
Bases: RegistryKind
Base enum for robot-provider registrations.
RobotProviderName
¶
Bases: RobotProviderKind
Built-in robot provider registry keys.
Attributes:
| Name | Type | Description |
|---|---|---|
REGISTRY |
str
|
Load from built-in registry entries. |
FILE |
str
|
Load robot spec from a file path. |
ASSET_STORE |
str
|
Resolve robot via the asset store manifest. |
RunStatus
¶
SolverBackend
¶
Bases: SolverKind
Optimization backend choices.
Attributes:
| Name | Type | Description |
|---|---|---|
AUTO |
str
|
Pick an available backend at runtime. |
NUMPY_LEAST_SQUARES |
str
|
SciPy/NumPy least-squares solver. |
CVXPY_CLARABEL |
str
|
CVXPY with Clarabel conic solver. |
SolverKind
¶
Bases: RegistryKind
Base enum for solver registrations.
TaskKind
¶
Bases: StrEnum
Supported high-level retargeting workflows.
Attributes:
| Name | Type | Description |
|---|---|---|
ROBOT_ONLY |
str
|
Retarget humanoid motion without scene props ( |
OBJECT_INTERACTION |
str
|
Retarget with manipulated objects and contact ( |
CLIMBING |
str
|
Climbing / terrain interaction workflow ( |
TimelineSelection
¶
Bases: RetargetEnum
Native timeline selected as the observation sampling grid.
Members:
| Name | Type | Description |
|---|---|---|
HUMAN_POSE |
int |
Value
'human_pose'.
|
MOCAP |
int |
Value
'mocap'.
|
UNIFORM |
int |
Value
'uniform'.
|
VisualizerKind
¶
Bases: RegistryKind
Base enum for visualizer registrations.
VisualizerName
¶
Bases: VisualizerKind
Built-in visualizer registry keys.
Attributes:
| Name | Type | Description |
|---|---|---|
DRY_RUN |
str
|
Print summary without opening a viewer. |
VISER |
str
|
Interactive Viser web visualizer. |
Pose
¶
Bases: BaseModel
Rigid transform from a local frame into a named world convention.
Attributes:
| Name | Type | Description |
|---|---|---|
translation |
FloatArray
|
World-frame origin offset, shape |
quaternion |
FloatArray
|
Unit quaternion in |
quaternion_order |
QuaternionOrder
|
Storage order of |
frame |
FrameConvention
|
World coordinate convention for |
Methods:
| Name | Description |
|---|---|
identity |
Return an identity pose. |
quaternion_as |
Return the quaternion in the requested storage order. |
rotation |
Return this pose's rotation as a SciPy |
matrix |
Return a 4x4 homogeneous transform matrix. |
inverse |
Return the inverse transform. |
transform_points |
Transform points of shape |
inverse_transform_points |
Transform points of shape |
to_frame |
Return this pose represented in another coordinate frame convention. |
scaled |
Return a copy with translation scaled and rotation preserved. |
Attributes¶
model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(arbitrary_types_allowed=True)
translation
class-attribute
instance-attribute
¶
translation: FloatArray = Field(default_factory=lambda: zeros(3, dtype=float64))
quaternion
class-attribute
instance-attribute
¶
quaternion: FloatArray = Field(
default_factory=lambda: array([1.0, 0.0, 0.0, 0.0], dtype=float64)
)
Functions¶
identity
classmethod
¶
identity(*, frame: FrameConvention = Z_UP_RIGHT_HANDED) -> Self
Return an identity pose.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frame
|
FrameConvention
|
World coordinate convention for the pose. |
Z_UP_RIGHT_HANDED
|
Returns:
| Name | Type | Description |
|---|---|---|
Pose |
Self
|
Identity transform with zero translation and unit rotation. |
quaternion_as
¶
quaternion_as(order: QuaternionOrder) -> FloatArray
Return the quaternion in the requested storage order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order
|
QuaternionOrder
|
Desired component layout. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
FloatArray |
FloatArray
|
Unit quaternion with shape |
rotation
¶
rotation() -> Rotation
Return this pose's rotation as a SciPy Rotation.
Returns:
| Name | Type | Description |
|---|---|---|
Rotation |
Rotation
|
Orientation in SciPy's scalar-last |
matrix
¶
matrix() -> FloatArray
Return a 4x4 homogeneous transform matrix.
Returns:
| Name | Type | Description |
|---|---|---|
FloatArray |
FloatArray
|
|
inverse
¶
inverse() -> Pose
Return the inverse transform.
Returns:
| Name | Type | Description |
|---|---|---|
Pose |
Pose
|
Transform that maps world coordinates back to the local frame. |
transform_points
¶
transform_points(points: Any) -> FloatArray
Transform points of shape (..., 3) from local to world coordinates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
points
|
Any
|
Local-frame positions with trailing dimension 3. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
FloatArray |
FloatArray
|
World-frame positions with the same shape as |
inverse_transform_points
¶
inverse_transform_points(points: Any) -> FloatArray
Transform points of shape (..., 3) from world to local coordinates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
points
|
Any
|
World-frame positions with trailing dimension 3. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
FloatArray |
FloatArray
|
Local-frame positions with the same shape as |
to_frame
¶
to_frame(target: FrameConvention) -> Pose
Return this pose represented in another coordinate frame convention.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
FrameConvention
|
Desired world coordinate convention. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Pose |
Pose
|
Same rigid transform expressed in |
PoseSequence
¶
Bases: BaseModel
Time-indexed sequence of poses.
Attributes:
| Name | Type | Description |
|---|---|---|
poses |
tuple[Pose, ...]
|
Per-frame rigid transforms sharing one |
fps |
float
|
Sampling rate in Hz for time-based resampling. |
Methods:
| Name | Description |
|---|---|
quaternions |
Stacked quaternions with shape |
identity |
Return |
from_arrays |
Build a pose sequence from position and quaternion arrays. |
to_frame |
Return this sequence represented in another coordinate frame convention. |
scaled |
Return this sequence with translations scaled and rotations preserved. |
resampled |
Return this pose sequence sampled on a new FPS grid. |
Attributes¶
model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(arbitrary_types_allowed=True)
Functions¶
quaternions
¶
quaternions(order: QuaternionOrder = WXYZ) -> FloatArray
Stacked quaternions with shape (T, 4).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order
|
QuaternionOrder
|
Storage order for each frame's quaternion. |
WXYZ
|
Returns:
| Name | Type | Description |
|---|---|---|
FloatArray |
FloatArray
|
Quaternion array with shape |
identity
classmethod
¶
identity(
frame_count: int, *, fps: float = 30.0, frame: FrameConvention = Z_UP_RIGHT_HANDED
) -> PoseSequence
Return frame_count identity poses.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frame_count
|
int
|
Number of frames to create. |
required |
fps
|
float
|
Sampling rate in Hz. |
30.0
|
frame
|
FrameConvention
|
World coordinate convention for every pose. |
Z_UP_RIGHT_HANDED
|
Returns:
| Name | Type | Description |
|---|---|---|
PoseSequence |
PoseSequence
|
Sequence of identity transforms. |
from_arrays
classmethod
¶
from_arrays(
positions: Any,
quaternions: Any,
*,
fps: float = 30.0,
quaternion_order: QuaternionOrder = WXYZ,
frame: FrameConvention = Z_UP_RIGHT_HANDED,
) -> PoseSequence
Build a pose sequence from position and quaternion arrays.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
positions
|
Any
|
Translations with shape |
required |
quaternions
|
Any
|
Orientations with shape |
required |
fps
|
float
|
Sampling rate in Hz. |
30.0
|
quaternion_order
|
QuaternionOrder
|
Layout of each row in |
WXYZ
|
frame
|
FrameConvention
|
World coordinate convention for every pose. |
Z_UP_RIGHT_HANDED
|
Returns:
| Name | Type | Description |
|---|---|---|
PoseSequence |
PoseSequence
|
One |
to_frame
¶
to_frame(target: FrameConvention) -> PoseSequence
Return this sequence represented in another coordinate frame convention.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
FrameConvention
|
Desired world coordinate convention. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PoseSequence |
PoseSequence
|
Copy with each pose converted to |
scaled
¶
scaled(factor: float) -> PoseSequence
Return this sequence with translations scaled and rotations preserved.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
factor
|
float
|
Multiplier applied to every pose translation. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PoseSequence |
PoseSequence
|
Copy with scaled translations and unchanged orientations. |
resampled
¶
resampled(fps: float) -> PoseSequence
Return this pose sequence sampled on a new FPS grid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fps
|
float
|
Target sampling rate in Hz. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PoseSequence |
PoseSequence
|
Endpoint-preserving resample with linear translation and spherical-linear rotation interpolation. |
ConstraintTerm
¶
Bases: Protocol[ConstraintConfigT]
Optimization constraint term.
Methods:
| Name | Description |
|---|---|
describe |
Return a short human-readable summary of the term. |
build |
Build a constraint contribution for one optimization step. |
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
ConstraintKind
|
Typed registry key for this constraint term. |
config_type |
type[ConstraintConfigT]
|
Typed config model consumed by this term. |
Attributes¶
config_type
property
¶
config_type: type[ConstraintConfigT]
Typed config model consumed by this term.
Functions¶
build
¶
build(context: TermContext, config: ConstraintConfigT) -> ConstraintContribution
Build a constraint contribution for one optimization step.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
TermContext
|
Shared kinematics and trajectory state. |
required |
config
|
ConstraintConfig
|
Term configuration from the problem spec. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ConstraintContribution |
ConstraintContribution
|
Linearized inequality or equality block. |
Exporter
¶
Bases: Protocol
Export a retargeting result to an external workflow format.
Methods:
| Name | Description |
|---|---|
export |
Write retargeting output to an external format. |
Functions¶
export
¶
export(result: RetargetingResult, spec: ExportSpec) -> ExportResult
Write retargeting output to an external format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
RetargetingResult
|
Solved trajectory and structured reports. |
required |
spec
|
ExportSpec
|
Target format and destination options. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ExportResult |
ExportResult
|
Paths and status for written artifacts. |
KinematicsBackend
¶
Bases: Protocol
Robot kinematics operations needed by retargeting and metrics.
Methods:
| Name | Description |
|---|---|
forward_kinematics |
Compute link poses for the given configuration. |
link_positions |
Return world-frame link origins. |
body_jacobians |
Return position, rotation, and full spatial Jacobians for bodies. |
body_jacobians_for_qpos_indices |
Return body Jacobians with columns selected by qpos indices. |
point_jacobians |
Return Jacobians for named kinematic points. |
point_jacobians_for_qpos_indices |
Return point Jacobians with columns selected by qpos indices. |
qpos_to_qvel |
Finite-difference generalized velocity from two poses. |
integrate_qvel |
Integrate generalized velocity for one time step. |
joint_limits |
Return per-joint position limits. |
geom_distances |
Measure distances between geometry pairs. |
collision_candidates |
Return geometry pairs within a collision margin. |
geom_distance_jacobians |
Return linearized geometry distances for qpos-index variables. |
Functions¶
forward_kinematics
¶
forward_kinematics(
qpos: NDArray[float64], link_names: tuple[str, ...]
) -> NDArray[float64]
Compute link poses for the given configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qpos
|
NDArray[float64]
|
Generalized coordinates. |
required |
link_names
|
tuple[str, ...]
|
Links to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
NDArray[np.float64]: Flattened pose array for the requested links. |
link_positions
¶
link_positions(qpos: NDArray[float64], link_names: tuple[str, ...]) -> NDArray[float64]
Return world-frame link origins.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qpos
|
NDArray[float64]
|
Generalized coordinates. |
required |
link_names
|
tuple[str, ...]
|
Links to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
NDArray[np.float64]: Positions with shape |
body_jacobians
¶
body_jacobians(
qpos: NDArray[float64], body_names: tuple[str, ...]
) -> tuple[NDArray[float64], NDArray[float64], NDArray[float64]]
Return position, rotation, and full spatial Jacobians for bodies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qpos
|
NDArray[float64]
|
Generalized coordinates. |
required |
body_names
|
tuple[str, ...]
|
Bodies to differentiate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[NDArray[float64], NDArray[float64], NDArray[float64]]
|
tuple[NDArray[np.float64], NDArray[np.float64], NDArray[np.float64]]: Position Jacobians, rotation Jacobians, and stacked spatial Jacobians. |
body_jacobians_for_qpos_indices
¶
body_jacobians_for_qpos_indices(
qpos: NDArray[float64], body_names: tuple[str, ...], qpos_indices: NDArray[int64]
) -> tuple[NDArray[float64], NDArray[float64], NDArray[float64]]
Return body Jacobians with columns selected by qpos indices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qpos
|
NDArray[float64]
|
Generalized coordinates. |
required |
body_names
|
tuple[str, ...]
|
Bodies to differentiate. |
required |
qpos_indices
|
NDArray[int64]
|
Qpos coordinates used as optimizer variables. |
required |
Returns:
| Type | Description |
|---|---|
tuple[NDArray[float64], NDArray[float64], NDArray[float64]]
|
tuple[NDArray[np.float64], NDArray[np.float64], NDArray[np.float64]]: Positions, translational Jacobians, and rotational Jacobians. |
point_jacobians
¶
point_jacobians(
qpos: NDArray[float64], point_names: tuple[str, ...]
) -> tuple[NDArray[float64], NDArray[float64]]
Return Jacobians for named kinematic points.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qpos
|
NDArray[float64]
|
Generalized coordinates. |
required |
point_names
|
tuple[str, ...]
|
Named points on the model. |
required |
Returns:
| Type | Description |
|---|---|
tuple[NDArray[float64], NDArray[float64]]
|
tuple[NDArray[np.float64], NDArray[np.float64]]: Position Jacobians and optional auxiliary Jacobians. |
point_jacobians_for_qpos_indices
¶
point_jacobians_for_qpos_indices(
qpos: NDArray[float64], point_names: tuple[str, ...], qpos_indices: NDArray[int64]
) -> tuple[NDArray[float64], NDArray[float64]]
Return point Jacobians with columns selected by qpos indices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qpos
|
NDArray[float64]
|
Generalized coordinates. |
required |
point_names
|
tuple[str, ...]
|
Named points on the model. |
required |
qpos_indices
|
NDArray[int64]
|
Qpos coordinates used as optimizer variables. |
required |
Returns:
| Type | Description |
|---|---|
tuple[NDArray[float64], NDArray[float64]]
|
tuple[NDArray[np.float64], NDArray[np.float64]]: Positions and qpos-index Jacobians. |
qpos_to_qvel
¶
qpos_to_qvel(
qpos: NDArray[float64], previous_qpos: NDArray[float64], dt: float
) -> NDArray[float64]
Finite-difference generalized velocity from two poses.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qpos
|
NDArray[float64]
|
Current configuration. |
required |
previous_qpos
|
NDArray[float64]
|
Previous configuration. |
required |
dt
|
float
|
Time step in seconds. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
NDArray[np.float64]: Generalized velocity matching |
integrate_qvel
¶
integrate_qvel(
qpos: NDArray[float64], qvel: NDArray[float64], dt: float
) -> NDArray[float64]
Integrate generalized velocity for one time step.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qpos
|
NDArray[float64]
|
Starting configuration. |
required |
qvel
|
NDArray[float64]
|
Generalized velocity. |
required |
dt
|
float
|
Time step in seconds. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
NDArray[np.float64]: Integrated configuration. |
joint_limits
¶
joint_limits() -> dict[str, tuple[float, float]]
Return per-joint position limits.
Returns:
| Type | Description |
|---|---|
dict[str, tuple[float, float]]
|
dict[str, tuple[float, float]]: Mapping from joint name to |
geom_distances
¶
geom_distances(
qpos: NDArray[float64],
geom_pairs: tuple[tuple[str, str], ...],
*,
max_distance: float = inf,
) -> tuple[GeometryDistance, ...]
Measure distances between geometry pairs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qpos
|
NDArray[float64]
|
Generalized coordinates. |
required |
geom_pairs
|
tuple[tuple[str, str], ...]
|
Explicit pairs to evaluate. |
required |
max_distance
|
float
|
Ignore pairs farther than this threshold. |
inf
|
Returns:
| Type | Description |
|---|---|
tuple[GeometryDistance, ...]
|
tuple[GeometryDistance, ...]: Signed distances and contact normals per pair. |
collision_candidates
¶
collision_candidates(
qpos: NDArray[float64],
*,
margin: float = 0.0,
geom_pairs: tuple[tuple[str, str], ...],
) -> tuple[GeometryDistance, ...]
Return geometry pairs within a collision margin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qpos
|
NDArray[float64]
|
Generalized coordinates. |
required |
margin
|
float
|
Distance threshold for candidate inclusion. |
0.0
|
geom_pairs
|
tuple[tuple[str, str], ...]
|
Explicit pairs to scan. |
required |
Returns:
| Type | Description |
|---|---|
tuple[GeometryDistance, ...]
|
tuple[GeometryDistance, ...]: Near-contact pairs suitable for constraints. |
geom_distance_jacobians
¶
geom_distance_jacobians(
qpos: NDArray[float64],
qpos_indices: NDArray[int64],
geom_pairs: tuple[tuple[str, str], ...],
*,
max_distance: float = inf,
) -> tuple[GeometryDistanceJacobian, ...]
Return linearized geometry distances for qpos-index variables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qpos
|
NDArray[float64]
|
Generalized coordinates. |
required |
qpos_indices
|
NDArray[int64]
|
Qpos coordinates used as optimizer variables. |
required |
geom_pairs
|
tuple[tuple[str, str], ...]
|
Explicit pairs to evaluate. |
required |
max_distance
|
float
|
Ignore pairs farther than this threshold. |
inf
|
Returns:
| Type | Description |
|---|---|
tuple[GeometryDistanceJacobian, ...]
|
tuple[GeometryDistanceJacobian, ...]: Distance rows suitable for linear constraints. |
Metric
¶
Bases: Protocol
Evaluate one metric.
Methods:
| Name | Description |
|---|---|
evaluate |
Compute the metric for a retargeting run. |
Attributes:
| Name | Type | Description |
|---|---|---|
name |
MetricKind
|
Registry key for this metric. |
Attributes¶
Functions¶
evaluate
¶
evaluate(result: RetargetingResult, problem: RetargetingProblem | None = None) -> float
Compute the metric for a retargeting run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
RetargetingResult
|
Solved trajectory and diagnostics. |
required |
problem
|
RetargetingProblem | None
|
Original problem, when needed for context. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Scalar metric value (lower is typically better). |
MotionLoader
¶
Bases: Protocol
Load a motion file into a MotionSequence.
Methods:
| Name | Description |
|---|---|
load |
Load motion from disk. |
Functions¶
load
¶
load(path: Path, spec: MotionFormatSpec, *, name: str | None = None) -> MotionSequence
Load motion from disk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
Source file path. |
required |
spec
|
MotionFormatSpec
|
Format descriptor for parsing. |
required |
name
|
str | None
|
Optional clip name override. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
MotionSequence |
MotionSequence
|
Parsed motion sequence. |
ObjectiveTerm
¶
Bases: Protocol[ObjectiveConfigT]
Optimization objective term.
Methods:
| Name | Description |
|---|---|
describe |
Return a short human-readable summary of the term. |
build |
Build objective contributions for one optimization step. |
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
ObjectiveKind
|
Typed registry key for this objective term. |
config_type |
type[ObjectiveConfigT]
|
Typed config model consumed by this term. |
Attributes¶
config_type
property
¶
config_type: type[ObjectiveConfigT]
Typed config model consumed by this term.
Functions¶
build
¶
build(
context: TermContext, config: ObjectiveConfigT
) -> tuple[ObjectiveContribution, ...]
Build objective contributions for one optimization step.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
TermContext
|
Shared kinematics and trajectory state. |
required |
config
|
ObjectiveConfig
|
Term configuration from the problem spec. |
required |
Returns:
| Type | Description |
|---|---|
tuple[ObjectiveContribution, ...]
|
tuple[ObjectiveContribution, ...]: One or more stacked objective blocks. |
RobotProvider
¶
Bases: Protocol
Resolve robot specs from names or external asset locations.
Methods:
| Name | Description |
|---|---|
load |
Resolve a robot specification. |
Functions¶
load
¶
load(name: str, **kwargs: Any) -> RobotSpec
Resolve a robot specification.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Registry key or asset identifier. |
required |
**kwargs
|
Any
|
Provider-specific options (paths, manifests, etc.). |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
RobotSpec |
RobotSpec
|
Loaded robot model description. |
Solver
¶
Bases: Protocol
Solve a quadratic retargeting subproblem.
Methods:
| Name | Description |
|---|---|
solve |
Solve a quadratic subproblem. |
Functions¶
solve
¶
solve(problem: QuadraticProblem) -> SolverResult
Solve a quadratic subproblem.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
problem
|
QuadraticProblem
|
Assembled least-squares or conic problem. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
SolverResult |
SolverResult
|
Primal solution and solver diagnostics. |
Visualizer
¶
Bases: Protocol
Render or summarize a retargeting result.
Methods:
| Name | Description |
|---|---|
view |
Open an interactive view or print a summary. |
Functions¶
view
¶
view(result: RetargetingResult) -> None
Open an interactive view or print a summary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
RetargetingResult
|
Retargeting output to display. |
required |
ExportResult
¶
Bases: BaseModel
Summary of an export operation.
Attributes:
| Name | Type | Description |
|---|---|---|
format_name |
str
|
Export format key used for the operation. |
path |
Path
|
Written output file path. |
frame_count |
int
|
Number of exported frames. |
fps |
float
|
Exported playback frame rate. |
qpos_dimension |
int | None
|
Exported generalized-position width. |
qvel_dimension |
int | None
|
Exported generalized-velocity width. |
provenance |
dict[str, Any]
|
Origin information for the export. |
ExportSpec
¶
Bases: BaseModel
Configuration for exporting a retargeting result.
Attributes:
| Name | Type | Description |
|---|---|---|
format_name |
str
|
Registered export format key (default |
output_path |
Path
|
Destination file path for exported data. |
output_fps |
int | None
|
Optional resample rate before export; uses result fps when omitted. |
kinematics_backend |
KinematicsBackend | None
|
Optional backend for analytic qvel; finite differences when omitted. |
provenance |
dict[str, Any]
|
Origin information copied into the export. |
Attributes¶
model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(arbitrary_types_allowed=True)
kinematics_backend
class-attribute
instance-attribute
¶
kinematics_backend: KinematicsBackend | None = None
provenance
class-attribute
instance-attribute
¶
provenance: dict[str, Any] = Field(default_factory=dict)
GeometryDistance
dataclass
¶
GeometryDistance(
first: str,
second: str,
distance: float,
point_on_first: NDArray[float64],
point_on_second: NDArray[float64],
normal_from_first_to_second: NDArray[float64],
)
Signed or unsigned distance between two geometry-like objects.
Negative distances indicate overlap when the backend can compute signed separation. Backends that only expose point distances should return non-negative values.
Attributes:
| Name | Type | Description |
|---|---|---|
first |
str
|
Name of the first body or collision geometry. |
second |
str
|
Name of the second body or collision geometry. |
distance |
float
|
Separation along |
point_on_first |
NDArray[float64]
|
Closest point on |
point_on_second |
NDArray[float64]
|
Closest point on |
normal_from_first_to_second |
NDArray[float64]
|
Unit normal pointing from |
Attributes¶
GeometryDistanceJacobian
dataclass
¶
GeometryDistanceJacobian(distance: GeometryDistance, jacobian: NDArray[float64])
Linearized distance row for a geometry pair.
Attributes:
| Name | Type | Description |
|---|---|---|
distance |
GeometryDistance
|
Pair distance and closest-point data. |
jacobian |
NDArray[float64]
|
Derivative of distance with respect to
the active qpos variable set, shape |
Attributes¶
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 |
None
|
k_neighbors
|
int | None
|
Neighbor count for |
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 |
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 |
laplacian_weighting |
LaplacianWeighting
|
Neighbor weighting used by Laplacian objectives. |
laplacian_epsilon |
float
|
Small positive value used by distance-weighted Laplacians. |
Attributes¶
laplacian_weighting
class-attribute
instance-attribute
¶
laplacian_weighting: LaplacianWeighting = UNIFORM
LaplacianWeighting
¶
Bases: StrEnum
Neighbor weighting policy for Laplacian coordinates.
Attributes:
| Name | Type | Description |
|---|---|---|
UNIFORM |
str
|
Average all neighbors equally. This matches Holosoma's default. |
INVERSE_DISTANCE |
str
|
Weight closer neighbors more strongly. |
MeshTopology
¶
ContactFrame
dataclass
¶
ContactFrame(
frame_idx: int,
tracks: tuple[ContactTrack[SubjectT, StateT, PatchT, LinkT], ...],
support: SupportPlane | None = None,
)
Bases: Generic[SubjectT, StateT, PatchT, LinkT]
Per-frame view of a :class:ContactPlan.
Attributes:
| Name | Type | Description |
|---|---|---|
frame_idx |
int
|
|
tracks |
tuple[ContactTrack[SubjectT, StateT, PatchT, LinkT], ...]
|
|
support |
SupportPlane | None
|
|
active_tracks |
tuple[ContactTrack[SubjectT, StateT, PatchT, LinkT], ...]
|
Tracks active at this frame. |
support_tracks |
tuple[ContactTrack[SubjectT, StateT, PatchT, LinkT], ...]
|
Tracks touching support at this frame. |
active_links |
tuple[LinkT, ...]
|
Typed robot links mapped to active tracks. |
support_links |
tuple[LinkT, ...]
|
Typed robot links mapped to support tracks. |
Attributes¶
active_tracks
property
¶
active_tracks: tuple[ContactTrack[SubjectT, StateT, PatchT, LinkT], ...]
Tracks active at this frame.
support_tracks
property
¶
support_tracks: tuple[ContactTrack[SubjectT, StateT, PatchT, LinkT], ...]
Tracks touching support at this frame.
support_links
property
¶
support_links: tuple[LinkT, ...]
Typed robot links mapped to support tracks.
ContactPlan
dataclass
¶
ContactPlan(
tracks: tuple[ContactTrack[SubjectT, StateT, PatchT, LinkT], ...],
frame_count: int | None = None,
support: SupportPlane | None = None,
provenance: dict[str, object] = dict(),
)
Bases: Generic[SubjectT, StateT, PatchT, LinkT]
Typed contact states and support geometry for a retargeting problem.
Methods:
| Name | Description |
|---|---|
frame |
Return a per-frame view. |
resampled |
Nearest-neighbor resample contact states. |
scaled |
Return a copy with positional support geometry scaled. |
Attributes:
| Name | Type | Description |
|---|---|---|
tracks |
tuple[ContactTrack[SubjectT, StateT, PatchT, LinkT], ...]
|
|
frame_count |
int | None
|
|
support |
SupportPlane | None
|
|
provenance |
dict[str, object]
|
|
Attributes¶
provenance
class-attribute
instance-attribute
¶
provenance: dict[str, object] = field(default_factory=dict)
Functions¶
frame
¶
frame(frame_idx: int) -> ContactFrame[SubjectT, StateT, PatchT, LinkT]
Return a per-frame view.
resampled
¶
resampled(
source_fps: float, target_fps: float
) -> ContactPlan[SubjectT, StateT, PatchT, LinkT]
Nearest-neighbor resample contact states.
scaled
¶
scaled(factor: float) -> ContactPlan[SubjectT, StateT, PatchT, LinkT]
Return a copy with positional support geometry scaled.
ContactTrack
dataclass
¶
ContactTrack(
subject: SubjectT,
states: tuple[StateT, ...],
links: tuple[LinkT, ...],
patch: PatchT | None = None,
active_states: tuple[StateT, ...] = (),
support_states: tuple[StateT, ...] = (),
validity: ndarray | None = None,
provenance: dict[str, object] = dict(),
)
Bases: Generic[SubjectT, StateT, PatchT, LinkT]
One semantic subject's typed contact state over time.
Methods:
| Name | Description |
|---|---|
active_at |
Whether this subject is active at one frame. |
support_at |
Whether this subject touches support geometry at one frame. |
resampled_indices |
Return a copy sampled at nearest-neighbor indices. |
Attributes:
| Name | Type | Description |
|---|---|---|
subject |
SubjectT
|
|
states |
tuple[StateT, ...]
|
|
links |
tuple[LinkT, ...]
|
|
patch |
PatchT | None
|
|
active_states |
tuple[StateT, ...]
|
|
support_states |
tuple[StateT, ...]
|
|
validity |
ndarray | None
|
|
provenance |
dict[str, object]
|
|
frame_count |
int
|
Number of frames. |
active_mask |
ndarray
|
Valid frames whose state is active. |
support_mask |
ndarray
|
Valid frames whose state touches support geometry. |
Attributes¶
provenance
class-attribute
instance-attribute
¶
provenance: dict[str, object] = field(default_factory=dict)
Functions¶
support_at
¶
support_at(frame_idx: int) -> bool
Whether this subject touches support geometry at one frame.
resampled_indices
¶
resampled_indices(indices: ndarray) -> ContactTrack[SubjectT, StateT, PatchT, LinkT]
Return a copy sampled at nearest-neighbor indices.
LafanMotionJoint
¶
Bases: MotionJoint
Attributes:
Attributes¶
LinkTargetPlan
dataclass
¶
LinkTargetPlan(
tracks: tuple[LinkTargetTrack[LinkT], ...],
frame_count: int | None = None,
provenance: dict[str, object] = dict(),
)
Bases: Generic[LinkT]
Validated frame-aligned targets using one robot-link vocabulary.
Methods:
| Name | Description |
|---|---|
frame |
Return a per-frame target view. |
resampled |
Return nearest-neighbor/masked targets on a new time grid. |
scaled |
Return a copy with all positions scaled. |
to_frame |
Return this target plan represented in another frame. |
from_arrays |
Build target tracks from dense |
Attributes:
| Name | Type | Description |
|---|---|---|
tracks |
tuple[LinkTargetTrack[LinkT], ...]
|
|
frame_count |
int | None
|
|
provenance |
dict[str, object]
|
|
links |
tuple[LinkT, ...]
|
Robot links targeted by this plan. |
Attributes¶
provenance
class-attribute
instance-attribute
¶
provenance: dict[str, object] = field(default_factory=dict)
Functions¶
resampled
¶
resampled(source_fps: float, target_fps: float) -> LinkTargetPlan[LinkT]
Return nearest-neighbor/masked targets on a new time grid.
to_frame
¶
to_frame(source: FrameConvention, target: FrameConvention) -> LinkTargetPlan[LinkT]
Return this target plan represented in another frame.
from_arrays
classmethod
¶
from_arrays(
*,
links: tuple[LinkT, ...],
positions: ArrayLike,
weights: ArrayLike | float = 1.0,
active_mask: ArrayLike | None = None,
provenance: Mapping[str, object] | None = None,
) -> LinkTargetPlan[LinkT]
Build target tracks from dense (frames, links, 3) arrays.
LinkTargetSample
dataclass
¶
LinkTargetSample(
link: LinkT,
position: FloatArray,
weight: float,
provenance: dict[str, object] = dict(),
)
Bases: Generic[LinkT]
One active typed robot-link target at one frame.
Attributes:
| Name | Type | Description |
|---|---|---|
link |
LinkT
|
|
position |
FloatArray
|
|
weight |
float
|
|
provenance |
dict[str, object]
|
|
LinkTargetTrack
dataclass
¶
LinkTargetTrack(
link: LinkT,
positions: FloatArray,
weights: FloatArray | float = 1.0,
active_mask: ndarray | None = None,
provenance: dict[str, object] = dict(),
)
Bases: Generic[LinkT]
World-space target trajectory for one typed robot link.
Methods:
| Name | Description |
|---|---|
active_at |
Whether this target is active and finite. |
sample |
Return the sample for one frame when active. |
resampled_indices |
Return a copy sampled at frame indices. |
scaled |
Return a copy with positions scaled. |
to_frame |
Return this track represented in another coordinate frame. |
Attributes:
| Name | Type | Description |
|---|---|---|
link |
LinkT
|
|
positions |
FloatArray
|
|
weights |
FloatArray | float
|
|
active_mask |
ndarray | None
|
|
provenance |
dict[str, object]
|
|
frame_count |
int
|
Number of frames. |
Attributes¶
provenance
class-attribute
instance-attribute
¶
provenance: dict[str, object] = field(default_factory=dict)
Functions¶
sample
¶
sample(frame_idx: int) -> LinkTargetSample[LinkT] | None
Return the sample for one frame when active.
resampled_indices
¶
resampled_indices(indices: ndarray) -> LinkTargetTrack[LinkT]
Return a copy sampled at frame indices.
to_frame
¶
to_frame(source: FrameConvention, target: FrameConvention) -> LinkTargetTrack[LinkT]
Return this track represented in another coordinate frame.
MinimalMotionJoint
¶
Bases: MotionJoint
Attributes:
| Name | Type | Description |
|---|---|---|
PELVIS |
|
|
LEFT_HIP |
|
|
LEFT_KNEE |
|
|
LEFT_TOE |
|
|
RIGHT_HIP |
|
|
RIGHT_KNEE |
|
|
RIGHT_TOE |
|
|
SPINE |
|
|
HEAD |
|
|
LEFT_WRIST |
|
|
RIGHT_WRIST |
|
Attributes¶
MocapMotionJoint
¶
Bases: MotionJoint
Attributes:
Attributes¶
NominalQposFrame
dataclass
¶
NominalQposFrame(frame_idx: int, plan: NominalQposPlan)
Per-frame view of a nominal qpos trajectory.
Methods:
| Name | Description |
|---|---|
active_at |
Whether one qpos coordinate has a finite active nominal target. |
Attributes:
| Name | Type | Description |
|---|---|---|
frame_idx |
int
|
|
plan |
NominalQposPlan
|
|
qpos |
FloatArray
|
Nominal qpos values for this frame. |
weights |
FloatArray
|
Per-qpos nominal weights for this frame. |
active_mask |
ndarray
|
Per-qpos activity mask for this frame. |
NominalQposPlan
dataclass
¶
NominalQposPlan(
qpos: FloatArray,
weights: FloatArray | float = 1.0,
active_mask: ndarray | None = None,
provenance: dict[str, object] = dict(),
)
Frame-aligned nominal generalized-coordinate trajectory.
Unlike link targets, qpos targets are robot-configuration values. They are resampled in time, but are not spatially scaled with source motion.
Methods:
| Name | Description |
|---|---|
frame |
Return a per-frame nominal-qpos view. |
resampled |
Return nearest-neighbor nominal qpos on a new time grid. |
resampled_indices |
Return a copy sampled at frame indices. |
with_provenance |
Return a copy with additional JSON-safe provenance. |
from_array |
Build a nominal qpos plan from dense arrays. |
Attributes:
| Name | Type | Description |
|---|---|---|
qpos |
FloatArray
|
|
weights |
FloatArray | float
|
|
active_mask |
ndarray | None
|
|
provenance |
dict[str, object]
|
|
frame_count |
int
|
Number of frames in the plan. |
qpos_size |
int
|
Number of generalized coordinates in each frame. |
Attributes¶
provenance
class-attribute
instance-attribute
¶
provenance: dict[str, object] = field(default_factory=dict)
Functions¶
resampled
¶
resampled(source_fps: float, target_fps: float) -> NominalQposPlan
Return nearest-neighbor nominal qpos on a new time grid.
resampled_indices
¶
resampled_indices(indices: ndarray) -> NominalQposPlan
Return a copy sampled at frame indices.
with_provenance
¶
with_provenance(**items: object) -> NominalQposPlan
Return a copy with additional JSON-safe provenance.
from_array
classmethod
¶
from_array(
qpos: ArrayLike,
*,
weights: ArrayLike | float = 1.0,
active_mask: ArrayLike | None = None,
provenance: Mapping[str, object] | None = None,
) -> NominalQposPlan
Build a nominal qpos plan from dense arrays.
SmplhMotionJoint
¶
Bases: MotionJoint
Attributes:
Attributes¶
SmplxMotionJoint
¶
Bases: MotionJoint
Attributes:
Attributes¶
SupportPlane
¶
SupportPlane(normal: ArrayLike, origin: ArrayLike, up_axis: int = 2)
Planar support surface used by contact-aware terms.
Methods:
| Name | Description |
|---|---|
clearance |
Signed clearance from the support plane. |
height_at |
Support height at the horizontal coordinates of |
scaled |
Return a copy with positional quantities scaled. |
to_frame |
Return this support plane represented in another frame convention. |
Attributes:
| Name | Type | Description |
|---|---|---|
normal |
FloatArray
|
|
origin |
FloatArray
|
|
up_axis |
int
|
|
Attributes¶
Functions¶
height_at
¶
height_at(points: ArrayLike) -> FloatArray
Support height at the horizontal coordinates of points.
to_frame
¶
to_frame(source: FrameConvention, target: FrameConvention) -> SupportPlane
Return this support plane represented in another frame convention.
TargetFrame
dataclass
¶
TargetFrame(frame_idx: int, tracks: tuple[LinkTargetTrack[LinkT], ...])
Bases: Generic[LinkT]
Per-frame view of link targets.
Attributes:
| Name | Type | Description |
|---|---|---|
frame_idx |
int
|
|
tracks |
tuple[LinkTargetTrack[LinkT], ...]
|
|
samples |
tuple[LinkTargetSample[LinkT], ...]
|
Active target samples at this frame. |
links |
tuple[LinkT, ...]
|
Active typed robot links. |
positions |
FloatArray
|
Active target positions. |
weights |
FloatArray
|
Active target weights. |
Attributes¶
samples
property
¶
samples: tuple[LinkTargetSample[LinkT], ...]
Active target samples at this frame.
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)
frame_convention
class-attribute
instance-attribute
¶
frame_convention: FrameConvention = Z_UP_RIGHT_HANDED
Functions¶
MotionSequence
¶
Bases: BaseModel, Generic[JointT]
Canonical shared-timeline actor motion with a concrete joint vocabulary.
Methods:
| Name | Description |
|---|---|
joint_index |
Return the index of a typed joint. |
joint |
Return positions for one joint with shape |
with_positions |
Return a copy with replacement joint positions. |
scaled |
Return a spatially scaled copy. |
resampled |
Return this motion sampled on a uniform timeline. |
to_frame |
Return this motion represented in another coordinate frame. |
centered_on_root |
Return a sequence translated so |
zeros |
Create a zero-valued fixture motion. |
Attributes:
| Name | Type | Description |
|---|---|---|
model_config |
|
|
name |
str
|
|
joint_vocabulary |
type[JointT]
|
|
joints |
tuple[JointT, ...]
|
|
root_joint |
JointT
|
|
joint_positions |
FloatArray
|
|
timeline |
SampleTimeline
|
|
frame |
FrameConvention
|
|
root_poses |
PoseSequence | None
|
|
source_height_m |
float | None
|
|
provenance |
dict[str, Any]
|
|
frame_count |
int
|
Number of samples. |
joint_count |
int
|
Number of joints. |
fps |
float
|
Nominal sampling rate. |
duration_s |
float
|
Duration between the first and last samples. |
Attributes¶
model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(arbitrary_types_allowed=True)
provenance
class-attribute
instance-attribute
¶
provenance: dict[str, Any] = Field(default_factory=dict)
Functions¶
with_positions
¶
with_positions(
positions: FloatArray | ArrayLike, *, name: str | None = None
) -> MotionSequence[JointT]
Return a copy with replacement joint positions.
scaled
¶
scaled(factor: float, *, name: str | None = None) -> MotionSequence[JointT]
Return a spatially scaled copy.
resampled
¶
resampled(fps: float, *, name: str | None = None) -> MotionSequence[JointT]
Return this motion sampled on a uniform timeline.
to_frame
¶
to_frame(target: FrameConvention, *, name: str | None = None) -> MotionSequence[JointT]
Return this motion represented in another coordinate frame.
centered_on_root
¶
centered_on_root(root_joint: JointT) -> MotionSequence[JointT]
Return a sequence translated so root_joint begins at the origin.
zeros
classmethod
¶
zeros(
name: str,
*,
joint_vocabulary: type[JointT],
joints: tuple[JointT, ...],
root_joint: JointT,
frame_count: int,
fps: float = 30.0,
frame: FrameConvention = Z_UP_RIGHT_HANDED,
) -> MotionSequence[JointT]
Create a zero-valued fixture motion.
FootSupportClassificationConfig
dataclass
¶
FootSupportClassificationConfig(
ground_height_percentile: float = 8.0,
ground_clearance_m: float = 0.035,
ground_speed_mps: float = 0.18,
object_horizontal_distance_m: float = 0.35,
object_height_min_m: float = 0.0,
object_height_max_m: float = 0.14,
object_relative_speed_mps: float = 0.15,
)
Thresholds for ground and moving-object foot support.
Attributes:
| Name | Type | Description |
|---|---|---|
ground_height_percentile |
float
|
|
ground_clearance_m |
float
|
|
ground_speed_mps |
float
|
|
object_horizontal_distance_m |
float
|
|
object_height_min_m |
float
|
|
object_height_max_m |
float
|
|
object_relative_speed_mps |
float
|
|
FootSupportStates
dataclass
¶
FootSupportStates(
air: ContactState, ground: ContactState, observed_object: ContactState
)
Typed categorical values emitted by support classification.
Attributes:
| Name | Type | Description |
|---|---|---|
air |
ContactState
|
|
ground |
ContactState
|
|
observed_object |
ContactState
|
|
Attributes¶
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]
|
|
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¶
alignment_reports
class-attribute
instance-attribute
¶
alignment_reports: tuple[AlignmentReport, ...] = ()
provenance
class-attribute
instance-attribute
¶
provenance: dict[str, object] = field(default_factory=dict)
Functions¶
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.
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¶
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.
SemanticContactTrack
dataclass
¶
SemanticContactTrack(
subject: ContactSubject,
states: tuple[ContactState, ...],
patch: ContactPatch | None = None,
active_states: tuple[ContactState, ...] = (),
support_states: tuple[ContactState, ...] = (),
validity: ndarray | None = None,
provenance: dict[str, object] = dict(),
)
Categorical contact state for one observed subject and patch.
Attributes:
| Name | Type | Description |
|---|---|---|
subject |
ContactSubject
|
|
states |
tuple[ContactState, ...]
|
|
patch |
ContactPatch | None
|
|
active_states |
tuple[ContactState, ...]
|
|
support_states |
tuple[ContactState, ...]
|
|
validity |
ndarray | None
|
|
provenance |
dict[str, object]
|
|
sample_count |
int
|
Number of samples. |
ConstraintContribution
dataclass
¶
ConstraintContribution(
lower: FloatArray | None = None,
upper: FloatArray | None = None,
trust_radius: float | None = None,
linear_constraints: tuple[LinearConstraint, ...] = (),
)
Bounds and linear constraints from one constraint term.
Attributes:
| Name | Type | Description |
|---|---|---|
lower |
FloatArray | None
|
|
upper |
FloatArray | None
|
|
trust_radius |
float | None
|
|
linear_constraints |
tuple[LinearConstraint, ...]
|
|
ObjectiveContribution
dataclass
¶
ObjectiveContribution(matrix: FloatArray, target: FloatArray)
TermContext
dataclass
¶
TermContext(
problem: AnyRetargetingProblem,
compiled: CompiledRetargetingProblem,
backend: KinematicsBackend,
q_current: FloatArray,
q_previous: FloatArray,
frame_idx: int,
contact_frame: CompiledContactFrame | None,
target_frame: CompiledTargetFrame | None,
robot_point_names: tuple[str, ...],
robot_points: FloatArray,
robot_jacobians: FloatArray,
environment_points: FloatArray,
adjacency: tuple[tuple[int, ...], ...],
target_laplacian: FloatArray,
laplacian_weighting: LaplacianWeighting,
laplacian_epsilon: float,
reference_pose: Pose | None,
joint_lower: FloatArray,
joint_upper: FloatArray,
current_joints: FloatArray,
variable_indices: NDArray[int64] | None = None,
current_variables: FloatArray | None = None,
variable_lower: FloatArray | None = None,
variable_upper: FloatArray | None = None,
nominal_qpos_frame: NominalQposFrame | None = None,
)
Per-frame data available to objective and constraint terms.
Terms operate on the actuated-joint increment for the current SQP subproblem. All point arrays and Jacobians are already represented in the local frame relevant to the current task, such as the object frame for dynamic object interaction.
Attributes:
| Name | Type | Description |
|---|---|---|
problem |
RetargetingProblem
|
Parent run specification. |
backend |
KinematicsBackend
|
Kinematics provider for positions and Jacobians. |
q_current |
FloatArray
|
Full |
q_previous |
FloatArray
|
|
frame_idx |
int
|
Zero-based index into the motion sequence. |
contact_frame |
ContactFrame | None
|
Typed contact view for the current frame, when configured. |
target_frame |
TargetFrame | None
|
Typed link-target view for the current frame, when configured. |
robot_point_names |
tuple[str, ...]
|
Link or joint names used for mesh matching. |
robot_points |
FloatArray
|
Robot match points in the task-local frame, shape |
robot_jacobians |
FloatArray
|
Position Jacobians w.r.t. active variables, shape |
environment_points |
FloatArray
|
Scene or object sample points, shape |
adjacency |
tuple[tuple[int, ...], ...]
|
Mesh neighbor indices per vertex. |
target_laplacian |
FloatArray
|
Desired Laplacian coordinates for the interaction mesh. |
laplacian_weighting |
LaplacianWeighting
|
Neighbor weighting used by the current mesh builder. |
laplacian_epsilon |
float
|
Epsilon used by distance-weighted Laplacians. |
reference_pose |
Pose | None
|
Object pose for dynamic scenes; |
joint_lower |
FloatArray
|
Actuated joint lower limits for the current robot. |
joint_upper |
FloatArray
|
Actuated joint upper limits for the current robot. |
current_joints |
FloatArray
|
Actuated joint values extracted from |
variable_indices |
NDArray[int64] | None
|
Qpos indices for active optimization variables. |
current_variables |
FloatArray | None
|
Active qpos values extracted from |
variable_lower |
FloatArray | None
|
Absolute lower bounds for active qpos variables. |
variable_upper |
FloatArray | None
|
Absolute upper bounds for active qpos variables. |
nominal_qpos_frame |
NominalQposFrame | None
|
Optional nominal qpos target view. |
Attributes¶
variable_indices
class-attribute
instance-attribute
¶
variable_indices: NDArray[int64] | None = None
nominal_qpos_frame
class-attribute
instance-attribute
¶
nominal_qpos_frame: NominalQposFrame | None = None
active_qpos_indices
property
¶
active_qpos_indices: NDArray[int64]
Qpos indices represented by the current subproblem variable.
current_variable_values
property
¶
current_variable_values: FloatArray
Current values of active qpos variables.
variable_lower_bounds
property
¶
variable_lower_bounds: FloatArray
Absolute lower bounds for active qpos variables.
variable_upper_bounds
property
¶
variable_upper_bounds: FloatArray
Absolute upper bounds for active qpos variables.
ConstraintConfig
¶
Bases: BaseModel
Base class for constraint configs keyed by an extensible enum member.
Methods:
| Name | Description |
|---|---|
with_enabled |
Return a copy with a different enabled state. |
disabled |
Return a disabled copy. |
Attributes:
| Name | Type | Description |
|---|---|---|
model_config |
|
|
kind |
ConstraintKind
|
|
enabled |
bool
|
|
DiagonalRegularizationObjectiveConfig
¶
Bases: ObjectiveConfig
Penalize selected qpos variables toward zero with diagonal weights.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
|
|
qpos_weights |
tuple[float, ...]
|
|
variable_weights |
tuple[float, ...]
|
|
qpos_weight_overrides |
dict[int, float]
|
|
FootLockConstraintConfig
¶
Bases: ConstraintConfig
Pin exact typed support links or subjects during configured windows.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
|
|
windows |
tuple[FootLockWindow, ...]
|
|
z_floor |
float
|
|
tolerance |
float
|
|
FootStickingConstraintConfig
¶
Bases: ConstraintConfig
Constrain active support links near their previous tangent-plane position.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
|
|
tolerance |
float
|
|
Attributes¶
JointLimitsConstraintConfig
¶
Bases: ConstraintConfig
Box limits on actuated joints.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
|
Attributes¶
LaplacianObjectiveConfig
¶
Bases: ObjectiveConfig
Interaction-mesh Laplacian deformation objective.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
|
LinkTrackingObjectiveConfig
¶
Bases: ObjectiveConfig
Track robot links to a typed target plan.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
|
|
weight_scale |
float
|
|
Attributes¶
NominalTrackingObjectiveConfig
¶
Bases: ObjectiveConfig
Track a nominal posture for typed robot joints or explicit qpos coordinates.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
|
|
weight |
float
|
|
joints |
tuple[RobotJoint, ...]
|
|
qpos_indices |
tuple[int, ...]
|
|
fallback |
NominalFallback
|
|
Attributes¶
NonPenetrationConstraintConfig
¶
Bases: ConstraintConfig
Separate selected typed robot links from support and explicit geometry.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
|
|
links |
tuple[RobotLink, ...]
|
|
subjects |
tuple[ContactSubject, ...]
|
|
sources |
tuple[NonPenetrationSource, ...]
|
|
geometry_pairs |
tuple[GeometryPair, ...]
|
|
tolerance |
float
|
|
floor_z |
float
|
|
scene_clearance |
float
|
|
activation_distance |
float | None
|
|
Attributes¶
sources
class-attribute
instance-attribute
¶
sources: tuple[NonPenetrationSource, ...] = (SUPPORT, SCENE_POINTS, GEOMETRY)
ObjectiveConfig
¶
Bases: BaseModel
Base class for objective configs keyed by an extensible enum member.
Methods:
| Name | Description |
|---|---|
with_weight |
Return a copy with a different objective weight. |
Attributes:
| Name | Type | Description |
|---|---|---|
model_config |
|
|
kind |
ObjectiveKind
|
|
weight |
float
|
|
OptimizationProfile
¶
Bases: BaseModel
Reusable typed objective/constraint composition.
Methods:
| Name | Description |
|---|---|
defaults |
Return default robot-only optimization terms. |
objective |
Return the last objective matching |
constraint |
Return the last constraint matching |
with_objective |
|
without_objective |
|
with_constraint |
|
without_constraint |
|
validate_registry_references |
|
Attributes:
| Name | Type | Description |
|---|---|---|
model_config |
|
|
name |
str
|
|
objectives |
tuple[ObjectiveConfig, ...]
|
|
constraints |
tuple[ConstraintConfig, ...]
|
|
provenance |
dict[str, object]
|
|
objective_kinds |
tuple[ObjectiveKind, ...]
|
Objective kinds in profile order. |
constraint_kinds |
tuple[ConstraintKind, ...]
|
Constraint kinds in profile order. |
Attributes¶
model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(arbitrary_types_allowed=True)
provenance
class-attribute
instance-attribute
¶
provenance: dict[str, object] = Field(default_factory=dict)
objective_kinds
property
¶
objective_kinds: tuple[ObjectiveKind, ...]
Objective kinds in profile order.
constraint_kinds
property
¶
constraint_kinds: tuple[ConstraintKind, ...]
Constraint kinds in profile order.
Functions¶
defaults
classmethod
¶
defaults(*, name: str = 'default') -> OptimizationProfile
Return default robot-only optimization terms.
objective
¶
objective(kind: ObjectiveKind) -> ObjectiveConfig | None
Return the last objective matching kind.
constraint
¶
constraint(kind: ConstraintKind) -> ConstraintConfig | None
Return the last constraint matching kind.
validate_registry_references
¶
validate_registry_references(solver: SolverSpec | None = None) -> None
SelfCollisionConstraintConfig
¶
Bases: ConstraintConfig
Maintain minimum separation between explicit typed robot geometry pairs.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
|
|
pairs |
tuple[GeometryPair, ...]
|
|
minimum_distance |
float
|
|
margin |
float | None
|
|
windows |
tuple[tuple[int, int], ...] | None
|
|
Attributes¶
SmoothnessObjectiveConfig
¶
Bases: ObjectiveConfig
Penalize changes from the previous frame.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
|
Attributes¶
SolverSpec
¶
Bases: BaseModel
Solver selection and common options.
Attributes:
| Name | Type | Description |
|---|---|---|
model_config |
|
|
backend |
SolverKind
|
|
max_iterations |
int
|
|
first_frame_iterations |
int | None
|
|
trust_radius |
float
|
|
tolerance |
float
|
|
convergence |
ConvergenceMode
|
|
cost_atol |
float
|
|
cost_rtol |
float
|
|
verbose |
bool
|
|
TrustRegionConstraintConfig
¶
Bases: ConstraintConfig
Cap the Euclidean norm of each SQP update.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
|
|
radius |
float | None
|
|
Attributes¶
QposVariableSpec
¶
Bases: BaseModel
Configuration describing which qpos coordinates the optimizer may change.
actuated preserves the package default: only robot joints are decision
variables. qpos_slice and qpos_indices allow floating-base,
Holosoma-style, or otherwise custom variable sets without changing terms.
Methods:
| Name | Description |
|---|---|
actuated |
Return the default actuated-joint variable policy. |
qpos_slice |
Return a contiguous qpos variable policy. |
qpos_indices |
Return an explicit qpos-index variable policy. |
from_actuated_start_offset |
Return a slice starting relative to |
holosoma_q_a |
Return the variable policy matching Holosoma's default |
resolve |
Resolve this policy against a robot and concrete qpos width. |
Attributes:
| Name | Type | Description |
|---|---|---|
model_config |
|
|
kind |
QposVariableKind
|
|
start |
int | None
|
|
stop |
int | None
|
|
indices |
tuple[int, ...]
|
|
actuated_start_offset |
int | None
|
|
unbounded_limit |
float
|
|
normalize_quaternion |
bool
|
|
Attributes¶
Functions¶
qpos_slice
classmethod
¶
qpos_slice(
*, start: int, stop: int | None = None, normalize_quaternion: bool = True
) -> Self
Return a contiguous qpos variable policy.
qpos_indices
classmethod
¶
qpos_indices(indices: tuple[int, ...], *, normalize_quaternion: bool = True) -> Self
Return an explicit qpos-index variable policy.
from_actuated_start_offset
classmethod
¶
from_actuated_start_offset(offset: int, *, stop: int | None = None) -> Self
Return a slice starting relative to robot.qpos_layout.joint_start.
Holosoma's q_a_init_idx=-7 is represented by
from_actuated_start_offset(-7) for the default floating-base qpos
layout, giving a variable slice from root position through actuated
joints.
holosoma_q_a
classmethod
¶
holosoma_q_a(q_a_init_idx: int = -7) -> Self
Return the variable policy matching Holosoma's default q_a slice.
resolve
¶
resolve(
robot: RobotSpec[JointT, Any, Any, Any],
*,
qpos_size: int,
joint_limits: Mapping[JointT, tuple[float, float]] | None = None,
) -> ResolvedQposVariables
Resolve this policy against a robot and concrete qpos width.
ResolvedQposVariables
dataclass
¶
ResolvedQposVariables(
spec: QposVariableSpec,
indices: NDArray[int64],
lower: FloatArray,
upper: FloatArray,
quaternion_slice: tuple[int, int] | None = None,
)
Resolved qpos coordinates used as one SQP subproblem variable.
The solver still optimizes an increment vector, but the columns can now
refer to any qpos coordinate, not only actuated joints. This is the
abstraction needed for floating-base q_a style solves.
Methods:
| Name | Description |
|---|---|
values |
Return this variable set's current qpos values. |
apply_delta |
Return a copy of |
Attributes:
| Name | Type | Description |
|---|---|---|
spec |
QposVariableSpec
|
|
indices |
NDArray[int64]
|
|
lower |
FloatArray
|
|
upper |
FloatArray
|
|
quaternion_slice |
tuple[int, int] | None
|
|
size |
int
|
Number of optimization variables. |
BatchJob
¶
Bases: BaseModel
One retargeting job in a batch run.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Stable job identifier used in manifests and resume logic. |
motion |
Path
|
Input motion artifact path for the worker. |
output |
Path
|
Expected output artifact path; existing files may be skipped. |
name |
str | None
|
Optional display name; defaults to |
motion_format |
MotionFormatKind | None
|
Typed source motion format override. |
robot |
RobotKind | None
|
Typed robot registry override. |
config_path |
Path | None
|
Optional declarative experiment config. |
provenance |
dict[str, Any]
|
Origin and scheduling history for the job. |
BatchManifest
¶
Bases: BaseModel
Manifest written by resumable batch runs.
Attributes:
| Name | Type | Description |
|---|---|---|
schema_version |
int
|
Manifest format version for forward compatibility. |
created_at |
datetime
|
UTC time when the batch run first started. |
updated_at |
datetime
|
UTC time of the most recent manifest write. |
input_dir |
Path | None
|
Root directory scanned for input motions, if known. |
output_dir |
Path | None
|
Root directory for written outputs, if known. |
pattern |
str
|
Glob or filter pattern used to build the job list. |
total |
int
|
Number of jobs in the batch definition. |
success_count |
int
|
Jobs that completed with :attr: |
skipped_count |
int
|
Jobs skipped because outputs already existed. |
failed_count |
int
|
Jobs that raised during execution. |
records |
tuple[BatchRunRecord, ...]
|
Per-job outcomes in submission order. |
Methods:
| Name | Description |
|---|---|
from_records |
Build a manifest and derive summary counts from records. |
load |
Load a manifest JSON file. |
save_json |
Save manifest JSON. |
records_by_id |
Return records keyed by job id. |
Attributes¶
model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(arbitrary_types_allowed=True)
Functions¶
from_records
classmethod
¶
from_records(
*,
records: Iterable[BatchRunRecord],
total: int,
created_at: datetime,
input_dir: Path | None = None,
output_dir: Path | None = None,
pattern: str = "",
) -> BatchManifest
Build a manifest and derive summary counts from records.
BatchRunner
¶
Execute jobs with resume-aware manifest updates.
The worker must be pickleable when max_workers is greater than one.
Methods:
| Name | Description |
|---|---|
run |
Run jobs, skip existing outputs, and update a manifest incrementally. |
Functions¶
run
¶
run(
jobs: Iterable[BatchJob],
worker: BatchWorker,
*,
manifest_path: str | Path,
max_workers: int = 1,
force: bool = False,
input_dir: Path | None = None,
output_dir: Path | None = None,
pattern: str = "",
) -> BatchManifest
Run jobs, skip existing outputs, and update a manifest incrementally.
Loads an existing manifest at manifest_path when present so reruns can
resume. Jobs whose output already exists are marked skipped unless
force is true. After each completed (or skipped) job the manifest is
rewritten so partial progress survives interruption.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jobs
|
Iterable[BatchJob]
|
Iterable of retargeting jobs to execute. |
required |
worker
|
BatchWorker
|
Pickleable callable invoked per pending job; must accept a
:class: |
required |
manifest_path
|
str | Path
|
JSON manifest path updated after each job finishes. |
required |
max_workers
|
int
|
Process pool size; |
1
|
force
|
bool
|
When true, rerun jobs even if |
False
|
input_dir
|
Path | None
|
Optional batch input root stored on the manifest. |
None
|
output_dir
|
Path | None
|
Optional batch output root stored on the manifest. |
None
|
pattern
|
str
|
Optional glob or filter label stored on the manifest. |
''
|
Returns:
| Type | Description |
|---|---|
BatchManifest
|
Final manifest aggregating all job records and summary counts. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
BatchRunRecord
¶
Bases: BaseModel
Recorded outcome for one batch job.
Attributes:
| Name | Type | Description |
|---|---|---|
job_id |
str
|
Identifier matching :attr: |
motion |
Path
|
Input path from the job definition. |
output |
Path
|
Output path from the job definition. |
status |
RunStatus
|
Terminal status (success, skipped, or failed). |
started_at |
datetime
|
UTC timestamp when execution began. |
finished_at |
datetime
|
UTC timestamp when execution completed. |
message |
str
|
Human-readable summary or error text. |
error_type |
str | None
|
Exception class name when |
provenance |
dict[str, Any]
|
Worker-returned processing history or resume information. |
InteractionMeshRetargetingEngine
¶
InteractionMeshRetargetingEngine(
*,
kinematics: KinematicsBackend | None = None,
mesh_builder: InteractionMeshBuilder | None = None,
)
Backend-agnostic interaction-mesh SQP retargeter.
The engine builds one local quadratic problem per SQP iteration. Its decision variable is the actuated-joint increment for the current frame. Root and object poses are locked from the motion/scene specification.
Methods:
| Name | Description |
|---|---|
run |
Run interaction-mesh retargeting for all frames. |
Attributes:
| Name | Type | Description |
|---|---|---|
kinematics |
KinematicsBackend | None
|
|
mesh_builder |
InteractionMeshBuilder | None
|
|
Attributes¶
Functions¶
run
¶
run(problem: RetargetingProblem) -> EngineOutput
Run interaction-mesh retargeting for all frames.
RetargetingExperiment
¶
RetargetingExperiment(
*,
observation: ObservationRecipe | SceneObservation,
recipe: RetargetingRecipe,
robot: RobotSpec,
retargeter: Retargeter | None = None,
retargeter_factory: Callable[[RetargetingProblem], Retargeter] | None = None,
)
Compose observation processing, robot adaptation, and optimization.
Methods:
| Name | Description |
|---|---|
observe |
Process capture inputs once and retain the in-memory observation. |
build_problem |
Adapt the observation to the configured robot. |
run |
Run the complete in-memory experiment. |
Attributes:
| Name | Type | Description |
|---|---|---|
recipe |
|
|
robot |
|
|
retargeter |
|
|
retargeter_factory |
|
Attributes¶
Functions¶
observe
¶
observe() -> SceneObservation
Process capture inputs once and retain the in-memory observation.
build_problem
¶
build_problem() -> RetargetingProblem
Adapt the observation to the configured robot.
RetargetingProblem
¶
Bases: BaseModel, Generic[MotionJointT, RobotJointT, RobotLinkT, RobotGeometryT, RobotRoleT]
Complete typed run specification before backend compilation.
Methods:
| Name | Description |
|---|---|
joint_mapping |
Return the typed motion-joint to robot-joint mapping. |
link_mapping |
Return the typed motion-joint to robot-link mapping. |
validate_registry_references |
Validate registered optimization references used by this problem. |
with_optimization_profile |
Return a copy using one reusable optimization profile. |
with_output_fps_applied |
Return a problem whose dynamic data matches |
Attributes:
| Name | Type | Description |
|---|---|---|
model_config |
|
|
name |
str
|
|
task_kind |
TaskKind
|
|
robot |
RobotSpec[RobotJointT, RobotLinkT, RobotGeometryT, RobotRoleT]
|
|
motion |
MotionSequence[MotionJointT]
|
|
scene |
SceneSpec
|
|
contacts |
ContactPlan[Any, Any, Any, RobotLinkT] | None
|
|
targets |
LinkTargetPlan[RobotLinkT] | None
|
|
initial_qpos |
InitialQposPlan | None
|
|
nominal_qpos |
NominalQposPlan | None
|
|
joint_bindings |
tuple[JointBinding[MotionJointT, RobotJointT], ...]
|
|
link_bindings |
tuple[LinkBinding[MotionJointT, RobotLinkT], ...]
|
|
mesh |
InteractionMeshSpec
|
|
solver |
SolverSpec
|
|
variables |
QposVariableSpec
|
|
objectives |
tuple[ObjectiveConfig, ...]
|
|
constraints |
tuple[ConstraintConfig, ...]
|
|
scale_to_robot |
bool
|
|
output_fps |
float | None
|
|
show_progress |
bool
|
|
progress_description |
str | None
|
|
provenance |
dict[str, Any]
|
|
fps |
float
|
Effective playback and result sampling rate. |
Attributes¶
model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(arbitrary_types_allowed=True)
contacts
class-attribute
instance-attribute
¶
contacts: ContactPlan[Any, Any, Any, RobotLinkT] | None = None
joint_bindings
class-attribute
instance-attribute
¶
joint_bindings: tuple[JointBinding[MotionJointT, RobotJointT], ...] = ()
link_bindings
class-attribute
instance-attribute
¶
link_bindings: tuple[LinkBinding[MotionJointT, RobotLinkT], ...] = ()
mesh
class-attribute
instance-attribute
¶
mesh: InteractionMeshSpec = Field(default_factory=InteractionMeshSpec)
variables
class-attribute
instance-attribute
¶
variables: QposVariableSpec = Field(default_factory=actuated)
objectives
class-attribute
instance-attribute
¶
objectives: tuple[ObjectiveConfig, ...] = objectives
constraints
class-attribute
instance-attribute
¶
constraints: tuple[ConstraintConfig, ...] = constraints
provenance
class-attribute
instance-attribute
¶
provenance: dict[str, Any] = Field(default_factory=dict)
Functions¶
joint_mapping
¶
joint_mapping() -> dict[MotionJointT, RobotJointT]
Return the typed motion-joint to robot-joint mapping.
link_mapping
¶
link_mapping() -> dict[MotionJointT, RobotLinkT]
Return the typed motion-joint to robot-link mapping.
validate_registry_references
¶
validate_registry_references() -> None
Validate registered optimization references used by this problem.
with_optimization_profile
¶
with_optimization_profile(
profile: OptimizationProfile,
) -> RetargetingProblem[
MotionJointT, RobotJointT, RobotLinkT, RobotGeometryT, RobotRoleT
]
Return a copy using one reusable optimization profile.
with_output_fps_applied
¶
with_output_fps_applied() -> RetargetingProblem[
MotionJointT, RobotJointT, RobotLinkT, RobotGeometryT, RobotRoleT
]
Return a problem whose dynamic data matches output_fps.
ObservationRecipe
¶
RetargetingRecipe
¶
Bases: Protocol
Adapt a scene observation to one target robot.
Methods:
| Name | Description |
|---|---|
build_problem |
Build a complete retargeting problem. |
Functions¶
build_problem
¶
build_problem(observation: SceneObservation, robot: RobotSpec) -> RetargetingProblem
Build a complete retargeting problem.
SceneRecipe
¶
Bases: Protocol
Build target-independent runtime scene data from an observation.
Methods:
| Name | Description |
|---|---|
build_scene |
Build a frame-aligned scene. |
Functions¶
Retargeter
¶
Retargeter(*, engine: InteractionMeshRetargetingEngine | None = None)
Run a RetargetingProblem and return a typed result.
Methods:
| Name | Description |
|---|---|
run |
Retarget a motion sequence. |
Attributes:
| Name | Type | Description |
|---|---|---|
engine |
InteractionMeshRetargetingEngine
|
|
Attributes¶
engine
instance-attribute
¶
engine: InteractionMeshRetargetingEngine = engine or InteractionMeshRetargetingEngine()
Functions¶
MotionFileObservationRecipe
dataclass
¶
MotionFileObservationRecipe(
path: Path,
motion_format: MotionFormatSpec,
name: str | None = None,
max_frames: int | None = None,
source_height_m: float | None = None,
)
Load a registered motion file into a typed scene observation.
Methods:
| Name | Description |
|---|---|
registered |
Construct from a registered motion-format key. |
observe |
Load the file without creating an intermediate checkpoint. |
Attributes:
| Name | Type | Description |
|---|---|---|
path |
Path
|
|
motion_format |
MotionFormatSpec
|
|
name |
str | None
|
|
max_frames |
int | None
|
|
source_height_m |
float | None
|
|
Attributes¶
Functions¶
registered
classmethod
¶
registered(
path: str | Path,
format_kind: MotionFormatKind,
*,
name: str | None = None,
max_frames: int | None = None,
source_height_m: float | None = None,
) -> MotionFileObservationRecipe
Construct from a registered motion-format key.
RobotOnlySceneRecipe
dataclass
¶
RobotOnlySceneRecipe(
terrain: TerrainSpec = TerrainSpec(),
ground_range: tuple[float, float] = (-1.0, 1.0),
ground_size: int = 15,
)
Build a flat-ground robot-only scene.
Methods:
| Name | Description |
|---|---|
build_scene |
Build the scene independently of the target robot. |
Attributes:
| Name | Type | Description |
|---|---|---|
terrain |
TerrainSpec
|
|
ground_range |
tuple[float, float]
|
|
ground_size |
int
|
|
Attributes¶
terrain
class-attribute
instance-attribute
¶
terrain: TerrainSpec = field(default_factory=TerrainSpec)
Functions¶
build_scene
¶
build_scene(observation: SceneObservation) -> SceneSpec
Build the scene independently of the target robot.
RoleRetargetingRecipe
dataclass
¶
RoleRetargetingRecipe(
task_kind: TaskKind,
motion_format: MotionFormatSpec,
scene: SceneRecipe,
joint_roles: dict[MotionJoint, RobotRole] = dict(),
link_roles: dict[MotionJoint, RobotRole] = dict(),
mesh: InteractionMeshSpec = InteractionMeshSpec(),
solver: SolverSpec = SolverSpec(),
variables: QposVariableSpec = actuated(),
objectives: tuple[ObjectiveConfig, ...] = objectives,
constraints: tuple[ConstraintConfig, ...] = constraints,
scale_to_robot: bool = True,
output_fps: float | None = None,
show_progress: bool = False,
name: str | None = None,
provenance: dict[str, object] = dict(),
)
Resolve typed motion joints through semantic robot roles.
Methods:
| Name | Description |
|---|---|
build_problem |
Build the generic problem through explicit semantic role bindings. |
Attributes:
| Name | Type | Description |
|---|---|---|
task_kind |
TaskKind
|
|
motion_format |
MotionFormatSpec
|
|
scene |
SceneRecipe
|
|
joint_roles |
dict[MotionJoint, RobotRole]
|
|
link_roles |
dict[MotionJoint, RobotRole]
|
|
mesh |
InteractionMeshSpec
|
|
solver |
SolverSpec
|
|
variables |
QposVariableSpec
|
|
objectives |
tuple[ObjectiveConfig, ...]
|
|
constraints |
tuple[ConstraintConfig, ...]
|
|
scale_to_robot |
bool
|
|
output_fps |
float | None
|
|
show_progress |
bool
|
|
name |
str | None
|
|
provenance |
dict[str, object]
|
|
Attributes¶
joint_roles
class-attribute
instance-attribute
¶
joint_roles: dict[MotionJoint, RobotRole] = field(default_factory=dict)
link_roles
class-attribute
instance-attribute
¶
link_roles: dict[MotionJoint, RobotRole] = field(default_factory=dict)
mesh
class-attribute
instance-attribute
¶
mesh: InteractionMeshSpec = field(default_factory=InteractionMeshSpec)
variables
class-attribute
instance-attribute
¶
variables: QposVariableSpec = field(default_factory=actuated)
objectives
class-attribute
instance-attribute
¶
objectives: tuple[ObjectiveConfig, ...] = objectives
constraints
class-attribute
instance-attribute
¶
constraints: tuple[ConstraintConfig, ...] = constraints
provenance
class-attribute
instance-attribute
¶
provenance: dict[str, object] = field(default_factory=dict)
Functions¶
build_problem
¶
build_problem(observation: SceneObservation, robot: RobotSpec) -> RetargetingProblem
Build the generic problem through explicit semantic role bindings.
StaticSceneRecipe
dataclass
¶
StaticSceneRecipe(scene: SceneSpec)
Return a predeclared target-independent scene specification.
Methods:
| Name | Description |
|---|---|
build_scene |
Validate the scene timeline and return the configured scene. |
Attributes:
| Name | Type | Description |
|---|---|---|
scene |
SceneSpec
|
|
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 |
success_count |
int
|
Records with :attr: |
partial_count |
int
|
Records with :attr: |
skipped_count |
int
|
Records with :attr: |
failed_count |
int
|
Records with :attr: |
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)
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.
EvaluationRecord
¶
Bases: BaseModel
Recorded outcome for evaluating one retargeting result.
Attributes:
| Name | Type | Description |
|---|---|---|
result_path |
Path
|
Path to the evaluated |
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 |
metrics |
dict[str, float]
|
Scalar metrics copied from the report. |
warnings |
tuple[str, ...]
|
Warnings surfaced during evaluation. |
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 |
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 |
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. |
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 |
load_npz |
Load the current strict |
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)
human_vocabulary
class-attribute
instance-attribute
¶
human_vocabulary: VocabularyManifest | None = None
robot_link_positions
class-attribute
instance-attribute
¶
robot_link_positions: FloatArray | None = None
provenance
class-attribute
instance-attribute
¶
provenance: dict[str, Any] = Field(default_factory=dict)
Functions¶
resampled
¶
resampled(fps: float, *, name: str | None = None) -> RetargetingResult
Return this result sampled on a new FPS grid.
load_npz
classmethod
¶
load_npz(path: str | Path) -> RetargetingResult
Load the current strict .npz checkpoint schema.
JointLimit
¶
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¶
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.
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 |
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)
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
class-attribute
instance-attribute
¶
link_roles: dict[RoleT, LinkT] = Field(default_factory=dict)
link_groups
class-attribute
instance-attribute
¶
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
)
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)
Functions¶
joint_for_role
¶
joint_for_role(role: RoleT) -> JointT
Resolve a semantic robot role to an actuated joint.
links_for_role
¶
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.
RobotVocabulary
¶
Bases: BaseModel, Generic[JointT, LinkT, GeometryT, RoleT]
Concrete enum classes used by one robot specification.
Attributes:
| Name | Type | Description |
|---|---|---|
model_config |
|
|
joints |
type[JointT]
|
|
links |
type[LinkT]
|
|
geometries |
type[GeometryT]
|
|
roles |
type[RoleT]
|
|
SimpleKinematicPoint
¶
Bases: BaseModel, Generic[JointT]
Explicit fixture kinematics for one robot link.
Attributes:
| Name | Type | Description |
|---|---|---|
model_config |
|
|
joint |
JointT
|
|
offset |
tuple[float, float, float]
|
|
axis |
tuple[float, float, float]
|
|
scale |
float
|
|
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 |
sample_space |
ObjectSampleSpace
|
Coordinate space for |
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)
asset_scale
class-attribute
instance-attribute
¶
asset_scale: tuple[float, float, float] = (1.0, 1.0, 1.0)
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¶
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.
ObjectVisualPart
¶
Bases: BaseModel
A renderable object mesh part with optional material styling.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Stable part label used in scene paths. |
mesh_path |
Path
|
Mesh file for this visual part. |
asset_scale |
tuple[float, float, float] | None
|
Optional part-local scale; inherits the parent object scale when omitted by playback spec builders. |
rgba |
tuple[float, float, float, float] | None
|
Optional material color with alpha in |
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: |
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)
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
|
|
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
|
|
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
|
|
has_dynamic_object
¶
has_dynamic_object() -> bool
Whether qpos should include appended object poses.
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 |
provenance |
dict[str, Any]
|
Origin and processing history for terrain. |
Functions¶
estimate_clock_offset
¶
estimate_clock_offset(
reference_timeline: SampleTimeline,
reference_signal: FloatArray,
moving_timeline: SampleTimeline,
moving_signal: FloatArray,
config: TemporalRegistrationConfig,
*,
target_clock: str = "observation",
) -> AlignmentReport
Estimate an offset mapping moving_timeline into reference_timeline.
register_rigid_points
¶
register_rigid_points(
source: FloatArray, target: FloatArray, *, maximum_rms_error: float | None = None
) -> tuple[RigidTransform, AlignmentReport]
Estimate a Kabsch rigid transform from corresponding finite points.
convert_points_frame
¶
convert_points_frame(
points: Any, source: FrameConvention, target: FrameConvention
) -> FloatArray
Convert point coordinates between supported right-handed frame conventions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
points
|
Any
|
Array-like positions with trailing dimension 3. |
required |
source
|
FrameConvention
|
Convention of the input coordinates. |
required |
target
|
FrameConvention
|
Desired output convention. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
FloatArray |
FloatArray
|
Points re-expressed in |
frame_transform_matrix
¶
frame_transform_matrix(source: FrameConvention, target: FrameConvention) -> FloatArray
Return the rotation matrix that maps coordinates from source to target.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
FrameConvention
|
Input coordinate convention. |
required |
target
|
FrameConvention
|
Output coordinate convention. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
FloatArray |
FloatArray
|
|
reorder_quaternion
¶
reorder_quaternion(
quaternion: ndarray, source: QuaternionOrder, target: QuaternionOrder
) -> ndarray
Convert quaternion storage order without changing the represented rotation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quaternion
|
ndarray
|
Quaternion components in |
required |
source
|
QuaternionOrder
|
Storage order of |
required |
target
|
QuaternionOrder
|
Desired storage order. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: Quaternion with the same rotation in |
reorder_quaternions
¶
reorder_quaternions(
quaternions: Any,
source: QuaternionOrder,
target: QuaternionOrder,
*,
axis: int = -1,
) -> FloatArray
Convert quaternion storage order along one array axis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quaternions
|
Any
|
Array-like quaternion components with length 4 along |
required |
source
|
QuaternionOrder
|
Storage order of |
required |
target
|
QuaternionOrder
|
Desired storage order. |
required |
axis
|
int
|
Axis containing quaternion components. |
-1
|
Returns:
| Name | Type | Description |
|---|---|---|
FloatArray |
FloatArray
|
Copy with the same rotations in |
resample_linear
¶
resample_linear(values: Any, source_fps: float, target_fps: float) -> FloatArray
Linearly resample an array whose first axis is time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values
|
Any
|
Array-like data with time as axis 0. |
required |
source_fps
|
float
|
Source sampling rate in Hz. |
required |
target_fps
|
float
|
Target sampling rate in Hz. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
FloatArray |
FloatArray
|
Resampled array with the same trailing dimensions as |
resampling_times
¶
resampling_times(
frame_count: int, source_fps: float, target_fps: float
) -> tuple[FloatArray, FloatArray]
Return source and target sample times for endpoint-preserving interpolation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frame_count
|
int
|
Number of frames in the source sequence. |
required |
source_fps
|
float
|
Source sampling rate in Hz. |
required |
target_fps
|
float
|
Target sampling rate in Hz. |
required |
Returns:
| Type | Description |
|---|---|
tuple[FloatArray, FloatArray]
|
tuple[FloatArray, FloatArray]: |
sample_mesh_points
¶
sample_mesh_points(path: str | Path, *, count: int = 128) -> FloatArray
Return deterministic surface samples for a mesh file.
OBJ files are parsed without optional dependencies. Other mesh formats use
trimesh when it is installed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Mesh file path ( |
required |
count
|
int
|
Number of sample points to return. |
128
|
Returns:
| Name | Type | Description |
|---|---|---|
FloatArray |
FloatArray
|
Sampled points with shape |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
ImportError
|
If a non-OBJ format is requested without |
classify_foot_support
¶
classify_foot_support(
*,
timeline: SampleTimeline,
left_foot: PointTrack,
right_foot: PointTrack,
observed_object: PointTrack,
left_subject: ContactSubject,
right_subject: ContactSubject,
left_patch: ContactPatch,
right_patch: ContactPatch,
states: FootSupportStates,
config: FootSupportClassificationConfig | None = None,
) -> SemanticContactSequence
Classify feet as air, ground, or supported by an observed object.