Skip to content

Commit

Permalink
Adds in frame transformer and demo script (#183)
Browse files Browse the repository at this point in the history
# Description
Adds in a new `Sensor` that performs frame transforms.

No tests as part of this initial PR as this feature is needed by
developers. Tests will be added in with the improvements:
isaac-orbit/IsaacLab#202.

Fixes #133 

## Type of change
- New feature (non-breaking change which adds functionality)

## Screenshots

![image](https://github.com/isaac-orbit/orbit/assets/142246516/d4e2ebde-377f-4e22-9c14-8ec19b7b7498)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./orbit.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file

---------

Signed-off-by: jsmith-bdai <142246516+jsmith-bdai@users.noreply.github.com>
  • Loading branch information
jsmith-bdai authored Oct 31, 2023
1 parent 73f26f6 commit cf737f7
Show file tree
Hide file tree
Showing 11 changed files with 846 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/extensions/omni.isaac.orbit/config/extension.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

# Note: Semantic Versioning is used: https://semver.org/
version = "0.9.25"
version = "0.9.26"

# Description
title = "ORBIT framework for Robot Learning"
Expand Down
10 changes: 10 additions & 0 deletions source/extensions/omni.isaac.orbit/docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Changelog
---------

0.9.26 (2023-10-31)
~~~~~~~~~~~~~~~~~~~

Added
^^^^^

* Added the sensor implementation for :class:`omni.isaac.orbit.sensors.FrameTransformer` class. Currently,
it handles obtaining the transformation between two frames in the same articulation.


0.9.25 (2023-10-27)
~~~~~~~~~~~~~~~~~~~

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from pxr import PhysxSchema

from omni.isaac.orbit.assets import Articulation, ArticulationCfg, AssetBaseCfg, RigidObject, RigidObjectCfg
from omni.isaac.orbit.sensors import SensorBase, SensorBaseCfg
from omni.isaac.orbit.sensors import FrameTransformerCfg, SensorBase, SensorBaseCfg
from omni.isaac.orbit.terrains import TerrainImporter, TerrainImporterCfg

from .interactive_scene_cfg import InteractiveSceneCfg
Expand Down Expand Up @@ -342,6 +342,14 @@ def _add_entities_from_cfg(self):
elif isinstance(asset_cfg, RigidObjectCfg):
self.rigid_objects[asset_name] = asset_cfg.class_type(asset_cfg)
elif isinstance(asset_cfg, SensorBaseCfg):
# Update target frame path(s)' regex name space for FrameTransformer
if isinstance(asset_cfg, FrameTransformerCfg):
updated_target_frames = []
for target_frame in asset_cfg.target_frames:
target_frame.prim_path = target_frame.prim_path.format(ENV_REGEX_NS=self.env_regex_ns)
updated_target_frames.append(target_frame)
asset_cfg.target_frames = updated_target_frames

self.sensors[asset_name] = asset_cfg.class_type(asset_cfg)
elif isinstance(asset_cfg, AssetBaseCfg):
# manually spawn asset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,29 @@


"""
This subpackage contains the sensor classes that are compatible with the Isaac Sim. We include both
This subpackage contains the sensor classes that are compatible with Isaac Sim. We include both
USD-based and custom sensors. The USD-based sensors are the ones that are available in Omniverse and
require creating a USD prim for them. Custom sensors, on the other hand, are the ones that are
implemented in Python and do not require creating a USD prim for them.
A prim path (or expression) is still set for each sensor based on the following schema:
+-------------------+--------------------------+---------------------------------------------------------------+
| Sensor Type | Example Prim Path | Pre-check |
+===================+==========================+===============================================================+
| Camera | /World/robot/base/camera | Leaf is available, and it will spawn a USD camera |
| Contact Sensor | /World/robot/feet_* | Leaf is available and checks if the schema exists |
| Ray Casters | /World/robot/base | Leaf exists and is a physics body (Articulation / Rigid Body) |
| Frame Transformer | /World/robot/base | Leaf exists and is a physics body (Articulation / Rigid Body) |
+-------------------+--------------------------+---------------------------------------------------------------+
"""

from __future__ import annotations

from .camera import * # noqa: F401, F403
from .contact_sensor import * # noqa: F401, F403
from .frame_transformer import * # noqa: F401
from .ray_caster import * # noqa: F401, F403
from .sensor_base import SensorBase # noqa: F401
from .sensor_base_cfg import SensorBaseCfg # noqa: F401
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES, ETH Zurich, and University of Toronto
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

"""
Frame transform sensor for calculating frame transform of articulations.
"""

from __future__ import annotations

from .frame_transformer import FrameTransformer
from .frame_transformer_cfg import FrameTransformerCfg, OffsetCfg
from .frame_transformer_data import FrameTransformerData

__all__ = ["FrameTransformer", "FrameTransformerCfg", "FrameTransformerData", "OffsetCfg"]
Loading

0 comments on commit cf737f7

Please sign in to comment.