diff --git a/source/extensions/omni.isaac.orbit/config/extension.toml b/source/extensions/omni.isaac.orbit/config/extension.toml index f6902c52df..b1fa961b09 100644 --- a/source/extensions/omni.isaac.orbit/config/extension.toml +++ b/source/extensions/omni.isaac.orbit/config/extension.toml @@ -1,7 +1,7 @@ [package] # Note: Semantic Versioning is used: https://semver.org/ -version = "0.10.6" +version = "0.10.7" # Description title = "ORBIT framework for Robot Learning" diff --git a/source/extensions/omni.isaac.orbit/docs/CHANGELOG.rst b/source/extensions/omni.isaac.orbit/docs/CHANGELOG.rst index 1d5bd4f404..26863450d6 100644 --- a/source/extensions/omni.isaac.orbit/docs/CHANGELOG.rst +++ b/source/extensions/omni.isaac.orbit/docs/CHANGELOG.rst @@ -1,6 +1,17 @@ Changelog --------- +0.10.7 (2023-12-19) +~~~~~~~~~~~~~~~~~~~ + +Fixed +^^^^^ + +* Added a check to ray-cast and camera sensor classes to ensure that the sensor prim path does not + have a regex expression at its leaf. For instance, ``/World/Robot/camera_.*`` is not supported + for these sensor types. This behavior needs to be fixed in the future. + + 0.10.6 (2023-12-19) ~~~~~~~~~~~~~~~~~~~ @@ -578,6 +589,7 @@ Added 0.9.18 (2023-10-23) +~~~~~~~~~~~~~~~~~~~ Added ^^^^^ diff --git a/source/extensions/omni.isaac.orbit/omni/isaac/orbit/sensors/camera/camera.py b/source/extensions/omni.isaac.orbit/omni/isaac/orbit/sensors/camera/camera.py index 79a9b2dbd1..7b69328c1c 100644 --- a/source/extensions/omni.isaac.orbit/omni/isaac/orbit/sensors/camera/camera.py +++ b/source/extensions/omni.isaac.orbit/omni/isaac/orbit/sensors/camera/camera.py @@ -7,6 +7,7 @@ import math import numpy as np +import re import torch from tensordict import TensorDict from typing import TYPE_CHECKING, Any, Sequence @@ -76,6 +77,16 @@ def __init__(self, cfg: CameraCfg): RuntimeError: If no camera prim is found at the given path. ValueError: If the provided data types are not supported by the camera. """ + # check if sensor path is valid + # note: currently we do not handle environment indices if there is a regex pattern in the leaf + # For example, if the prim path is "/World/Sensor_[1,2]". + sensor_path = cfg.prim_path.split("/")[-1] + sensor_path_is_regex = re.match(r"^[a-zA-Z0-9/_]+$", sensor_path) is None + if sensor_path_is_regex: + raise RuntimeError( + f"Invalid prim path for the camera sensor: {self.cfg.prim_path}." + "\n\tHint: Please ensure that the prim path does not contain any regex patterns in the leaf." + ) # perform check on supported data types self._check_supported_data_types(cfg) # initialize base class diff --git a/source/extensions/omni.isaac.orbit/omni/isaac/orbit/sensors/ray_caster/ray_caster.py b/source/extensions/omni.isaac.orbit/omni/isaac/orbit/sensors/ray_caster/ray_caster.py index 9dc47342c2..98726f1f9f 100644 --- a/source/extensions/omni.isaac.orbit/omni/isaac/orbit/sensors/ray_caster/ray_caster.py +++ b/source/extensions/omni.isaac.orbit/omni/isaac/orbit/sensors/ray_caster/ray_caster.py @@ -6,6 +6,7 @@ from __future__ import annotations import numpy as np +import re import torch from typing import TYPE_CHECKING, ClassVar, Sequence @@ -61,6 +62,16 @@ def __init__(self, cfg: RayCasterCfg): Args: cfg: The configuration parameters. """ + # check if sensor path is valid + # note: currently we do not handle environment indices if there is a regex pattern in the leaf + # For example, if the prim path is "/World/Sensor_[1,2]". + sensor_path = cfg.prim_path.split("/")[-1] + sensor_path_is_regex = re.match(r"^[a-zA-Z0-9/_]+$", sensor_path) is None + if sensor_path_is_regex: + raise RuntimeError( + f"Invalid prim path for the ray-caster sensor: {self.cfg.prim_path}." + "\n\tHint: Please ensure that the prim path does not contain any regex patterns in the leaf." + ) # Initialize base class super().__init__(cfg) # Create empty variables for storing output data diff --git a/source/extensions/omni.isaac.orbit/omni/isaac/orbit/utils/warp/ops.py b/source/extensions/omni.isaac.orbit/omni/isaac/orbit/utils/warp/ops.py index d5cc4a3ad5..f2a37ac2ba 100644 --- a/source/extensions/omni.isaac.orbit/omni/isaac/orbit/utils/warp/ops.py +++ b/source/extensions/omni.isaac.orbit/omni/isaac/orbit/utils/warp/ops.py @@ -42,16 +42,13 @@ def raycast_mesh( The ray hit position. Shape (N, 3). The returned tensor contains :obj:`float('inf')` for missed hits. The ray hit distance. Shape (N,). - Will only return if `return_distance` is True, else returns None. - Always at second position of the output tuple. + Will only return if :attr:`return_distance` is True, else returns None. The returned tensor contains :obj:`float('inf')` for missed hits. The ray hit normal. Shape (N, 3). - Will only return if `return_normal` is True else returns None. - Always at third position of the output tuple. + Will only return if :attr:`return_normal` is True else returns None. The returned tensor contains :obj:`float('inf')` for missed hits. The ray hit face id. Shape (N,). - Will only return if `return_face_id` is True else returns None. - Always at fourth position of the output tuple. + Will only return if :attr:`return_face_id` is True else returns None. The returned tensor contains :obj:`int(-1)` for missed hits. """ # extract device and shape information