Observation And Recipes¶
Target-independent scene observations and built-in experiment recipes.
observation
¶
Target-independent scene observations.
Modules:
| Name | Description |
|---|---|
contact |
Target-independent semantic contact observations. |
spec |
Canonical target-independent scene observations. |
support |
Typed support-contact classification for observed point tracks. |
Classes:
| Name | Description |
|---|---|
SemanticContactSequence |
Robot-independent semantic contacts and support geometry. |
SemanticContactTrack |
Categorical contact state for one observed subject and patch. |
ObservedObject |
Observed object geometry and pose, independent of a target robot. |
SceneObservation |
Shared-timeline result of capture processing before robot adaptation. |
FootSupportClassificationConfig |
Thresholds for ground and moving-object foot support. |
FootSupportStates |
Typed categorical values emitted by support classification. |
Functions:
| Name | Description |
|---|---|
classify_foot_support |
Classify feet as air, ground, or supported by an observed object. |
Attributes:
| Name | Type | Description |
|---|---|---|
__all__ |
|
Attributes¶
__all__
module-attribute
¶
__all__ = [
"FootSupportClassificationConfig",
"FootSupportStates",
"ObservedObject",
"SceneObservation",
"SemanticContactSequence",
"SemanticContactTrack",
"classify_foot_support",
]
Classes¶
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. |
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.
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¶
Functions¶
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.
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.
generic
¶
Generic typed recipes for registered motion files and configured runs.
Classes:
| Name | Description |
|---|---|
MotionFormatKind |
Base enum for motion-format registrations. |
MotionJoint |
Base enum for source motion joint names. |
RobotRole |
Base enum for semantic roles resolved by a robot specification. |
TaskKind |
Supported high-level retargeting workflows. |
PoseSequence |
Time-indexed sequence of poses. |
InteractionMeshSpec |
Configuration for interaction mesh construction. |
MotionFormatSpec |
Concrete source-motion vocabulary and storage conventions. |
SceneObservation |
Shared-timeline result of capture processing before robot adaptation. |
ConstraintConfig |
Base class for constraint configs keyed by an extensible enum member. |
ObjectiveConfig |
Base class for objective configs keyed by an extensible enum member. |
OptimizationProfile |
Reusable typed objective/constraint composition. |
SolverSpec |
Solver selection and common options. |
QposVariableSpec |
Configuration describing which qpos coordinates the optimizer may change. |
JointBinding |
Explicit source-motion joint to robot-joint binding. |
LinkBinding |
Explicit source-motion joint to robot-link binding. |
RetargetingProblem |
Complete typed run specification before backend compilation. |
SceneRecipe |
Build target-independent runtime scene data from an observation. |
RobotSpec |
Robot description that preserves enum identity until backend compilation. |
SceneSpec |
Scene configuration for a retargeting run. |
TerrainSpec |
Static terrain information. |
MotionFileObservationRecipe |
Load a registered motion file into a typed scene observation. |
RobotOnlySceneRecipe |
Build a flat-ground robot-only scene. |
StaticSceneRecipe |
Return a predeclared target-independent scene specification. |
RoleRetargetingRecipe |
Resolve typed motion joints through semantic robot roles. |
Functions:
| Name | Description |
|---|---|
load_motion |
Load a motion sequence using a registered format and suffix loader. |
Attributes:
| Name | Type | Description |
|---|---|---|
motion_formats |
Registry[MotionFormatKind, MotionFormatSpec]
|
Registry of built-in :class: |
Attributes¶
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.
Classes¶
MotionFormatKind
¶
Bases: RegistryKind
Base enum for motion-format 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 ( |
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. |
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
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¶
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.
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
|
|
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
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
|
|
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.
JointBinding
dataclass
¶
JointBinding(source: MotionJointT, target: RobotJointT)
LinkBinding
dataclass
¶
LinkBinding(source: MotionJointT, target: RobotLinkT)
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.
SceneRecipe
¶
Bases: Protocol
Build target-independent runtime scene data from an observation.
Methods:
| Name | Description |
|---|---|
build_scene |
Build a frame-aligned scene. |
Functions¶
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.
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. |
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.
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
|
|
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.
Functions¶
load_motion
¶
load_motion(
path: str | Path,
motion_format: MotionFormatKind | MotionFormatSpec,
*,
name: str | None = None,
) -> MotionSequence
Load a motion sequence using a registered format and suffix loader.
The returned sequence is converted to :attr:~retarget.core.enums.FrameConvention.Z_UP_RIGHT_HANDED.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Motion file path; the suffix selects the loader. |
required |
motion_format
|
MotionFormatKind | MotionFormatSpec
|
Typed registered motion format key or a concrete format specification. |
required |
name
|
str | None
|
Optional sequence name; defaults to the file stem. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
MotionSequence |
MotionSequence
|
Parsed motion in Z-up world coordinates. |
Raises:
| Type | Description |
|---|---|
KeyError
|
If the format name or file suffix is not registered. |
ValueError
|
If the file content fails validation. |
skateboarding
¶
Unified capture-to-retarget skateboarding workflow.
Modules:
| Name | Description |
|---|---|
adaptation |
Robot adaptation recipe for skateboarding observations. |
alignment |
Temporal and spatial registration for skateboarding capture. |
observation |
Observation recipe for native skateboarding capture. |
scene |
Target-independent and runtime scene construction for skateboarding. |
schema |
Source schemas and semantic mappings for skateboarding. |
targets |
Robot-resolved link targets for skateboarding observations. |
vocabulary |
Typed native, semantic, and contact vocabularies for skateboarding. |
Classes:
| Name | Description |
|---|---|
SkateboardingRetargetingRecipe |
Adapt a skateboarding observation to a semantic humanoid robot. |
SkateboardingObservationRecipe |
Fuse native mocap and human-pose recordings into one observation. |
SkateboardingContactPatch |
Contact patches. |
SkateboardingContactState |
Foot support states. |
SkateboardingContactSubject |
Semantic contact subjects. |
SkateboardingDemo |
Bundled skateboarding capture identifiers. |
SkateboardingGeometryName |
Observed geometry names. |
SkateboardingMotionJoint |
GVHMR/SMPL-X joints used by the workflow. |
SkateboardingObservationRole |
Target-independent semantic landmarks and objects. |
SkateboardingRigidBody |
Native Vicon rigid bodies. |
Attributes:
| Name | Type | Description |
|---|---|---|
GVHMR_SCHEMA |
|
|
VICON_SCHEMA |
|
|
DEFAULT_DEMO |
|
|
__all__ |
|
Attributes¶
GVHMR_SCHEMA
module-attribute
¶
GVHMR_SCHEMA = HumanPoseSourceSchema(
joint_indices={
PELVIS: 0,
LEFT_HIP: 1,
RIGHT_HIP: 2,
LEFT_KNEE: 4,
RIGHT_KNEE: 5,
SPINE2: 6,
LEFT_ANKLE: 7,
RIGHT_ANKLE: 8,
SPINE3: 9,
LEFT_FOOT: 10,
RIGHT_FOOT: 11,
NECK: 12,
HEAD: 15,
LEFT_SHOULDER: 16,
RIGHT_SHOULDER: 17,
LEFT_ELBOW: 18,
RIGHT_ELBOW: 19,
LEFT_WRIST: 20,
RIGHT_WRIST: 21,
LEFT_BIG_TOE: 60,
LEFT_SMALL_TOE: 61,
LEFT_HEEL: 62,
RIGHT_BIG_TOE: 63,
RIGHT_SMALL_TOE: 64,
RIGHT_HEEL: 65,
}
)
VICON_SCHEMA
module-attribute
¶
VICON_SCHEMA = ViconSourceSchema(
rigid_bodies={(value): body for body in SkateboardingRigidBody},
markers={},
rigid_body_order=tuple((value) for body in SkateboardingRigidBody),
marker_order=(),
)
__all__
module-attribute
¶
__all__ = [
"DEFAULT_DEMO",
"GVHMR_SCHEMA",
"VICON_SCHEMA",
"SkateboardingContactPatch",
"SkateboardingContactState",
"SkateboardingContactSubject",
"SkateboardingDemo",
"SkateboardingGeometryName",
"SkateboardingMotionJoint",
"SkateboardingObservationRecipe",
"SkateboardingObservationRole",
"SkateboardingRetargetingRecipe",
"SkateboardingRigidBody",
]
Classes¶
SkateboardingRetargetingRecipe
dataclass
¶
SkateboardingRetargetingRecipe(
scale_to_robot: bool = False,
output_fps: float | None = None,
show_progress: bool = False,
solver_backend: SolverBackend = CVXPY_CLARABEL,
)
Adapt a skateboarding observation to a semantic humanoid robot.
Methods:
| Name | Description |
|---|---|
build_problem |
Build the complete robot-resolved skateboarding problem. |
Attributes:
| Name | Type | Description |
|---|---|---|
scale_to_robot |
bool
|
|
output_fps |
float | None
|
|
show_progress |
bool
|
|
solver_backend |
SolverBackend
|
|
Attributes¶
Functions¶
build_problem
¶
build_problem(observation: SceneObservation, robot: RobotSpec) -> RetargetingProblem
Build the complete robot-resolved skateboarding problem.
SkateboardingObservationRecipe
dataclass
¶
SkateboardingObservationRecipe(
mocap: ObservationSource[MocapRecording],
human_pose: ObservationSource[HumanPoseRecording],
timeline_selection: TimelineSelection = HUMAN_POSE,
crop_policy: CropPolicy = OVERLAP,
uniform_fps: float | None = None,
temporal_registration: TemporalRegistrationConfig = (
lambda: TemporalRegistrationConfig(
max_abs_offset_s=20.0, min_overlap_s=1.0, minimum_score=0.28
)
)(),
support_classification: FootSupportClassificationConfig = FootSupportClassificationConfig(),
max_frames: int | None = None,
world_frame: FrameConvention = Z_UP_RIGHT_HANDED,
)
Fuse native mocap and human-pose recordings into one observation.
Methods:
| Name | Description |
|---|---|
observe |
Load, align, reconstruct, and classify the capture in memory. |
Attributes:
Attributes¶
timeline_selection
class-attribute
instance-attribute
¶
timeline_selection: TimelineSelection = HUMAN_POSE
temporal_registration
class-attribute
instance-attribute
¶
temporal_registration: TemporalRegistrationConfig = field(
default_factory=lambda: TemporalRegistrationConfig(
max_abs_offset_s=20.0, min_overlap_s=1.0, minimum_score=0.28
)
)
support_classification
class-attribute
instance-attribute
¶
support_classification: FootSupportClassificationConfig = field(
default_factory=FootSupportClassificationConfig
)
Functions¶
observe
¶
observe() -> SceneObservation
Load, align, reconstruct, and classify the capture in memory.
SkateboardingContactPatch
¶
Bases: ContactPatch
Contact patches.
Attributes:
| Name | Type | Description |
|---|---|---|
LEFT_SHOE_SOLE |
|
|
RIGHT_SHOE_SOLE |
|
SkateboardingContactState
¶
SkateboardingContactSubject
¶
Bases: ContactSubject
Semantic contact subjects.
Attributes:
| Name | Type | Description |
|---|---|---|
LEFT_SHOE |
|
|
RIGHT_SHOE |
|
SkateboardingDemo
¶
Bases: NameEnum
Bundled skateboarding capture identifiers.
Members:
| Name | Type | Description |
|---|---|---|
PUSHOFF5_TWOSHOES |
int |
Value
'pushoff5_twoshoes'.
|
SkateboardingGeometryName
¶
SkateboardingMotionJoint
¶
Bases: MotionJoint
GVHMR/SMPL-X joints used by the workflow.
Attributes:
Attributes¶
SkateboardingObservationRole
¶
Bases: ObservationRole
Target-independent semantic landmarks and objects.
Attributes:
| Name | Type | Description |
|---|---|---|
PELVIS |
|
|
LEFT_HIP |
|
|
RIGHT_HIP |
|
|
LEFT_KNEE |
|
|
RIGHT_KNEE |
|
|
LEFT_ANKLE |
|
|
RIGHT_ANKLE |
|
|
LEFT_FOOT |
|
|
RIGHT_FOOT |
|
|
UPPER_BODY_CENTER |
|
|
BOARD |
|
Attributes¶
SkateboardingRigidBody
¶
Bases: MocapRigidBody
Native Vicon rigid bodies.
Attributes:
| Name | Type | Description |
|---|---|---|
LEFT_SHOE |
|
|
RIGHT_SHOE |
|
|
BOARD |
|
holosoma
¶
Unified Holosoma climbing observation and adaptation recipes.
Modules:
| Name | Description |
|---|---|
adaptation |
Robot adaptation for the Holosoma climbing subset. |
contacts |
Semantic contact extraction for Holosoma climbing observations. |
geometry |
Geometry-pair policy for Holosoma-compatible object collision. |
layout |
Filesystem layout discovery for Holosoma fixtures and assets. |
motion |
MOCAP motion preprocessing for Holosoma-compatible recipes. |
object |
Object assets and trajectories for Holosoma-compatible recipes. |
observation |
Target-independent Holosoma climbing observation recipe. |
profile |
Optimization profile for Holosoma-compatible climbing. |
robot |
G1 spherehand robot specification for Holosoma-compatible recipes. |
vocabulary |
Typed vocabulary and constants for Holosoma-compatible recipes. |
Classes:
| Name | Description |
|---|---|
HolosomaClimbRetargetingRecipe |
Adapt a climb observation to a Holosoma-compatible robot. |
HolosomaClimbLayout |
Resolved file layout for the MOCAP climbing fixture. |
HolosomaClimbObservationPolicy |
Capture-processing choices for the Holosoma climbing observation. |
HolosomaClimbObservationRecipe |
Build a climbing observation from one native mocap source. |
HolosomaClimbOptimizationPolicy |
Optimization choices specific to the Holosoma climbing experiment. |
HolosomaContactPatch |
Semantic contact patches for climbing. |
HolosomaContactState |
Contact states emitted by the Holosoma foot-sticking extractor. |
HolosomaContactSubject |
Semantic contact subjects for climbing. |
HolosomaGeometryName |
Named fixture geometries referenced by the climbing recipe. |
HolosomaMocapJoint |
Named MOCAP joints used by Holosoma's climbing fixture. |
HolosomaObservationRole |
Semantic objects observed in the climbing scene. |
HolosomaRobotRole |
Robot roles required by the Holosoma climbing adaptation. |
Functions:
| Name | Description |
|---|---|
default_holosoma_root |
Return the sibling Holosoma checkout path used by local parity tests. |
holosoma_climb_layout |
Resolve the climb fixture across known Holosoma checkout layouts. |
holosoma_g1_robot_dir |
Resolve the G1 spherehand asset directory across known layouts. |
object_visual_parts_from_urdf |
Read visual mesh parts from a Holosoma multi-box URDF. |
g1_spherehand_robot |
Return a G1 spherehand robot spec matching Holosoma's MOCAP task. |
Attributes:
| Name | Type | Description |
|---|---|---|
G1_LEFT_FOOT_STICKING_LINKS |
|
|
G1_RIGHT_FOOT_STICKING_LINKS |
|
|
__all__ |
|
Attributes¶
G1_LEFT_FOOT_STICKING_LINKS
module-attribute
¶
G1_LEFT_FOOT_STICKING_LINKS = (
LEFT_ANKLE_ROLL_SPHERE_1,
LEFT_ANKLE_ROLL_SPHERE_2,
LEFT_ANKLE_ROLL_SPHERE_3,
LEFT_ANKLE_ROLL_SPHERE_4,
)
G1_RIGHT_FOOT_STICKING_LINKS
module-attribute
¶
G1_RIGHT_FOOT_STICKING_LINKS = (
RIGHT_ANKLE_ROLL_SPHERE_1,
RIGHT_ANKLE_ROLL_SPHERE_2,
RIGHT_ANKLE_ROLL_SPHERE_3,
RIGHT_ANKLE_ROLL_SPHERE_4,
)
__all__
module-attribute
¶
__all__ = [
"G1_LEFT_FOOT_STICKING_LINKS",
"G1_RIGHT_FOOT_STICKING_LINKS",
"HolosomaClimbLayout",
"HolosomaClimbObservationPolicy",
"HolosomaClimbObservationRecipe",
"HolosomaClimbOptimizationPolicy",
"HolosomaClimbRetargetingRecipe",
"HolosomaContactPatch",
"HolosomaContactState",
"HolosomaContactSubject",
"HolosomaGeometryName",
"HolosomaMocapJoint",
"HolosomaObservationRole",
"HolosomaRobotRole",
"default_holosoma_root",
"g1_spherehand_robot",
"holosoma_climb_layout",
"holosoma_g1_robot_dir",
"object_visual_parts_from_urdf",
]
Classes¶
HolosomaClimbRetargetingRecipe
dataclass
¶
HolosomaClimbRetargetingRecipe(
holosoma_root: str | Path | None = None,
include_object_collision: bool = True,
solver_backend: SolverBackend = CVXPY_CLARABEL,
show_progress: bool = False,
optimization_policy: HolosomaClimbOptimizationPolicy = HolosomaClimbOptimizationPolicy(),
)
Adapt a climb observation to a Holosoma-compatible robot.
Methods:
| Name | Description |
|---|---|
build_problem |
Build the robot-resolved climb problem. |
Attributes:
| Name | Type | Description |
|---|---|---|
holosoma_root |
str | Path | None
|
|
include_object_collision |
bool
|
|
solver_backend |
SolverBackend
|
|
show_progress |
bool
|
|
optimization_policy |
HolosomaClimbOptimizationPolicy
|
|
Attributes¶
optimization_policy
class-attribute
instance-attribute
¶
optimization_policy: HolosomaClimbOptimizationPolicy = field(
default_factory=HolosomaClimbOptimizationPolicy
)
Functions¶
build_problem
¶
build_problem(observation: SceneObservation, robot: RobotSpec) -> RetargetingProblem
Build the robot-resolved climb problem.
HolosomaClimbLayout
dataclass
¶
HolosomaClimbLayout(
fixture_dir: Path,
motion_path: Path,
object_mesh_path: Path,
object_urdf_path: Path,
scene_xml_path: Path,
)
Resolved file layout for the MOCAP climbing fixture.
Attributes:
| Name | Type | Description |
|---|---|---|
fixture_dir |
Path
|
|
motion_path |
Path
|
|
object_mesh_path |
Path
|
|
object_urdf_path |
Path
|
|
scene_xml_path |
Path
|
|
HolosomaClimbObservationPolicy
dataclass
¶
HolosomaClimbObservationPolicy(
source_height_m: float = 1.78,
mat_height_m: float = 0.1,
contact_velocity_threshold: float = 0.01,
object_sample_count: int = 100,
object_sample_seed: int = 42,
)
Capture-processing choices for the Holosoma climbing observation.
Attributes:
| Name | Type | Description |
|---|---|---|
source_height_m |
float
|
|
mat_height_m |
float
|
|
contact_velocity_threshold |
float
|
|
object_sample_count |
int
|
|
object_sample_seed |
int
|
|
HolosomaClimbObservationRecipe
dataclass
¶
HolosomaClimbObservationRecipe(
mocap: ObservationSource[MocapRecording],
object_mesh_path: Path,
object_urdf_path: Path,
frame_count: int | None = None,
policy: HolosomaClimbObservationPolicy = HolosomaClimbObservationPolicy(),
)
Build a climbing observation from one native mocap source.
Methods:
| Name | Description |
|---|---|
from_fixture |
Construct the observation recipe for the public Holosoma fixture. |
observe |
Load and normalize the native climb capture. |
Attributes:
| Name | Type | Description |
|---|---|---|
mocap |
ObservationSource[MocapRecording]
|
|
object_mesh_path |
Path
|
|
object_urdf_path |
Path
|
|
frame_count |
int | None
|
|
policy |
HolosomaClimbObservationPolicy
|
|
Attributes¶
policy
class-attribute
instance-attribute
¶
policy: HolosomaClimbObservationPolicy = field(
default_factory=HolosomaClimbObservationPolicy
)
Functions¶
from_fixture
classmethod
¶
from_fixture(
holosoma_root: str | Path | None = None,
*,
frame_count: int | None = None,
source_fps: float = 30.0,
downsample: int = 4,
policy: HolosomaClimbObservationPolicy | None = None,
) -> HolosomaClimbObservationRecipe
Construct the observation recipe for the public Holosoma fixture.
HolosomaClimbOptimizationPolicy
dataclass
¶
HolosomaClimbOptimizationPolicy(
collision_activation_distance: float = 0.1,
qpos_regularization: tuple[tuple[int, float], ...] = ((19, 0.2), (20, 0.2)),
nominal_qpos_indices: tuple[int, ...] = tuple(range(19)),
)
Optimization choices specific to the Holosoma climbing experiment.
Attributes:
| Name | Type | Description |
|---|---|---|
collision_activation_distance |
float
|
|
qpos_regularization |
tuple[tuple[int, float], ...]
|
|
nominal_qpos_indices |
tuple[int, ...]
|
|
Attributes¶
collision_activation_distance
class-attribute
instance-attribute
¶
collision_activation_distance: float = 0.1
qpos_regularization
class-attribute
instance-attribute
¶
qpos_regularization: tuple[tuple[int, float], ...] = ((19, 0.2), (20, 0.2))
nominal_qpos_indices
class-attribute
instance-attribute
¶
nominal_qpos_indices: tuple[int, ...] = tuple(range(19))
HolosomaContactPatch
¶
HolosomaContactState
¶
HolosomaContactSubject
¶
Bases: ContactSubject
Semantic contact subjects for climbing.
Attributes:
| Name | Type | Description |
|---|---|---|
LEFT_FOOT |
|
|
RIGHT_FOOT |
|
HolosomaGeometryName
¶
Bases: SceneGeometry
Named fixture geometries referenced by the climbing recipe.
Attributes:
| Name | Type | Description |
|---|---|---|
MULTI_BOX_1 |
|
|
MULTI_BOX_2 |
|
|
MULTI_BOX_3 |
|
|
GROUND |
|
Attributes¶
HolosomaMocapJoint
¶
Bases: MotionJoint
Named MOCAP joints used by Holosoma's climbing fixture.
Attributes:
Attributes¶
HolosomaObservationRole
¶
Bases: ObservationRole
Semantic objects observed in the climbing scene.
Attributes:
| Name | Type | Description |
|---|---|---|
CLIMBING_STRUCTURE |
|
HolosomaRobotRole
¶
Bases: RobotRole
Robot roles required by the Holosoma climbing adaptation.
Attributes:
Attributes¶
Functions¶
default_holosoma_root
¶
default_holosoma_root() -> Path
Return the sibling Holosoma checkout path used by local parity tests.
holosoma_climb_layout
¶
holosoma_climb_layout(root: Path) -> HolosomaClimbLayout
Resolve the climb fixture across known Holosoma checkout layouts.
holosoma_g1_robot_dir
¶
holosoma_g1_robot_dir(root: Path) -> Path
Resolve the G1 spherehand asset directory across known layouts.
object_visual_parts_from_urdf
¶
object_visual_parts_from_urdf(urdf_path: str | Path) -> tuple[ObjectVisualPart, ...]
Read visual mesh parts from a Holosoma multi-box URDF.
g1_spherehand_robot
¶
g1_spherehand_robot(
holosoma_root: str | Path | None = None,
*,
scene_xml_path: str | Path | None = None,
include_object_collision: bool = False,
height_m: float = 1.32,
) -> RobotSpec[
G1SpherehandJoint, G1SpherehandLink, G1SpherehandGeometry, HolosomaRobotRole
]
Return a G1 spherehand robot spec matching Holosoma's MOCAP task.