Source code for protomotions.robot_configs.smpl

# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

from protomotions.robot_configs.base import (
    RobotConfig,
    RobotAssetConfig,
    ControlConfig,
    ControlType,
    SimulatorParams,
)
from protomotions.simulator.isaacgym.config import IsaacGymSimParams
from protomotions.simulator.isaaclab.config import (
    IsaacLabSimParams,
    IsaacLabPhysXParams,
)
from protomotions.simulator.mujoco.config import MujocoSimParams
from protomotions.components.pose_lib import ControlInfo
from typing import List, Dict, Tuple
from dataclasses import dataclass, field


[docs] @dataclass class SmplRobotConfig(RobotConfig): semantic_forward_axis_xy: Tuple[float, float] = (1.0, 0.0) trackable_bodies_subset: List[str] = field( default_factory=lambda: [ "Pelvis", "L_Ankle", "R_Ankle", "L_Hand", "R_Hand", "Head", ] ) non_termination_contact_bodies: List[str] = field( default_factory=lambda: ["R_Ankle", "L_Ankle", "R_Toe", "L_Toe"] ) common_naming_to_robot_body_names: Dict[str, str] = field( default_factory=lambda: { "all_left_foot_bodies": ["L_Ankle", "L_Toe"], "all_right_foot_bodies": ["R_Ankle", "R_Toe"], "all_left_hand_bodies": ["L_Hand"], "all_right_hand_bodies": ["R_Hand"], "head_body_name": ["Head"], "torso_body_name": ["Torso"], } ) default_root_height: float = 0.95 asset: RobotAssetConfig = field( default_factory=lambda: RobotAssetConfig( asset_file_name="mjcf/smpl_humanoid.xml", max_linear_velocity=1000.0, max_angular_velocity=1000.0, angular_damping=0.0, linear_damping=0.0, ) ) control: ControlConfig = field( default_factory=lambda: ControlConfig( control_type=ControlType.BUILT_IN_PD, override_control_info={ ".*_(Hip|Knee|Ankle)_.*": ControlInfo( stiffness=800, damping=80, effort_limit=500, velocity_limit=100, ), ".*_Toe_.*": ControlInfo( stiffness=500, damping=50, effort_limit=500, velocity_limit=100, ), "(Torso|Spine|Chest)_.*": ControlInfo( stiffness=1000, damping=100, effort_limit=500, velocity_limit=100, ), "(Neck|Head|.*_Thorax|.*_Shoulder|.*_Elbow)_.*": ControlInfo( stiffness=500, damping=50, effort_limit=500, velocity_limit=100, ), ".*_(Wrist|Hand)_.*": ControlInfo( stiffness=300, damping=30, effort_limit=500, velocity_limit=100, ), }, ) ) control_hz: int = 30 # Each passed block replaces (not merges with) the humanoid template for its # backend, so fields it omits are class defaults, not the humanoid tuning; # newton falls back to the humanoid default (120 fps). implicitfast treats # the PD damping implicitly (Euler only does that for joint damping), which # keeps stiff gains on light links stable. simulation_params: SimulatorParams = field( default_factory=lambda: SimulatorParams.humanoid( 30, isaacgym=IsaacGymSimParams(fps=60), isaaclab=IsaacLabSimParams( fps=120, physx=IsaacLabPhysXParams( num_position_iterations=4, num_velocity_iterations=4, max_depenetration_velocity=1, ), ), mujoco=MujocoSimParams(fps=960, integrator="implicitfast"), ) )