Repository navigation
Add Softmimicgen physx workflow #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """Example simulation environments used by AutoData workflows.""" | ||
|
|
||
| import argparse | ||
| from typing import Any | ||
|
|
||
|
|
||
| def register_environment_for_run( | ||
| *, | ||
| env_name: str, | ||
| enable_cameras: bool, | ||
| num_envs: int, | ||
| device: str, | ||
| seed: int, | ||
| presets: str | None = None, | ||
| ) -> dict[str, dict[str, Any]]: | ||
| """Register the AutoData-owned environment selected for the current run. | ||
|
|
||
| Args: | ||
| env_name: Gym ID of the environment selected for this run. | ||
| enable_cameras: Whether Arena environments should include their camera sensors. | ||
| num_envs: Number of parallel environments in this run. | ||
| device: Simulation device for this run. | ||
| seed: Environment seed for this run. | ||
| presets: Optional Arena physics backend preset; None preserves the environment default. | ||
|
|
||
| Returns: | ||
| Gym constructor kwargs keyed by registered environment ID. | ||
| """ | ||
|
|
||
| from .isaac_lab_arena import build_and_register_arena_environment, is_arena_environment | ||
|
|
||
| if not is_arena_environment(env_name): | ||
| return {} | ||
| return build_and_register_arena_environment( | ||
| enable_cameras=enable_cameras, | ||
| num_envs=num_envs, | ||
| device=device, | ||
| seed=seed, | ||
| presets=presets, | ||
| ) | ||
|
|
||
|
|
||
| def register_environments() -> list[str]: | ||
| """External callback used by unmodified Isaac Lab scripts. | ||
|
|
||
| Isaac Lab invokes this function without arguments after starting Isaac Sim. The | ||
| selected ``--task`` determines whether the callback needs to compile an AutoData | ||
| Arena environment or only import AutoData's regular Isaac Lab registrations. | ||
|
|
||
| Returns: | ||
| Command-line arguments not consumed by Arena environment registration. | ||
| """ | ||
|
|
||
| from .isaac_lab_arena import is_arena_environment, register_environment_from_cli | ||
|
|
||
| parser = argparse.ArgumentParser(add_help=False) | ||
| parser.add_argument("--task", type=str) | ||
| args, _ = parser.parse_known_args() | ||
| env_name = args.task.split(":")[-1] if args.task is not None else None | ||
| if env_name is not None and not is_arena_environment(env_name): | ||
| return [] | ||
| return register_environment_from_cli() | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
|
|
||
| from .registration import build_and_register_arena_environment, is_arena_environment, register_environment_from_cli | ||
|
|
||
| __all__ = ["build_and_register_arena_environment", "is_arena_environment", "register_environment_from_cli"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from . import embodiment as _embodiment # noqa: F401 | ||
| from .environment import FRANKA_ROPE_ARENA_ENV_ID, FrankaRopeArenaEnvironment, FrankaRopeArenaEnvironmentCfg | ||
|
|
||
| __all__ = [ | ||
| "FRANKA_ROPE_ARENA_ENV_ID", | ||
| "FrankaRopeArenaEnvironment", | ||
| "FrankaRopeArenaEnvironmentCfg", | ||
| ] |
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,186 @@ | ||||||||||||||||
| # Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||||||||||||||||
| # SPDX-License-Identifier: Apache-2.0 | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| from __future__ import annotations | ||||||||||||||||
|
|
||||||||||||||||
| from collections.abc import Callable | ||||||||||||||||
|
|
||||||||||||||||
| import isaaclab.envs.mdp as mdp_isaac_lab | ||||||||||||||||
| import isaaclab.sim as sim_utils | ||||||||||||||||
| from isaaclab.managers import EventTermCfg as EventTerm | ||||||||||||||||
| from isaaclab.managers import ObservationGroupCfg as ObsGroup | ||||||||||||||||
| from isaaclab.managers import ObservationTermCfg as ObsTerm | ||||||||||||||||
| from isaaclab.managers import SceneEntityCfg | ||||||||||||||||
| from isaaclab.sensors import CameraCfg | ||||||||||||||||
| from isaaclab.utils.configclass import configclass | ||||||||||||||||
| from isaaclab_arena.assets.register import register_asset, register_retargeter | ||||||||||||||||
| from isaaclab_arena.assets.retargeter_library import RetargetterBase | ||||||||||||||||
| from isaaclab_arena.embodiments.common.arm_mode import ArmMode | ||||||||||||||||
| from isaaclab_arena.embodiments.franka.franka import FrankaIKEmbodiment | ||||||||||||||||
| from isaaclab_arena.utils.cameras import ArenaCameraCfg | ||||||||||||||||
| from isaaclab_arena.utils.pose import Pose | ||||||||||||||||
| from isaaclab_physx.renderers import IsaacRtxRendererCfg, IsaacRtxRendererGlobalSettingsCfg | ||||||||||||||||
|
|
||||||||||||||||
| from . import mdp | ||||||||||||||||
|
|
||||||||||||||||
| _FRANKA_ROPE_INIT_JOINT_POS: dict[str, float] = { | ||||||||||||||||
| "panda_joint1": 0.0444, | ||||||||||||||||
| "panda_joint2": -0.1894, | ||||||||||||||||
| "panda_joint3": -0.1107, | ||||||||||||||||
| "panda_joint4": -2.5148, | ||||||||||||||||
| "panda_joint5": 0.0044, | ||||||||||||||||
| "panda_joint6": 2.3775, | ||||||||||||||||
| "panda_joint7": 2.43, | ||||||||||||||||
| "panda_finger_joint.*": 0.04, | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| _FRANKA_ROPE_INIT_JOINT_POSE = [ | ||||||||||||||||
| 0.0444, | ||||||||||||||||
| -0.1894, | ||||||||||||||||
| -0.1107, | ||||||||||||||||
| -2.5148, | ||||||||||||||||
| 0.0044, | ||||||||||||||||
| 2.3775, | ||||||||||||||||
| 2.43, | ||||||||||||||||
| 0.04, | ||||||||||||||||
| 0.04, | ||||||||||||||||
| ] | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| @configclass | ||||||||||||||||
| class FrankaRopeCameraCfg(ArenaCameraCfg): | ||||||||||||||||
| """Wrist and fixed-view cameras matching the Isaac Lab rope environment.""" | ||||||||||||||||
|
|
||||||||||||||||
| robot0_eye_in_hand_image = CameraCfg( | ||||||||||||||||
| prim_path="{ENV_REGEX_NS}/Robot/panda_hand/robot0_eye_in_hand_image", | ||||||||||||||||
| update_period=0.0, | ||||||||||||||||
| height=128, | ||||||||||||||||
| width=128, | ||||||||||||||||
| data_types=["rgb"], | ||||||||||||||||
| renderer_cfg=IsaacRtxRendererCfg(global_settings=IsaacRtxRendererGlobalSettingsCfg(antialiasing_mode="DLSS")), | ||||||||||||||||
| spawn=sim_utils.PinholeCameraCfg( | ||||||||||||||||
| focal_length=24.0, | ||||||||||||||||
| focus_distance=400.0, | ||||||||||||||||
| horizontal_aperture=20.955, | ||||||||||||||||
| clipping_range=(0.1, 2.0), | ||||||||||||||||
| ), | ||||||||||||||||
| offset=CameraCfg.OffsetCfg( | ||||||||||||||||
| pos=(0.13, 0.0, -0.15), | ||||||||||||||||
| rot=(0.03701, 0.03701, -0.70614, -0.70614), | ||||||||||||||||
| convention="ros", | ||||||||||||||||
| ), | ||||||||||||||||
| ) | ||||||||||||||||
|
|
||||||||||||||||
| agentview_image = CameraCfg( | ||||||||||||||||
| prim_path="{ENV_REGEX_NS}/agentview_image", | ||||||||||||||||
| update_period=0.0, | ||||||||||||||||
| height=128, | ||||||||||||||||
| width=128, | ||||||||||||||||
| data_types=["rgb"], | ||||||||||||||||
| renderer_cfg=IsaacRtxRendererCfg(global_settings=IsaacRtxRendererGlobalSettingsCfg(antialiasing_mode="DLSS")), | ||||||||||||||||
| spawn=sim_utils.PinholeCameraCfg( | ||||||||||||||||
| focal_length=14.0, | ||||||||||||||||
| focus_distance=400.0, | ||||||||||||||||
| horizontal_aperture=20.955, | ||||||||||||||||
| clipping_range=(0.1, 2.0), | ||||||||||||||||
| ), | ||||||||||||||||
| offset=CameraCfg.OffsetCfg( | ||||||||||||||||
| pos=(0.5, 0.5, 0.4), | ||||||||||||||||
| rot=(0.0, 0.38268, 0.92388, 0.0), | ||||||||||||||||
| convention="opengl", | ||||||||||||||||
| ), | ||||||||||||||||
| ) | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| @configclass | ||||||||||||||||
| class FrankaRopeObservationsCfg: | ||||||||||||||||
| """Arena-standard Franka observations plus deformable rope nodal state.""" | ||||||||||||||||
|
|
||||||||||||||||
| @configclass | ||||||||||||||||
| class PolicyCfg(ObsGroup): | ||||||||||||||||
| """Policy observations recorded into demonstration datasets.""" | ||||||||||||||||
|
|
||||||||||||||||
| actions = ObsTerm(func=mdp_isaac_lab.last_action) | ||||||||||||||||
| joint_pos = ObsTerm(func=mdp_isaac_lab.joint_pos_rel) | ||||||||||||||||
| joint_vel = ObsTerm(func=mdp_isaac_lab.joint_vel_rel) | ||||||||||||||||
| eef_pos = ObsTerm(func=mdp.ee_frame_pos) | ||||||||||||||||
| eef_quat = ObsTerm(func=mdp.ee_frame_quat) | ||||||||||||||||
| gripper_pos = ObsTerm(func=mdp.gripper_pos) | ||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: set -eu
printf '%s\n' '--- affected file ---'
nl -ba autodata_examples/envs/isaac_lab_arena/franka_rope/embodiment.py | sed -n '1,180p'
printf '%s\n' '--- observation definitions ---'
rg -n -F --glob '*.py' -e 'def gripper_pos' -e 'class.*Observ' -e 'robot_cfg' autodata_examples | head -200
printf '%s\n' '--- dependency and manager references ---'
rg -n -F --glob '*' -e 'ManagerBase._process_term_cfg_at_play' -e '_process_term_cfg_at_play' -e 'isaaclab' -e 'isaaclab_tasks' pyproject.toml setup.cfg setup.py requirements* docker .github autodata_examples 2>/dev/null | head -240 || true
printf '%s\n' '--- changed-file imports and history diff ---'
git diff --no-ext-diff --unified=80 5214cae36ad62c71dcceb76a6586ed9df1a5458d b62f2b6a34dd6741021b6bb9ac1ca1950ef604fa -- autodata_examples/envs/isaac_lab_arena/franka_rope/embodiment.pyRepository: isaac-sim/AutoData Length of output: 23750 🏁 Script executed: set -eu
printf '%s\n' '--- complete observations module ---'
nl -ba autodata_examples/envs/isaac_lab_arena/franka_rope/mdp/observations.py | sed -n '1,130p'
printf '%s\n' '--- task usage of gripper observation and explicit parameters ---'
nl -ba autodata_examples/envs/isaac_lab_arena/franka_rope/task.py | sed -n '1,100p'
printf '%s\n' '--- dependency metadata ---'
nl -ba pyproject.toml | sed -n '1,120p'
find . -maxdepth 4 -type f \( -iname '*lock*' -o -iname '*requirement*' -o -iname '*dependency*' -o -iname '*isaaclab*' \) -print | sort
printf '%s\n' '--- manager/source references in tracked files ---'
git ls-tree -r --name-only b62f2b6a34dd6741021b6bb9ac1ca1950ef604fa | rg -i '(isaaclab|manager|core|lock|requirement|dependency)' | head -240 || true
rg -n -F --glob '*' -e 'ManagerBase' -e 'process_term_cfg' -e 'joint_ids = slice' -e 'joint_names' . --hidden -g '!/.git/**' -g '!**/__pycache__/**' | head -300 || trueRepository: isaac-sim/AutoData Length of output: 20084 🏁 Script executed: set -eu
printf '%s\n' '--- submodule metadata ---'
if test -f .gitmodules; then nl -ba .gitmodules; else echo '.gitmodules absent'; fi
git submodule status || true
git config --file .gitmodules --get-regexp '.*' 2>/dev/null || true
printf '%s\n' '--- submodule tree/state ---'
ls -la submodules submodules/IsaacLab-Arena 2>/dev/null || true
git -C submodules/IsaacLab-Arena status --short --branch 2>/dev/null || true
git -C submodules/IsaacLab-Arena log -1 --oneline 2>/dev/null || true
printf '%s\n' '--- dependency setup references ---'
rg -n -i --glob '!*.pyc' --glob '!**/.git/**' -e 'isaaclab.*(commit|branch|tag|version|core)' -e 'IsaacLab-Arena' -e 'git\+.*isaac' -e 'CORE_BRANCH' -e 'ISAACLAB' -e 'pip install' . | head -300 || true
printf '%s\n' '--- repository refs and recent file history ---'
git log --all --oneline --decorate -20 -- pyproject.toml docker submodules .gitmodules
git ls-files -s submodules/IsaacLab-ArenaRepository: isaac-sim/AutoData Length of output: 28854 🌐 Web query:
💡 Result: 🌐 Web query:
💡 Result: 🌐 Web query:
💡 Result: 🌐 Web query:
💡 Result: 🌐 Web query:
💡 Result: 🌐 Web query:
💡 Result: Pass the finger-joint selection through observation parameters. Isaac Lab does not resolve Proposed fix--- "a/autodata_examples/envs/isaac_lab_arena/franka_rope/embodiment.py"
+++ "b/autodata_examples/envs/isaac_lab_arena/franka_rope/embodiment.py"
@@ -106,7 +106,12 @@
joint_vel = ObsTerm(func=mdp_isaac_lab.joint_vel_rel)
eef_pos = ObsTerm(func=mdp.ee_frame_pos)
eef_quat = ObsTerm(func=mdp.ee_frame_quat)
- gripper_pos = ObsTerm(func=mdp.gripper_pos)
+ gripper_pos = ObsTerm(
+ func=mdp.gripper_pos,
+ params={
+ "robot_cfg": SceneEntityCfg("robot", joint_names=["panda_finger_joint.*"]),
+ },
+ )
object_nodal_pos = ObsTerm(func=mdp.object_nodal_pos)
def __post_init__(self) -> None:📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
| object_nodal_pos = ObsTerm(func=mdp.object_nodal_pos) | ||||||||||||||||
|
|
||||||||||||||||
| def __post_init__(self) -> None: | ||||||||||||||||
| self.enable_corruption = False | ||||||||||||||||
| self.concatenate_terms = False | ||||||||||||||||
|
|
||||||||||||||||
| policy: PolicyCfg = PolicyCfg() | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| @configclass | ||||||||||||||||
| class FrankaRopeEventsCfg: | ||||||||||||||||
| """Reset the Franka exactly as the equivalent Isaac Lab rope environment.""" | ||||||||||||||||
|
|
||||||||||||||||
| reset_all = EventTerm(func=mdp_isaac_lab.reset_scene_to_default, mode="reset") | ||||||||||||||||
| randomize_franka_joint_state = EventTerm( | ||||||||||||||||
| func=mdp_isaac_lab.reset_joints_by_offset, | ||||||||||||||||
| mode="reset", | ||||||||||||||||
| params={ | ||||||||||||||||
| "position_range": (-0.02, 0.02), | ||||||||||||||||
| "velocity_range": (0.0, 0.0), | ||||||||||||||||
| "asset_cfg": SceneEntityCfg("robot", joint_names=["panda_joint.*"]), | ||||||||||||||||
| }, | ||||||||||||||||
| ) | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| @register_asset | ||||||||||||||||
| class FrankaRopeIKEmbodiment(FrankaIKEmbodiment): | ||||||||||||||||
| """Arena Franka IK embodiment with rope-specific pose, observations, and cameras.""" | ||||||||||||||||
|
|
||||||||||||||||
| name = "franka_rope_ik" | ||||||||||||||||
|
|
||||||||||||||||
| def __init__( | ||||||||||||||||
| self, | ||||||||||||||||
| enable_cameras: bool = False, | ||||||||||||||||
| initial_pose: Pose | None = None, | ||||||||||||||||
| concatenate_observation_terms: bool = False, | ||||||||||||||||
| arm_mode: ArmMode | None = None, | ||||||||||||||||
| ) -> None: | ||||||||||||||||
| super().__init__( | ||||||||||||||||
| enable_cameras=enable_cameras, | ||||||||||||||||
| initial_pose=initial_pose, | ||||||||||||||||
| initial_joint_pose=list(_FRANKA_ROPE_INIT_JOINT_POSE), | ||||||||||||||||
| concatenate_observation_terms=concatenate_observation_terms, | ||||||||||||||||
| arm_mode=arm_mode, | ||||||||||||||||
| ) | ||||||||||||||||
| self.scene_config.robot.init_state.joint_pos = dict(_FRANKA_ROPE_INIT_JOINT_POS) | ||||||||||||||||
| self.observation_config = FrankaRopeObservationsCfg() | ||||||||||||||||
| self.observation_config.policy.concatenate_terms = concatenate_observation_terms | ||||||||||||||||
| self.camera_config = FrankaRopeCameraCfg() | ||||||||||||||||
| self.event_config = FrankaRopeEventsCfg() | ||||||||||||||||
| self.reward_config = None | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| @register_retargeter | ||||||||||||||||
| class FrankaRopeKeyboardRetargeter(RetargetterBase): | ||||||||||||||||
| """Use the standard relative-pose keyboard pipeline for the rope embodiment.""" | ||||||||||||||||
|
|
||||||||||||||||
| device = "keyboard" | ||||||||||||||||
| embodiment = FrankaRopeIKEmbodiment.name | ||||||||||||||||
|
|
||||||||||||||||
| def get_pipeline_builder(self, embodiment: object) -> Callable | None: | ||||||||||||||||
| """Return no custom pipeline; Isaac Lab handles relative-pose keyboard input.""" | ||||||||||||||||
|
|
||||||||||||||||
| del embodiment | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| @register_retargeter | ||||||||||||||||
| class FrankaRopeSpaceMouseRetargeter(RetargetterBase): | ||||||||||||||||
| """Use the standard relative-pose SpaceMouse pipeline for the rope embodiment.""" | ||||||||||||||||
|
|
||||||||||||||||
| device = "spacemouse" | ||||||||||||||||
| embodiment = FrankaRopeIKEmbodiment.name | ||||||||||||||||
|
|
||||||||||||||||
| def get_pipeline_builder(self, embodiment: object) -> Callable | None: | ||||||||||||||||
| """Return no custom pipeline; Isaac Lab handles relative-pose SpaceMouse input.""" | ||||||||||||||||
|
|
||||||||||||||||
| del embodiment | ||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| # Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from dataclasses import dataclass | ||
| from typing import TYPE_CHECKING, Any | ||
|
|
||
| from isaaclab.devices import DevicesCfg, Se3KeyboardCfg, Se3SpaceMouseCfg | ||
| from isaaclab_arena.assets.register import register_environment | ||
| from isaaclab_arena.environments.arena_environment_factory import ArenaEnvironmentCfg, ArenaEnvironmentFactory | ||
| from isaaclab_arena.utils.pose import Pose | ||
|
|
||
| from .rope_asset import FrankaRopeAsset | ||
| from .task import FrankaRopeTask | ||
|
|
||
| if TYPE_CHECKING: | ||
| from isaaclab_arena.environments.isaaclab_arena_environment import IsaacLabArenaEnvironment | ||
|
|
||
| FRANKA_ROPE_ARENA_ENV_ID = "Isaac-Rope-Franka-Arena-IK-Rel-v0" | ||
|
|
||
|
|
||
| @dataclass | ||
| class FrankaRopeArenaEnvironmentCfg(ArenaEnvironmentCfg): | ||
| """Configure the AutoData-owned Arena Franka rope environment.""" | ||
|
|
||
| enable_cameras: bool = False | ||
| embodiment: str = "franka_rope_ik" | ||
| teleop_device: str | None = None | ||
|
|
||
|
|
||
| def _configure_franka_rope_env(env_cfg: Any) -> Any: | ||
| """Apply rope timing and asset settings for PhysX.""" | ||
|
|
||
| env_cfg.decimation = 5 | ||
| env_cfg.sim.dt = 0.01 | ||
| env_cfg.sim.render_interval = 2 | ||
| env_cfg.num_rerenders_on_reset = 1 | ||
| env_cfg.scene.replicate_physics = False | ||
| env_cfg.teleop_devices = DevicesCfg( | ||
| devices={ | ||
| "keyboard": Se3KeyboardCfg( | ||
| pos_sensitivity=0.05, | ||
| rot_sensitivity=0.2, | ||
| ), | ||
| "spacemouse": Se3SpaceMouseCfg( | ||
| pos_sensitivity=0.2, | ||
| rot_sensitivity=0.5, | ||
| ), | ||
| }, | ||
| ) | ||
| return env_cfg | ||
|
|
||
|
|
||
| @register_environment | ||
| class FrankaRopeArenaEnvironment(ArenaEnvironmentFactory[FrankaRopeArenaEnvironmentCfg]): | ||
| """Compose the rope scene, Franka embodiment, and rope task through Arena.""" | ||
|
|
||
| name = FRANKA_ROPE_ARENA_ENV_ID | ||
| _legacy_argparse_cfg_type = FrankaRopeArenaEnvironmentCfg | ||
|
|
||
| def build(self, cfg: FrankaRopeArenaEnvironmentCfg) -> IsaacLabArenaEnvironment: | ||
| """Build an Arena environment description from ``cfg``.""" | ||
|
|
||
| from isaaclab_arena.environments.isaaclab_arena_environment import IsaacLabArenaEnvironment | ||
| from isaaclab_arena.scene.scene import Scene | ||
|
|
||
| table = self.asset_registry.get_asset_by_name("table")() | ||
| table.set_initial_pose( | ||
| Pose( | ||
| position_xyz=(0.5, 0.0, 0.0), | ||
| rotation_xyzw=(0.0, 0.0, 0.707, 0.707), | ||
| ), | ||
| ) | ||
| rope = FrankaRopeAsset() | ||
| ground_plane = self.asset_registry.get_asset_by_name("ground_plane")() | ||
| ground_plane.set_initial_pose(Pose(position_xyz=(0.0, 0.0, -1.05))) | ||
| light = self.asset_registry.get_asset_by_name("light")() | ||
| light.set_intensity(3000.0) | ||
| light.set_color((0.75, 0.75, 0.75)) | ||
|
|
||
| embodiment = self.asset_registry.get_asset_by_name(cfg.embodiment)( | ||
| enable_cameras=cfg.enable_cameras, | ||
| ) | ||
| teleop_device = ( | ||
| self.device_registry.get_device_by_name(cfg.teleop_device)() if cfg.teleop_device is not None else None | ||
| ) | ||
|
|
||
| scene = Scene( | ||
| assets=[ | ||
| table, | ||
| rope, | ||
| ground_plane, | ||
| light, | ||
| ], | ||
| ) | ||
| task = FrankaRopeTask() | ||
|
|
||
| return IsaacLabArenaEnvironment( | ||
| name=self.name, | ||
| embodiment=embodiment, | ||
| scene=scene, | ||
| task=task, | ||
| teleop_device=teleop_device, | ||
| env_cfg_callback=_configure_franka_rope_env, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Reuse registration performed by the external callback.
When either AutoData script uses
--external_callback autodata_examples.envs.register_environmentswith the rope environment, the callback registers the environment first. The scripts then call this function unconditionally:scripts/annotate_demos.py, Lines 231 and 250, andscripts/generate_dataset.py, Lines 306 and 322.This second registration reaches the assertion in
isaac_lab_arena/registration.py, Lines 62–64. Both workflows stop before environment creation.Distinguish callback-owned registration from automatic registration. When the callback already registered and bound the constructor arguments, reuse that registration instead of rebuilding it.
🤖 Prompt for AI Agents