Hi, I am currently using the direct file forge in isaaclab.
For example, today I want to use Isaac-Forge-PegInsert-Direct-v0, and I want to add, for instance, an extra cube or an additional hole for insertion,
but I am unable to add it.
def _setup_scene(self):
"""Initialize simulation scene."""
spawn_ground_plane(prim_path="/World/ground", cfg=GroundPlaneCfg(), translation=(0.0, 0.0, -1.05))
# spawn a usd file of a table into the scene
cfg = sim_utils.UsdFileCfg(usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/Mounts/SeattleLabTable/table_instanceable.usd")
cfg.func(
"/World/envs/env_.*/Table", cfg, translation=(0.55, 0.0, 0.0), orientation=(0.70711, 0.0, 0.0, 0.70711)
)
# Spawn cube on the table
cube_cfg = sim_utils.UsdFileCfg(
usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/Blocks/DexCube/dex_cube_instanceable.usd"
)
cube_cfg.func(
"/World/envs/env_.*/Cube",
cube_cfg,
translation=(0.55, 0.0, 0.8),
orientation=(0.70711, 0.0, 0.0, 0.70711)
)
self.cube_cfg=Articulation(self.cfg.cube_cfg)
self._robot = Articulation(self.cfg.robot)
self._fixed_asset = Articulation(self.cfg_task.fixed_asset)
self._held_asset = Articulation(self.cfg_task.held_asset)
if self.cfg_task.name == "peg_insert":
self.fixed_one_asset=Articulation(self.cfg_task.fixed_asset)
self.extra_articulations_asset=Articulation(self.cfg_task.extra_articulations)
if self.cfg_task.name == "gear_mesh":
self._small_gear_asset = Articulation(self.cfg_task.small_gear_cfg)
self._large_gear_asset = Articulation(self.cfg_task.large_gear_cfg)
self._extra_gear_asset = Articulation(self.cfg_task.extra_gear_cfg)
self.scene.articulations["robot"] = self._robot
self.scene.articulations["fixed_asset"] = self._fixed_asset
self.scene.articulations["held_asset"] = self._held_asset
self.scene.articulations["Cube"] = self.cube_cfg
if self.cfg_task.name == "peg_insert":
self.scene.articulations["first_hole"] =self.fixed_one_asset
self.scene.articulations["first_hole"] =self.extra_articulations_asset
if self.cfg_task.name == "gear_mesh":
self.scene.articulations["small_gear"] = self._small_gear_asset
self.scene.articulations["large_gear"] = self._large_gear_asset
self.scene.articulations["extra_gear"] = self._extra_gear_asset
self.scene.clone_environments(copy_from_source=False)
if self.device == "cpu":
# we need to explicitly filter collisions for CPU simulation
self.scene.filter_collisions()
I would like to ask what the correct way to add these is.
Thank you.