Error when changing terrain in Isaac Lab

I’m relatively new to Isaac Sim and Isaac Lab and am trying to change the terrain for the [Isaac-Velocity-Rough-G1-v0] environment for a custom terrain. But I keep encountering errors I didn’t encounter when running on Windows. Detailed information can be found below.

Isaac Sim Version

4.2.0
4.1.0
4.0.0
2023.1.1
2023.1.0-hotfix.1
Other (please specify):

Isaac Lab Version (if applicable)

1.2
1.1
1.0
Other (please specify):

Operating System

Ubuntu 22.04
Ubuntu 20.04
Windows 11
Windows 10
Other (please specify):

GPU Information

  • Model:
  • Driver Version:

Topic Description

Detailed Description

I’m trying to run the [Isaac-Velocity-Rough-G1-v0] on a custom terrain. So to do this, I edited the G1RoughEnvCfg class by adding in self.scene.terrain.terrain_type, self.scene.terrain.usd_path and self.scene.terrain.terrain_generator as follows.

@configclass
class G1RoughEnvCfg(LocomotionVelocityRoughEnvCfg):
    rewards: G1Rewards = G1Rewards()
    terminations: TerminationsCfg = TerminationsCfg()

    def __post_init__(self):
        # post init of parent
        super().__post_init__()
        # Scene
        self.scene.robot = G1_MINIMAL_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot")
        self.scene.height_scanner.prim_path = "{ENV_REGEX_NS}/Robot/torso_link"

        self.scene.terrain.terrain_type = "usd"
        self.scene.terrain.terrain_generator = None
        self.scene.terrain.usd_path = "/home/__/Documents/Omniverse/USD_Files/custom_terrain.usd"

        # Randomization
        self.events.push_robot = None
        self.events.add_base_mass = None
        self.events.reset_robot_joints.params["position_range"] = (1.0, 1.0)
        self.events.base_external_force_torque.params["asset_cfg"].body_names = ["torso_link"]
        self.events.reset_base.params = {
            "pose_range": {"x": (-0.5, 0.5), "y": (-0.5, 0.5), "yaw": (-3.14, 3.14)},
            "velocity_range": {
                "x": (0.0, 0.0),
                "y": (0.0, 0.0),
                "z": (0.0, 0.0),
                "roll": (0.0, 0.0),
                "pitch": (0.0, 0.0),
                "yaw": (0.0, 0.0),
            },
        }

        # Rewards
        self.rewards.lin_vel_z_l2.weight = 0.0
        self.rewards.undesired_contacts = None
        self.rewards.flat_orientation_l2.weight = -1.0
        self.rewards.action_rate_l2.weight = -0.005
        self.rewards.dof_acc_l2.weight = -1.25e-7
        self.rewards.dof_acc_l2.params["asset_cfg"] = SceneEntityCfg(
            "robot", joint_names=[".*_hip_.*", ".*_knee_joint"]
        )
        self.rewards.dof_torques_l2.weight = -1.5e-7
        self.rewards.dof_torques_l2.params["asset_cfg"] = SceneEntityCfg(
            "robot", joint_names=[".*_hip_.*", ".*_knee_joint", ".*_ankle_.*"]
        )

        # Commands
        self.commands.base_velocity.ranges.lin_vel_x = (0.0, 1.0)
        self.commands.base_velocity.ranges.lin_vel_y = (-0.0, 0.0)
        self.commands.base_velocity.ranges.ang_vel_z = (-1.0, 1.0)

Error Messages

Error executing job with overrides: []
Traceback (most recent call last):
  File "/home/__/IsaacLab/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/utils/hydra.py", line 91, in hydra_main
    func(env_cfg, agent_cfg, *args, **kwargs)
  File "/home/__/IsaacLab/source/standalone/workflows/rsl_rl/train.py", line 101, in main
    env = gym.make(args_cli.task, cfg=env_cfg, render_mode="rgb_array" if args_cli.video else None)
  File "/home/__/IsaacLab/_isaac_sim/kit/python/lib/python3.10/site-packages/gymnasium/envs/registration.py", line 802, in make
    env = env_creator(**env_spec_kwargs)
  File "/home/__/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/envs/manager_based_rl_env.py", line 75, in __init__
    super().__init__(cfg=cfg)
  File "/home/__/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/envs/manager_based_env.py", line 116, in __init__
    self.scene = InteractiveScene(self.cfg.scene)
  File "/home/__/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/scene/interactive_scene.py", line 145, in __init__
    self._add_entities_from_cfg()
  File "/home/__/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/scene/interactive_scene.py", line 461, in _add_entities_from_cfg
    self._terrain = asset_cfg.class_type(asset_cfg)
  File "/home/__/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/terrains/terrain_importer.py", line 99, in __init__
    self.import_usd("terrain", self.cfg.usd_path)
  File "/home/__/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/terrains/terrain_importer.py", line 272, in import_usd
    faces = np.asarray(mesh_prim.GetFaceVertexIndicesAttr().Get()).reshape(-1, 3)
ValueError: cannot reshape array of size 4 into shape (3)

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
2024-12-30 05:21:49 [16,791ms] [Warning] [omni.graph.core.plugin] Could not find category 'Replicator:Annotators' for removal
2024-12-30 05:21:49 [16,791ms] [Warning] [omni.graph.core.plugin] Could not find category 'Replicator:Annotators' for removal
2024-12-30 05:21:49 [16,791ms] [Warning] [omni.graph.core.plugin] Could not find category 'Replicator:Annotators' for removal
2024-12-30 05:21:49 [16,791ms] [Warning] [omni.graph.core.plugin] Could not find category 'Replicator:Annotators' for removal
2024-12-30 05:21:49 [16,791ms] [Warning] [omni.graph.core.plugin] Could not find category 'Replicator:Annotators' for removal
2024-12-30 05:21:49 [16,791ms] [Warning] [omni.graph.core.plugin] Could not find category 'Replicator:Annotators' for removal
2024-12-30 05:21:49 [16,791ms] [Warning] [omni.graph.core.plugin] Could not find category 'Replicator:Annotators' for removal
2024-12-30 05:21:49 [16,791ms] [Warning] [omni.graph.core.plugin] Could not find category 'Replicator:Annotators' for removal
2024-12-30 05:21:49 [16,791ms] [Warning] [omni.graph.core.plugin] Could not find category 'Replicator:Annotators' for removal
2024-12-30 05:21:49 [16,791ms] [Warning] [omni.graph.core.plugin] Could not find category 'Replicator:Annotators' for removal
2024-12-30 05:21:49 [16,791ms] [Warning] [omni.graph.core.plugin] Could not find category 'Replicator:Annotators' for removal
2024-12-30 05:21:49 [16,791ms] [Warning] [omni.graph.core.plugin] Could not find category 'Replicator:Annotators' for removal
2024-12-30 05:21:49 [16,791ms] [Warning] [omni.graph.core.plugin] Could not find category 'Replicator:Core' for removal
2024-12-30 05:21:49 [16,886ms] [Warning] [carb] Recursive unloadAllPlugins() detected!
There was an error running python

Additional Context

When attempting a similar thing on a Windows computer running Isaac Sim 4.1 and Isaac Lab 1.1 this error didn’t occur and it was possible to use a custom terrain.

I’m wondering if the issue is related to the Isaac Lab version? However, I am unsure how to update my Isaac Lab version. Do I need to delete my current Isaac Lab install and re-install the version 1.3?

Thanks in advance for your help!

I’ve set the environment variable HYDRA_FULL_ERROR=1 and am using Isaac Lab 1.2 and am still getting the errorValueError: cannot reshape array of size 4 into shape (3).

It works on Windows Isaac Lab 1.1.0 but isn’t working on Ubuntu 20.04 Isaac Lab 1.1 or 1.2.

Could you fix it??? Getting a similar output.

When I messed around with removing the preset rigid colliders in the environment I was able to get it to work. But honestly, I still am not sure of the exact reason as to why it worked.

Ah, I figured out why. The terrain only supports trimesh for now. And those we were trying to implement were quadmesh! :) So you can generate some cube mesh and use it for your terrain, for example, since cube mesh is trimesh. (disk is quad mesh, so we can not). Hope it helps you.

Ah that makes sense! Thank you so much for letting me know :)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.