Reference/API

Hand retargeter API

Hand retargeters consume a canonical HandFrame and return joint positions in the target URDF's order. Choose optimization for per-frame solving or a neural model for a trained mapping.

retargetingkit.retargeting.hand.optimization.OptimizationHandRetargeterConfig(
urdf: Path,
spec: Annotated[HandSpec, tyro.conf.Suppress],
online: Annotated[HandRetargeterOnlineConfig, OPAQUE, tyro.conf.Suppress],
side: Side,
collision_spheres: Path | None = None,
collision_ignore: Path | None = None
)
Bases: RetargeterConfig[HandFrame, QPosCommand]

Online-optimization hand retargeting; spec/online come from robokit.helpers.hand_retargeting.presets.

python
>>> OptimizationHandRetargeterConfig(Path("hand.urdf"), spec, online, "right").side  # doctest: +SKIP
'right'
Parameters
urdfPathrequired
specAnnotated[HandSpec, tyro.conf.Suppress]required
onlineAnnotated[HandRetargeterOnlineConfig, OPAQUE, tyro.conf.Suppress]required
sideSiderequired
collision_spheresPath | None= None
collision_ignorePath | None= None
Members
attribute[source]
OptimizationHandRetargeterConfig.urdf: Path
attribute[source]
OptimizationHandRetargeterConfig.spec: Annotated[HandSpec, tyro.conf.Suppress]
attribute[source]
OptimizationHandRetargeterConfig.online: Annotated[HandRetargeterOnlineConfig, OPAQUE, tyro.conf.Suppress]
attribute[source]
OptimizationHandRetargeterConfig.side: Side
attribute[source]
OptimizationHandRetargeterConfig.collision_spheres: Path | None = None
attribute[source]
OptimizationHandRetargeterConfig.collision_ignore: Path | None = None
method[source]
OptimizationHandRetargeterConfig.build(
device: str
) -> OptimizationHandRetargeter

Build and warm up the optimization retargeter.

python
>>> config.build("cpu")  # doctest: +SKIP
Parameters
devicestrrequired
Returns
OptimizationHandRetargeter
retargetingkit.retargeting.hand.neural.NeuralHandRetargeterConfig(
checkpoint_dir: Path,
hand: HandPreset,
side: Side = 'right'
)
Bases: RetargeterConfig[HandFrame, QPosCommand]

One human hand mapped onto one robot hand by a trained checkpoint.

python
>>> from pathlib import Path
>>> from retargetingkit.retargeting.hand.presets import HANDS
>>> NeuralHandRetargeterConfig(Path("run"), HANDS["xhand"]).side
'right'
Parameters
checkpoint_dirPathrequired
handHandPresetrequired
sideSide= 'right'
Members
attribute[source]
NeuralHandRetargeterConfig.checkpoint_dir: Path
attribute[source]
NeuralHandRetargeterConfig.hand: HandPreset
attribute[source]
NeuralHandRetargeterConfig.side: Side = 'right'
method[source]
NeuralHandRetargeterConfig.build(
device: str
) -> NeuralHandRetargeter

Load the checkpoint onto device.

python
>>> NeuralHandRetargeterConfig(Path("run"), HANDS["xhand"]).build("cpu")  # doctest: +SKIP
Parameters
devicestrrequired
Returns
NeuralHandRetargeter
retargetingkit.retargeting.hand.neural.NeuralHandAssetRetargeterConfig(
checkpoint: str,
hand: HandPreset,
side: Side = 'right'
)
Bases: RetargeterConfig[HandFrame, QPosCommand]

A named Hugging Face checkpoint resolved when the retargeter is built.

Parameters
checkpointstrrequired
handHandPresetrequired
sideSide= 'right'
Members
attribute[source]
NeuralHandAssetRetargeterConfig.checkpoint: str
attribute[source]
NeuralHandAssetRetargeterConfig.hand: HandPreset
attribute[source]
NeuralHandAssetRetargeterConfig.side: Side = 'right'
method[source]
NeuralHandAssetRetargeterConfig.build(
device: str
) -> NeuralHandRetargeter

Download the checkpoint if needed, then load it on device.

python
>>> config.build("cpu")  # doctest: +SKIP
Parameters
devicestrrequired
Returns
NeuralHandRetargeter