Skip to content

Commit

Permalink
Moves the robot configs to orbit_assets extension (isaac-sim#305)
Browse files Browse the repository at this point in the history
# Description

Moves the robot configs from orbit core to orbit assets.

## Type of change

- New feature (non-breaking change which adds functionality)

## 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
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------

Co-authored-by: Mayank Mittal <[email protected]>
  • Loading branch information
Dhoeller19 and Mayankm96 authored Dec 21, 2023
1 parent 9a2a877 commit 7ec1536
Show file tree
Hide file tree
Showing 52 changed files with 379 additions and 80 deletions.
13 changes: 13 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
*.usd filter=lfs diff=lfs merge=lfs -text
*.dae filter=lfs diff=lfs merge=lfs -text
*.mtl filter=lfs diff=lfs merge=lfs -text
*.obj filter=lfs diff=lfs merge=lfs -text
*.gif filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.psd filter=lfs diff=lfs merge=lfs -text
*.mp4 filter=lfs diff=lfs merge=lfs -text
*.usda filter=lfs diff=lfs merge=lfs -text
*.hdr filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.jit filter=lfs diff=lfs merge=lfs -text
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ _repo
_build
.lastformat

# Internal
# TODO: Remove this once we have a better way to handle internal files.
source/extensions/omni.isaac.assets
source/extensions/omni.isaac.orbit_assets

# RL-Games
**/runs/*
**/logs/*
14 changes: 7 additions & 7 deletions docs/source/how-to/write_articulation_cfg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ is free to move along a rail, and the pole is free to rotate about the cart.
.. dropdown:: Code for Cartpole configuration
:icon: code

.. literalinclude:: ../../../source/extensions/omni.isaac.orbit/omni/isaac/orbit/assets/config/cartpole.py
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_assets/omni/isaac/orbit_assets/cartpole.py
:language: python
:linenos:

Expand All @@ -44,10 +44,10 @@ This configuration object takes in the following parameters:

The last two parameters are optional. If not specified, they are kept at their default values in the USD file.

.. literalinclude:: ../../../source/extensions/omni.isaac.orbit/omni/isaac/orbit/assets/config/cartpole.py
:language: python
:lines: 17-33
:dedent:
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_assets/omni/isaac/orbit_assets/cartpole.py
:language: python
:lines: 17-33
:dedent:

To import articulation from a URDF file instead of a USD file, you can replace the
:class:`~sim.spawners.from_files.UsdFileCfg` with a :class:`~sim.spawners.from_files.UrdfFileCfg`.
Expand All @@ -72,7 +72,7 @@ initial state of the root of the articulation and the initial state of all its j
example, we will spawn the Cartpole at the origin of the XY plane at a Z height of 2.0 meters.
Meanwhile, the joint positions and velocities are set to 0.0.

.. literalinclude:: ../../../source/extensions/omni.isaac.orbit/omni/isaac/orbit/assets/config/cartpole.py
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_assets/omni/isaac/orbit_assets/cartpole.py
:language: python
:lines: 34-36
:dedent:
Expand All @@ -94,7 +94,7 @@ to combine them into a single actuator model.
.. dropdown:: Actuator model configuration with separate actuator models
:icon: code

.. literalinclude:: ../../../source/extensions/omni.isaac.orbit/omni/isaac/orbit/assets/config/cartpole.py
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_assets/omni/isaac/orbit_assets/cartpole.py
:language: python
:lines: 37-47
:dedent:
Expand Down
9 changes: 9 additions & 0 deletions docs/source/refs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ Extension containing the core framework of Orbit.
:start-line: 3


omni.isaac.orbit_assets
------------------------

Extension for configurations of various assets and sensors for Orbit.

.. include:: ../../../source/extensions/omni.isaac.orbit_assets/docs/CHANGELOG.rst
:start-line: 3


omni.isaac.orbit_tasks
----------------------

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ class InteractiveScene:
.. code-block:: python
from omni.isaac.orbit.assets.config.anymal import ANYMAL_C_CFG
from omni.isaac.orbit.scene import InteractiveSceneCfg
from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit_assets.anymal import ANYMAL_C_CFG
@configclass
class MySceneCfg(InteractiveSceneCfg):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ class InteractiveSceneCfg:
import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.assets import AssetBaseCfg
from omni.isaac.orbit.assets.config.anymal import ANYMAL_C_CFG
from omni.isaac.orbit.scene import InteractiveSceneCfg
from omni.isaac.orbit.sensors.ray_caster import GridPatternCfg, RayCasterCfg
from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit_assets.anymal import ANYMAL_C_CFG
@configclass
class MySceneCfg(InteractiveSceneCfg):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@

import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.assets import Articulation
from omni.isaac.orbit.assets.config.anymal import ANYMAL_C_CFG
from omni.isaac.orbit.sim import SimulationContext

##
# Pre-defined configs
##
from omni.isaac.orbit_assets.anymal import ANYMAL_C_CFG # isort:skip


def main():
"""Main function."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@

import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.assets import Articulation
from omni.isaac.orbit.assets.config.ridgeback_franka import RIDGEBACK_FRANKA_PANDA_CFG

##
# Pre-defined configs
##
from omni.isaac.orbit_assets.ridgeback_franka import RIDGEBACK_FRANKA_PANDA_CFG # isort:skip


def design_scene():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@
import omni.isaac.orbit.utils.string as string_utils
from omni.isaac.orbit.actuators import ImplicitActuatorCfg
from omni.isaac.orbit.assets import Articulation, ArticulationCfg
from omni.isaac.orbit.assets.config import ANYMAL_C_CFG, FRANKA_PANDA_CFG
from omni.isaac.orbit.utils.assets import ISAAC_NUCLEUS_DIR

##
# Pre-defined configs
##
from omni.isaac.orbit_assets import ANYMAL_C_CFG, FRANKA_PANDA_CFG # isort:skip


class TestArticulation(unittest.TestCase):
"""Test for articulation class."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@

import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.assets import Articulation
from omni.isaac.orbit.assets.config import FRANKA_PANDA_HIGH_PD_CFG, UR10_CFG
from omni.isaac.orbit.controllers import DifferentialIKController, DifferentialIKControllerCfg
from omni.isaac.orbit.utils.math import compute_pose_error, subtract_frame_transforms

##
# Pre-defined configs
##
from omni.isaac.orbit_assets import FRANKA_PANDA_HIGH_PD_CFG, UR10_CFG # isort:skip


class TestDifferentialIKController(unittest.TestCase):
"""Test fixture for checking that differential IK controller tracks commands properly."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import omni.isaac.orbit.envs.mdp as mdp
import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.assets import ArticulationCfg, AssetBaseCfg
from omni.isaac.orbit.assets.config.anymal import ANYMAL_C_CFG
from omni.isaac.orbit.envs import BaseEnv, BaseEnvCfg
from omni.isaac.orbit.managers import ObservationGroupCfg as ObsGroup
from omni.isaac.orbit.managers import ObservationTermCfg as ObsTerm
Expand All @@ -60,6 +59,7 @@
# Pre-defined configs
##
from omni.isaac.orbit.terrains.config.rough import ROUGH_TERRAINS_CFG # isort: skip
from omni.isaac.orbit_assets.anymal import ANYMAL_C_CFG # isort: skip


##
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,15 @@

import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.assets import ArticulationCfg, AssetBaseCfg
from omni.isaac.orbit.assets.config.anymal import ANYMAL_C_CFG
from omni.isaac.orbit.scene import InteractiveScene, InteractiveSceneCfg
from omni.isaac.orbit.sensors import RayCasterCfg, patterns
from omni.isaac.orbit.utils import configclass

##
# Pre-defined configs
##
from omni.isaac.orbit_assets.anymal import ANYMAL_C_CFG # isort:skip


@configclass
class SensorsSceneCfg(InteractiveSceneCfg):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,18 @@

import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.assets import AssetBaseCfg
from omni.isaac.orbit.assets.config.anymal import ANYMAL_C_CFG
from omni.isaac.orbit.scene import InteractiveScene, InteractiveSceneCfg
from omni.isaac.orbit.sensors.ray_caster import RayCasterCfg, patterns
from omni.isaac.orbit.sim import SimulationContext
from omni.isaac.orbit.terrains import TerrainImporterCfg
from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit.utils.timer import Timer

##
# Pre-defined configs
##
from omni.isaac.orbit_assets.anymal import ANYMAL_C_CFG # isort: skip


@configclass
class MySceneCfg(InteractiveSceneCfg):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@

import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.assets import Articulation
from omni.isaac.orbit.assets.config.anymal import ANYMAL_C_CFG
from omni.isaac.orbit.sensors.contact_sensor import ContactSensor, ContactSensorCfg

##
# Pre-defined configs
##
from omni.isaac.orbit_assets.anymal import ANYMAL_C_CFG # isort:skip


"""
Helpers
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@

"""Rest everything follows."""


import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.assets import AssetBaseCfg
from omni.isaac.orbit.assets.config.anymal import ANYMAL_C_CFG
from omni.isaac.orbit.markers import VisualizationMarkers
from omni.isaac.orbit.markers.config import FRAME_MARKER_CFG
from omni.isaac.orbit.scene import InteractiveScene, InteractiveSceneCfg
Expand All @@ -59,6 +59,11 @@
from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit.utils.timer import Timer

##
# Pre-defined configs
##
from omni.isaac.orbit_assets.anymal import ANYMAL_C_CFG # isort:skip


def quat_from_euler_rpy(roll, pitch, yaw, degrees=False):
"""Converts Euler XYZ to Quaternion (w, x, y, z)."""
Expand Down
18 changes: 18 additions & 0 deletions source/extensions/omni.isaac.orbit_assets/config/extension.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
# Semantic Versioning is used: https://semver.org/
version = "0.1.0"

# Description
title = "ORBIT Assets"
description="Extension containing configuration instances of different assets and sensors"
readme = "docs/README.md"
repository = "https://github.com/NVIDIA-Omniverse/Orbit"
category = "robotics"
keywords = ["kit", "robotics", "assets", "orbit"]

[dependencies]
"omni.isaac.orbit" = {}

# Main python module this extension provides.
[[python.module]]
name = "omni.isaac.orbit_assets"
6 changes: 6 additions & 0 deletions source/extensions/omni.isaac.orbit_assets/data/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
For Orbit, we primarily store assets on the Omniverse Nucleus server. However, at times, it may be
needed to store the assets locally (for debugging purposes). In such cases, this directory can be
used for temporary hosting of assets.

Inside the `data` directory, we recommend following the same structure as our Nucleus directory
`Isaac/Samples/Orbit`. Please check the extension's README for further details.
10 changes: 10 additions & 0 deletions source/extensions/omni.isaac.orbit_assets/docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Changelog
---------

0.1.0 (2023-12-20)
~~~~~~~~~~~~~~~~~~

Added
^^^^^

* Moved all assets' configuration from ``omni.isaac.orbit`` to ``omni.isaac.orbit_assets`` extension.
41 changes: 41 additions & 0 deletions source/extensions/omni.isaac.orbit_assets/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Orbit: Assets for Robots and Objects

This extension contains configurations for various assets and sensors. The configuration instances are
used to spawn and configure the instances in the simulation. They are passed to their corresponding
classes during construction.

## Organizing custom assets

For Orbit, we primarily store assets on the Omniverse Nucleus server. However, at times, it may be
needed to store the assets locally (for debugging purposes). In such cases, the extension's `data`
directory can be used for temporary hosting of assets.

Inside the `data` directory, we recommend following the same structure as our Nucleus directory
`Isaac/Samples/Orbit`. This helps us later to move these assets to the Nucleus server seamlessly.

The recommended directory structure inside `data` is as follows:

* **`Robots/<Company-Name>/<Robot-Name>`**: The USD files should be inside `<Robot-Name>` directory with
the name of the robot.
* **`Props/<Prop-Type>/<Prop-Name>`**: The USD files should be inside `<Prop-Name>` directory with the name
of the prop. This includes mounts, objects and markers.
* **`ActuatorNets/<Company-Name>`**: The actuator networks should inside `<Company-Name` directory with the
name of the actuator that it models.
* **`Policies/<Task-Name>`**: The policy should be JIT/ONNX compiled with the name `policy.pt`. It should also
contain the parameters used for training the checkpoint. This is to ensure reproducibility.
* **`Test/<Test-Name>`**: The asset used for unit testing purposes.

## Referring to the assets in your code

You can use the following snippet to refer to the assets:

```python

from omni.isaac.orbit_assets import ORBIT_ASSETS_DATA_DIR


# ANYmal-C
ANYMAL_C_USD_PATH = f"{ORBIT_ASSETS_DATA_DIR}/Robots/ANYbotics/ANYmal-C/anymal_c.usd"
# ANYmal-D
ANYMAL_D_USD_PATH = f"{ORBIT_ASSETS_DATA_DIR}/Robots/ANYbotics/ANYmal-D/anymal_d.usd"
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright (c) 2022-2023, The ORBIT Project Developers.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES, ETH Zurich, and University of Toronto
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

"""Package containing asset and sensor configurations."""

import os
import toml

# Conveniences to other module directories via relative paths
ORBIT_ASSETS_EXT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../"))
"""Path to the extension source directory."""

ORBIT_ASSETS_DATA_DIR = os.path.join(ORBIT_ASSETS_EXT_DIR, "data")
"""Path to the extension data directory."""

ORBIT_ASSETS_METADATA = toml.load(os.path.join(ORBIT_ASSETS_EXT_DIR, "config", "extension.toml"))
"""Extension metadata dictionary parsed from the extension.toml file."""

# Configure the module-level variables
__version__ = ORBIT_ASSETS_METADATA["package"]["version"]


##
# Configuration for different assets.
##

from .anymal import *
from .cartpole import *
from .franka import *
from .ridgeback_franka import *
from .unitree import *
from .universal_robots import *
Loading

0 comments on commit 7ec1536

Please sign in to comment.