Skip to content

Commit 5b6d877

Browse files
committed
Changed curobo config to use configclass instead of dataclass
1 parent c1fcd58 commit 5b6d877

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

source/isaaclab_mimic/isaaclab_mimic/motion_planners/curobo/curobo_planner_cfg.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
import os
77
import tempfile
88
import yaml
9-
from dataclasses import dataclass, field
109

1110
from curobo.geom.sdf.world import CollisionCheckerType
1211
from curobo.geom.types import WorldConfig
1312
from curobo.util_file import get_robot_configs_path, get_world_configs_path, join_path, load_yaml
1413

1514
from isaaclab.utils.assets import ISAACLAB_NUCLEUS_DIR, retrieve_file_path
15+
from isaaclab.utils.configclass import configclass
1616

1717

18-
@dataclass
18+
@configclass
1919
class CuroboPlannerCfg:
2020
"""Configuration for CuRobo motion planner.
2121
@@ -47,17 +47,17 @@ class CuroboPlannerCfg:
4747
"""End-effector link name (auto-detected from robot config if None)."""
4848

4949
# Gripper configuration
50-
gripper_joint_names: list[str] = field(default_factory=list)
50+
gripper_joint_names: list[str] = []
5151
"""Names of gripper joints."""
5252

53-
gripper_open_positions: dict[str, float] = field(default_factory=dict)
53+
gripper_open_positions: dict[str, float] = {}
5454
"""Open gripper positions for cuRobo to update spheres"""
5555

56-
gripper_closed_positions: dict[str, float] = field(default_factory=dict)
56+
gripper_closed_positions: dict[str, float] = {}
5757
"""Closed gripper positions for cuRobo to update spheres"""
5858

5959
# Hand link configuration (for contact planning)
60-
hand_link_names: list[str] = field(default_factory=list)
60+
hand_link_names: list[str] = []
6161
"""Names of hand/finger links to disable during contact planning."""
6262

6363
# Attachment configuration
@@ -69,7 +69,7 @@ class CuroboPlannerCfg:
6969
"""CuRobo world configuration file (without path)."""
7070

7171
# Static objects to not update in the world model
72-
static_objects: list[str] = field(default_factory=list)
72+
static_objects: list[str] = []
7373
"""Names of static objects to not update in the world model."""
7474

7575
# Optional prim path configuration
@@ -92,7 +92,7 @@ class CuroboPlannerCfg:
9292
interpolation_dt: float = 0.05
9393
"""Time step for interpolating waypoints."""
9494

95-
collision_cache_size: dict[str, int] = field(default_factory=lambda: {"obb": 150, "mesh": 150})
95+
collision_cache_size: dict[str, int] = {"obb": 150, "mesh": 150}
9696
"""Cache sizes for different collision types."""
9797

9898
trajopt_tsteps: int = 32
@@ -155,7 +155,7 @@ class CuroboPlannerCfg:
155155
collision_spheres_file: str | None = None
156156
"""Collision spheres configuration file (auto-detected if None)."""
157157

158-
extra_collision_spheres: dict[str, int] = field(default_factory=lambda: {"attached_object": 100})
158+
extra_collision_spheres: dict[str, int] = {"attached_object": 100}
159159
"""Extra collision spheres for attached objects."""
160160

161161
position_threshold: float = 0.005
@@ -213,8 +213,8 @@ def _get_world_config_with_table_adjustment(self) -> WorldConfig:
213213
world_cfg = WorldConfig(cuboid=world_cfg_table.cuboid, mesh=world_cfg_mesh.mesh)
214214
return world_cfg
215215

216-
@staticmethod
217-
def _create_temp_robot_yaml(base_yaml: str, urdf_path: str) -> str:
216+
@classmethod
217+
def _create_temp_robot_yaml(cls, base_yaml: str, urdf_path: str) -> str:
218218
"""Create a temporary robot configuration YAML with custom URDF path.
219219
220220
Args:

source/isaaclab_mimic/test/test_curobo_planner_franka.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from isaaclab.app import AppLauncher
1616

17-
headless = False
17+
headless = True
1818
app_launcher = AppLauncher(headless=headless)
1919
simulation_app: Any = app_launcher.app
2020

0 commit comments

Comments
 (0)