4343from isaaclab_arena .utils .pose import Pose
4444from isaaclab_arena .variations .camera_extrinsics_variation import CameraExtrinsicsVariation
4545
46- # Default per-axis scale for the base stand.
47- _DEFAULT_STAND_SCALE : tuple [float , float , float ] = (1.2 , 1.2 , 1.7 )
46+ # The base stand's x/y footprint is fixed; only its height (the z-axis scale factor) is
47+ # configurable, so the stand can be made taller or shorter without changing its footprint.
48+ _STAND_FOOTPRINT_SCALE_XY : tuple [float , float ] = (1.2 , 1.2 )
49+ _DEFAULT_STAND_HEIGHT_SCALE : float = 1.7
50+
51+ # The stand's top is pinned at the robot base and it extends downward to the floor, so scaling its
52+ # height moves the floor contact, not the mount. Measured native (scale=1.0) stand height in meters;
53+ # used to lift the robot base by the same amount the stand grows, keeping the stand's bottom on the
54+ # floor while the robot rides higher.
55+ _STAND_UNIT_HEIGHT_M : float = 0.795
4856
4957
5058class DroidEmbodimentBase (EmbodimentBase , ABC ):
@@ -64,11 +72,15 @@ def __init__(
6472 initial_joint_pose : list [float ] | None = None ,
6573 concatenate_observation_terms : bool = False ,
6674 arm_mode : ArmMode | None = None ,
67- stand_scale : tuple [ float , float , float ] = _DEFAULT_STAND_SCALE ,
75+ stand_height : float = _DEFAULT_STAND_HEIGHT_SCALE ,
6876 ):
6977 super ().__init__ (enable_cameras , initial_pose , concatenate_observation_terms , arm_mode )
7078 self .scene_config = DroidSceneCfg ()
71- self .scene_config .stand .spawn .scale = stand_scale
79+ self .scene_config .stand .spawn .scale = (* _STAND_FOOTPRINT_SCALE_XY , stand_height )
80+ # Lift the robot base (and stand) so a taller/shorter stand keeps its bottom on the floor.
81+ self ._robot_base_z_offset = _STAND_UNIT_HEIGHT_M * (stand_height - _DEFAULT_STAND_HEIGHT_SCALE )
82+ self .scene_config .robot .init_state .pos = self ._lift_z (self .scene_config .robot .init_state .pos )
83+ self .scene_config .stand .init_state .pos = self ._lift_z (self .scene_config .stand .init_state .pos )
7284 self .action_config = None
7385 self .camera_config = DroidCameraCfg ()
7486 self .observation_config = DroidObservationsCfg ()
@@ -79,13 +91,19 @@ def __init__(
7991 self .mimic_env = None
8092 self .add_variation (CameraExtrinsicsVariation (camera_name = "wrist_camera" ))
8193
94+ def _lift_z (self , pos : tuple [float , float , float ]) -> tuple [float , float , float ]:
95+ """Return ``pos`` shifted up by the stand-height-driven robot base offset."""
96+ return (pos [0 ], pos [1 ], pos [2 ] + self ._robot_base_z_offset )
97+
8298 def _update_scene_cfg_with_robot_initial_pose (self , scene_config : Any , pose : Pose ) -> Any :
83- # We override the default initial pose setting function in order to also set
84- # the initial pose of the stand.
99+ # We override the default initial pose setting function in order to also set the initial pose
100+ # of the stand, and to re-apply the stand-height lift on top of the requested pose (the base
101+ # implementation overwrites init_state.pos with the raw pose).
85102 scene_config = super ()._update_scene_cfg_with_robot_initial_pose (scene_config , pose )
86103 if scene_config is None or not hasattr (scene_config , "robot" ):
87104 raise RuntimeError ("scene_config must be populated with a `robot` before calling `set_robot_initial_pose`." )
88- scene_config .stand .init_state .pos = pose .position_xyz
105+ scene_config .robot .init_state .pos = self ._lift_z (pose .position_xyz )
106+ scene_config .stand .init_state .pos = self ._lift_z (pose .position_xyz )
89107 scene_config .stand .init_state .rot = pose .rotation_xyzw
90108
91109 return scene_config
@@ -114,15 +132,15 @@ def __init__(
114132 initial_joint_pose : list [float ] | None = None ,
115133 concatenate_observation_terms : bool = False ,
116134 arm_mode : ArmMode | None = None ,
117- stand_scale : tuple [ float , float , float ] = _DEFAULT_STAND_SCALE ,
135+ stand_height : float = _DEFAULT_STAND_HEIGHT_SCALE ,
118136 ):
119137 super ().__init__ (
120138 enable_cameras ,
121139 initial_pose ,
122140 initial_joint_pose ,
123141 concatenate_observation_terms ,
124142 arm_mode ,
125- stand_scale ,
143+ stand_height ,
126144 )
127145 self .action_config = DroidDifferentialIKActionsCfg ()
128146
@@ -141,15 +159,15 @@ def __init__(
141159 initial_joint_pose : list [float ] | None = None ,
142160 concatenate_observation_terms : bool = False ,
143161 arm_mode : ArmMode | None = None ,
144- stand_scale : tuple [ float , float , float ] = _DEFAULT_STAND_SCALE ,
162+ stand_height : float = _DEFAULT_STAND_HEIGHT_SCALE ,
145163 ):
146164 super ().__init__ (
147165 enable_cameras ,
148166 initial_pose ,
149167 initial_joint_pose ,
150168 concatenate_observation_terms ,
151169 arm_mode ,
152- stand_scale ,
170+ stand_height ,
153171 )
154172 self .action_config = DroidRelativeJointPositionActionsCfg ()
155173
@@ -169,15 +187,15 @@ def __init__(
169187 initial_joint_pose : list [float ] | None = None ,
170188 concatenate_observation_terms : bool = False ,
171189 arm_mode : ArmMode | None = None ,
172- stand_scale : tuple [ float , float , float ] = _DEFAULT_STAND_SCALE ,
190+ stand_height : float = _DEFAULT_STAND_HEIGHT_SCALE ,
173191 ):
174192 super ().__init__ (
175193 enable_cameras ,
176194 initial_pose ,
177195 initial_joint_pose ,
178196 concatenate_observation_terms ,
179197 arm_mode ,
180- stand_scale ,
198+ stand_height ,
181199 )
182200 self .action_config = DroidAbsoluteJointPositionActionsCfg ()
183201
@@ -252,7 +270,7 @@ class DroidSceneCfg:
252270 usd_path = (
253271 f"{ ISAACLAB_NUCLEUS_DIR } /Arena/assets/object_library/srl_robolab_assets/robots/franka_stand_grey.usda"
254272 ),
255- scale = _DEFAULT_STAND_SCALE ,
273+ scale = ( * _STAND_FOOTPRINT_SCALE_XY , _DEFAULT_STAND_HEIGHT_SCALE ) ,
256274 activate_contact_sensors = False ,
257275 ),
258276 )
0 commit comments