Skip to content

Commit 78adebe

Browse files
committed
refactor(so101): drop teleop import guard in IK-Abs cfg
IsaacTeleopCfg now imports cleanly without the optional isaacteleop package (the heavy import is deferred to session start on develop), so the per-file try/except probe is no longer needed. Import IsaacTeleopCfg unconditionally and assign self.isaac_teleop without the availability guard, matching the pick_place GR1T2 configs on develop. Retain _TELEOP_AVAILABLE as a plain marker so the env test suite can still categorize this as a teleop env via env_test_utils._is_teleop_env.
1 parent 535aa69 commit 78adebe

1 file changed

Lines changed: 21 additions & 26 deletions

File tree

source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/stack_ik_abs_env_cfg.py

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,31 @@
33
#
44
# SPDX-License-Identifier: BSD-3-Clause
55

6-
import logging
76
from dataclasses import MISSING
87

98
import numpy as np
9+
from isaaclab_teleop import IsaacTeleopCfg
1010

1111
from isaaclab.utils.configclass import configclass
1212

1313
from isaaclab_tasks.contrib.stack import mdp
1414

15+
from . import stack_joint_pos_env_cfg
1516
from .position_pitch_ik_action import SO101PositionPitchIKActionCfg
1617
from .position_pitch_ik_controller import SO101PositionPitchIKControllerCfg
17-
18-
try:
19-
import isaacteleop # noqa: F401 -- pipeline builders need isaacteleop at runtime
20-
from isaaclab_teleop import IsaacTeleopCfg
21-
22-
_TELEOP_AVAILABLE = True
23-
except ImportError:
24-
_TELEOP_AVAILABLE = False
25-
logging.getLogger(__name__).warning("isaaclab_teleop is not installed. XR teleoperation features will be disabled.")
26-
27-
from . import stack_joint_pos_env_cfg
2818
from .stack_joint_pos_env_cfg import _SO101_GRIPPER_CLOSE, _SO101_GRIPPER_OPEN
2919

3020
##
3121
# Pre-defined configs
3222
##
3323
from isaaclab_assets.robots.so101 import SO101_HIGH_PD_CFG # isort: skip
3424

25+
# ``isaaclab_teleop`` imports cleanly without the optional ``isaacteleop`` package (the heavy
26+
# import is deferred to session start), so no import guard is needed here. This lightweight
27+
# marker lets the env test suite categorize this as a teleop env (see
28+
# ``isaaclab_tasks/test/env_test_utils.py::_is_teleop_env``).
29+
_TELEOP_AVAILABLE = True
30+
3531
# Analog-gripper action affine: ``joint = offset + scale * closedness`` maps the retargeter's
3632
# closedness ``c in [0, 1]`` to a ``gripper`` joint target [rad]. ``offset == OPEN`` (so ``c=0``
3733
# is fully open) and ``offset + scale == CLOSE`` (so ``c=1`` is fully closed). Tied to the
@@ -274,17 +270,16 @@ def __post_init__(self):
274270
)
275271

276272
# IsaacTeleop-based teleoperation pipeline
277-
if _TELEOP_AVAILABLE:
278-
self.isaac_teleop = IsaacTeleopCfg(
279-
pipeline_builder=_build_so101_stack_pipeline,
280-
sim_device=self.sim.device,
281-
xr_cfg=self.xr,
282-
# Rebase all teleop output poses into the robot base frame: the device reads this
283-
# prim's world transform each frame and left-multiplies its inverse onto the XR
284-
# anchor (``base_T_world @ world_T_anchor``), so the clutch/roll retargeters work
285-
# in the base frame -- the IK command's root frame (the FrameTransformer source
286-
# also uses ``Robot/base``). The clutch's reset-origin home (_BASE_T_GRIPPER_HOME)
287-
# provides the engage seed, so no live end-effector feed is needed. Teleop runs a
288-
# single env (env_0).
289-
target_frame_prim_path="/World/envs/env_0/Robot/base",
290-
)
273+
self.isaac_teleop = IsaacTeleopCfg(
274+
pipeline_builder=_build_so101_stack_pipeline,
275+
sim_device=self.sim.device,
276+
xr_cfg=self.xr,
277+
# Rebase all teleop output poses into the robot base frame: the device reads this
278+
# prim's world transform each frame and left-multiplies its inverse onto the XR
279+
# anchor (``base_T_world @ world_T_anchor``), so the clutch/roll retargeters work
280+
# in the base frame -- the IK command's root frame (the FrameTransformer source
281+
# also uses ``Robot/base``). The clutch's reset-origin home (_BASE_T_GRIPPER_HOME)
282+
# provides the engage seed, so no live end-effector feed is needed. Teleop runs a
283+
# single env (env_0).
284+
target_frame_prim_path="/World/envs/env_0/Robot/base",
285+
)

0 commit comments

Comments
 (0)