Skip to content

Commit

Permalink
Merge branch 'main' into devel-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhoeller19 committed Jul 17, 2024
2 parents 4a2703e + 33067e5 commit 1fcdeba
Show file tree
Hide file tree
Showing 36 changed files with 1,989 additions and 50 deletions.
3 changes: 3 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ x-default-isaac-lab-volumes: &default-isaac-lab-volumes
- type: bind
source: ../docs
target: ${DOCKER_ISAACLAB_PATH}/docs
- type: bind
source: ../tools
target: ${DOCKER_ISAACLAB_PATH}/tools
# The effect of these volumes is twofold:
# 1. Prevent root-owned files from flooding the _build and logs dir
# on the host machine
Expand Down
13 changes: 13 additions & 0 deletions docs/source/api/lab/omni.isaac.lab.sim.schemas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
MassPropertiesCfg
JointDrivePropertiesCfg
FixedTendonPropertiesCfg
DeformableBodyPropertiesCfg

.. rubric:: Functions

Expand All @@ -29,6 +30,8 @@
modify_mass_properties
modify_joint_drive_properties
modify_fixed_tendon_properties
define_deformable_body_properties
modify_deformable_body_properties

Articulation Root
-----------------
Expand Down Expand Up @@ -88,3 +91,13 @@ Fixed Tendon
:exclude-members: __init__

.. autofunction:: modify_fixed_tendon_properties

Deformable Body
---------------

.. autoclass:: DeformableBodyPropertiesCfg
:members:
:exclude-members: __init__

.. autofunction:: define_deformable_body_properties
.. autofunction:: modify_deformable_body_properties
68 changes: 68 additions & 0 deletions docs/source/api/lab/omni.isaac.lab.sim.spawners.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
.. autosummary::

shapes
meshes
lights
sensors
from_files
Expand All @@ -19,6 +20,7 @@

SpawnerCfg
RigidObjectSpawnerCfg
DeformableObjectSpawnerCfg

Spawners
--------
Expand All @@ -32,6 +34,11 @@ Spawners
:show-inheritance:
:exclude-members: __init__

.. autoclass:: DeformableObjectSpawnerCfg
:members:
:show-inheritance:
:exclude-members: __init__

Shapes
------

Expand Down Expand Up @@ -87,6 +94,60 @@ Shapes
:show-inheritance:
:exclude-members: __init__, func

Meshes
------

.. automodule:: omni.isaac.lab.sim.spawners.meshes

.. rubric:: Classes

.. autosummary::

MeshCfg
MeshCapsuleCfg
MeshConeCfg
MeshCuboidCfg
MeshCylinderCfg
MeshSphereCfg

.. autoclass:: MeshCfg
:members:
:exclude-members: __init__, func

.. autofunction:: spawn_mesh_capsule

.. autoclass:: MeshCapsuleCfg
:members:
:show-inheritance:
:exclude-members: __init__, func

.. autofunction:: spawn_mesh_cone

.. autoclass:: MeshConeCfg
:members:
:show-inheritance:
:exclude-members: __init__, func

.. autofunction:: spawn_mesh_cuboid

.. autoclass:: MeshCuboidCfg
:members:
:show-inheritance:
:exclude-members: __init__, func

.. autofunction:: spawn_mesh_cylinder

.. autoclass:: MeshCylinderCfg
:members:
:show-inheritance:
:exclude-members: __init__, func

.. autofunction:: spawn_mesh_sphere

.. autoclass:: MeshSphereCfg
:members:
:show-inheritance:
:exclude-members: __init__, func

Lights
------
Expand Down Expand Up @@ -198,6 +259,7 @@ Materials
GlassMdlCfg
PhysicsMaterialCfg
RigidBodyMaterialCfg
DeformableBodyMaterialCfg

Visual Materials
~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -234,3 +296,9 @@ Physical Materials
.. autoclass:: RigidBodyMaterialCfg
:members:
:exclude-members: __init__, func

.. autofunction:: spawn_deformable_body_material

.. autoclass:: DeformableBodyMaterialCfg
:members:
:exclude-members: __init__, func
6 changes: 6 additions & 0 deletions docs/source/setup/sample.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ A few quick showroom scripts to run and checkout:
./isaaclab.sh -p source/standalone/demos/procedural_terrain.py
- Spawn different deformable (soft) bodies and let them fall from a height:

.. code:: bash
./isaaclab.sh -p source/standalone/demos/deformables.py
- Spawn multiple markers that are useful for visualizations:

.. code:: bash
Expand Down
13 changes: 11 additions & 2 deletions docs/source/tutorials/00_sim/spawn_prims.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Let's take a look at the Python script:

.. literalinclude:: ../../../../source/standalone/tutorials/00_sim/spawn_prims.py
:language: python
:emphasize-lines: 40-79, 91-92
:emphasize-lines: 40-88, 100-101
:linenos:


Expand Down Expand Up @@ -134,8 +134,17 @@ default to the default values set by USD Physics.
.. literalinclude:: ../../../../source/standalone/tutorials/00_sim/spawn_prims.py
:language: python
:start-at: # spawn a green cone with colliders and rigid body
:end-before: # spawn a usd file of a table into the scene
:end-before: # spawn a blue cuboid with deformable body

Lastly, we spawn a cuboid ``CuboidDeformable`` which contains deformable body physics properties. Unlike the
rigid body simulation, a deformable body can have relative motion between its vertices. This is useful for simulating
soft bodies like cloth, rubber, or jello. It is important to note that deformable bodies are only supported in
GPU simulation and require a mesh object to be spawned with the deformable body physics properties.

.. literalinclude:: ../../../../source/standalone/tutorials/00_sim/spawn_prims.py
:language: python
:start-at: # spawn a blue cuboid with deformable body
:end-before: # spawn a usd file of a table into the scene

Spawning from another file
--------------------------
Expand Down
21 changes: 11 additions & 10 deletions isaaclab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ extract_isaacsim_path() {

# extract the python from isaacsim
extract_python_exe() {
# default to python in the kit
local python_exe=${ISAACLAB_PATH}/_isaac_sim/python.sh
# if default python is not available, check if conda is activated
# check if using conda
if ! [[ -z "${CONDA_PREFIX}" ]]; then
# use conda python
local python_exe=${CONDA_PREFIX}/bin/python
else
# use kit python
local python_exe=${ISAACLAB_PATH}/_isaac_sim/python.sh

if [ ! -f "${python_exe}" ]; then
# check if using conda
if ! [[ -z "${CONDA_PREFIX}" ]]; then
# use conda python
local python_exe=${CONDA_PREFIX}/bin/python
else
# note: we need to check system python for cases such as docker
# inside docker, if user installed into system python, we need to use that
# otherwise, use the python from the kit
Expand Down Expand Up @@ -153,9 +153,10 @@ setup_conda_env() {
# check if we have _isaac_sim directory -> if so that means binaries were installed.
# we need to setup conda variables to load the binaries
local isaacsim_setup_conda_env_script=${ISAACLAB_PATH}/_isaac_sim/setup_conda_env.sh

if [ -f "${isaacsim_setup_conda_env_script}" ]; then
# add variables to environment during activation
printf '' \
printf '%s\n' \
'# for Isaac Sim' \
'source '${isaacsim_setup_conda_env_script}'' \
'' >> ${CONDA_PREFIX}/etc/conda/activate.d/setenv.sh
Expand All @@ -182,7 +183,7 @@ setup_conda_env() {
# check if we have _isaac_sim directory -> if so that means binaries were installed.
if [ -f "${isaacsim_setup_conda_env_script}" ]; then
# add variables to environment during activation
printf '' \
printf '%s\n' \
'# for Isaac Sim' \
'unset CARB_APP_PATH' \
'unset EXP_PATH' \
Expand Down
2 changes: 1 addition & 1 deletion source/extensions/omni.isaac.lab/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.19.2"
version = "0.19.4"

# Description
title = "Isaac Lab framework for Robot Learning"
Expand Down
27 changes: 26 additions & 1 deletion source/extensions/omni.isaac.lab/docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,38 @@
Changelog
---------

0.19.4 (2024-07-13)
~~~~~~~~~~~~~~~~~~~

Fixed
^^^^^

* Added the call to "startup" events when using the :class:`~omni.isaac.lab.envs.ManagerBasedEnv` class.
Earlier, the "startup" events were not being called when the environment was initialized. This issue
did not occur when using the :class:`~omni.isaac.lab.envs.ManagerBasedRLEnv` class since the "startup"
events were called in the constructor.


0.19.3 (2024-07-13)
~~~~~~~~~~~~~~~~~~~

Added
^^^^^

* Added schemas for setting and modifying deformable body properties on a USD prim.
* Added API to spawn a deformable body material in the simulation.
* Added APIs to spawn rigid and deformable meshes of primitive shapes (cone, cylinder, sphere, box, capsule)
in the simulation. This is possible through the :mod:`omni.isaac.lab.sim.spawners.meshes` module.


0.19.2 (2024-07-05)
~~~~~~~~~~~~~~~~~~~

Changed
^^^^^^^

* Modified cloning scheme based on the attribute :attr:`~omni.isaac.lab.scene.InteractiveSceneCfg.replicate_physics` to determine whether environment is homogeneous or heterogeneous.
* Modified cloning scheme based on the attribute :attr:`~omni.isaac.lab.scene.InteractiveSceneCfg.replicate_physics`
to determine whether environment is homogeneous or heterogeneous.


0.19.1 (2024-07-05)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ def load_managers(self):
self.event_manager = EventManager(self.cfg.events, self)
print("[INFO] Event Manager: ", self.event_manager)

# perform events at the start of the simulation
# in-case a child implementation creates other managers, the randomization should happen
# when all the other managers are created
if self.__class__ == ManagerBasedEnv and "startup" in self.event_manager.available_modes:
self.event_manager.apply(mode="startup")

"""
Operations - MDP.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ def load_managers(self):
# -- command manager
self.command_manager: CommandManager = CommandManager(self.cfg.commands, self)
print("[INFO] Command Manager: ", self.command_manager)

# call the parent class to load the managers for observations and actions.
super().load_managers()

# prepare the managers
# -- termination manager
self.termination_manager = TerminationManager(self.cfg.terminations, self)
Expand All @@ -119,8 +121,10 @@ def load_managers(self):
# -- curriculum manager
self.curriculum_manager = CurriculumManager(self.cfg.curriculum, self)
print("[INFO] Curriculum Manager: ", self.curriculum_manager)

# setup the action and observation spaces for Gym
self._configure_gym_env_spaces()

# perform events at the start of the simulation
if "startup" in self.event_manager.available_modes:
self.event_manager.apply(mode="startup")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .manager_term_cfg import EventTermCfg

if TYPE_CHECKING:
from omni.isaac.lab.envs import ManagerBasedRLEnv
from omni.isaac.lab.envs import ManagerBasedEnv


class EventManager(ManagerBase):
Expand Down Expand Up @@ -53,10 +53,10 @@ class EventManager(ManagerBase):
"""

_env: ManagerBasedRLEnv
_env: ManagerBasedEnv
"""The environment instance."""

def __init__(self, cfg: object, env: ManagerBasedRLEnv):
def __init__(self, cfg: object, env: ManagerBasedEnv):
"""Initialize the event manager.
Args:
Expand Down Expand Up @@ -295,7 +295,7 @@ class RandomizationManager(EventManager):
renamed to EventManager as it is more general purpose. The RandomizationManager will be removed in v0.4.0.
"""

def __init__(self, cfg: object, env: ManagerBasedRLEnv):
def __init__(self, cfg: object, env: ManagerBasedEnv):
"""Initialize the randomization manager.
Args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def _convert_asset(self, cfg: MeshConverterCfg):
# Apply collider properties to mesh
if cfg.collision_props is not None:
# -- Collision approximation to mesh
# TODO: https://github.com/isaac-orbit/orbit/issues/163 Move this to a new Schema
# TODO: Move this to a new Schema: https://github.com/isaac-orbit/IsaacLab/issues/163
mesh_collision_api = UsdPhysics.MeshCollisionAPI.Apply(child_mesh_prim)
mesh_collision_api.GetApproximationAttr().Set(cfg.collision_approximation)
# -- Collider properties such as offset, scale, etc.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,21 @@
Locally, the schemas are defined in the following files:
* ``_isaac_sim/kit/extsPhysics/omni.usd.schema.physics/plugins/UsdPhysics/resources/UsdPhysics/schema.usda``
* ``_isaac_sim/kit/extsPhysics/omni.usd.schema.physx/plugins/PhysxSchema/resources/PhysxSchema/schema.usda``
* ``_isaac_sim/extsPhysics/omni.usd.schema.physics/plugins/UsdPhysics/resources/UsdPhysics/schema.usda``
* ``_isaac_sim/extsPhysics/omni.usd.schema.physx/plugins/PhysxSchema/resources/generatedSchema.usda``
"""

from .schemas import (
activate_contact_sensors,
define_articulation_root_properties,
define_collision_properties,
define_deformable_body_properties,
define_mass_properties,
define_rigid_body_properties,
modify_articulation_root_properties,
modify_collision_properties,
modify_deformable_body_properties,
modify_fixed_tendon_properties,
modify_joint_drive_properties,
modify_mass_properties,
Expand All @@ -48,6 +50,7 @@
from .schemas_cfg import (
ArticulationRootPropertiesCfg,
CollisionPropertiesCfg,
DeformableBodyPropertiesCfg,
FixedTendonPropertiesCfg,
JointDrivePropertiesCfg,
MassPropertiesCfg,
Expand Down
Loading

0 comments on commit 1fcdeba

Please sign in to comment.