Range Sensor Creation in OmniIsaacGymEnvs not working

I’m trying to create a range sensor in a custom task in OmniIsaacGymEnvs with the “RangeSensorCreateLidar” command. This is the code I use:

image

The error output is the following:

I am using Isaac Sim 2023.1.1 and pulled the newest OmniIsaacGymEnvs from Github.

Has anyone faced this issue before? Thanks a lot for your help in advance!

Hi @baehlerj - Are you using Instanceable assets when loading it in OIGE?
https://docs.omniverse.nvidia.com/isaacsim/latest/isaac_gym_tutorials/tutorial_gym_instanceable_assets.html

Hi @rthaker - I’m not sure if I understand your question correctly, but I think yes. I’m creating my robots (I’m using nvidia Kaya) and then attach the lidars to them like this:

def get_kaya(self):

    kaya = Kaya(
        prim_path=self.default_zero_env_path + "/Kaya", name="Kaya", translation=self._kaya_positions
    )
    self._sim_config.apply_articulation_settings(
        "Kaya", get_prim_at_path(kaya.prim_path), self._sim_config.parse_actor_config("Kaya")
    )

    result, lidar = omni.kit.commands.execute(
        "RangeSensorCreateLidar",
        path=self.default_zero_env_path + "/Kaya/base_link/Lidar",
        parent=None,
        min_range=0.15,
        max_range=2,     
        draw_points=False,
        draw_lines=False,
        horizontal_fov=360.0,
        vertical_fov=30.0,
        horizontal_resolution=360/self.ranges_count, 
        vertical_resolution=4.0,
        rotation_rate=0.0,
        high_lod=False,
        yaw_offset=0.0,
        enable_semantics=False,
    )
    lidar.GetPrim().GetAttribute("xformOp:translate").Set(Gf.Vec3d(0.0, 0.0, 0.015))
    if not result:
        raise Exception("lidar creation failed")

Also as additional information the class I use for the Kaya robot:

class Kaya(WheeledRobot):

def __init__(
    self,
    prim_path: str,
    name: Optional[str] = "Kaya",
    usd_path: Optional[str] = None,
    translation: Optional[np.ndarray] = None,
    orientation: Optional[np.ndarray] = None,
) -> None:

    self._usd_path = usd_path
    self._name = name

    if self._usd_path is None:
        assets_root_path = get_assets_root_path()
        if assets_root_path is None:
            carb.log_error("Could not find Isaac Sim assets folder")
        self._usd_path = assets_root_path + "/Isaac/Robots/Kaya/kaya.usd"

    add_reference_to_stage(self._usd_path, prim_path)

    super().__init__(
        prim_path=prim_path,
        name=name,
        wheel_dof_names=["axle_0_joint", "axle_1_joint", "axle_2_joint"],
        create_robot=True,
        usd_path=self._usd_path,
        position=translation,
        orientation=orientation,
    )

    kaya_setup = HolonomicRobotUsdSetup(
        robot_prim_path=prim_path, com_prim_path=prim_path+"/base_link/control_offset"
    )

    (
        wheel_radius,
        wheel_positions,
        wheel_orientations,
        mecanum_angles,
        wheel_axis,
        up_axis,
    ) = kaya_setup.get_holonomic_controller_params()

    self._controller = HolonomicController(
        name="holonomic_controller",
        wheel_radius=wheel_radius,
        wheel_positions=wheel_positions,
        wheel_orientations=wheel_orientations,
        mecanum_angles=mecanum_angles,
        wheel_axis=wheel_axis,
        up_axis=up_axis,
    )

If you try to run the same command, but instead of adding it to the robot base_link, you add it to your default prim (e.g. “/World”), does it give you any error?

Hi @rgasoto ! -I tried to add the lidar to the following two paths and it resulted in the same error as if I add it to the robot’s base_link:

  1. /World/Lidar
  2. self.default_zero_env_path + “/Lidar”