Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
fan-ziqi committed Jul 23, 2024
2 parents 2e92e10 + 7937a18 commit 1949a92
Show file tree
Hide file tree
Showing 37 changed files with 2,008 additions and 61 deletions.
8 changes: 8 additions & 0 deletions .vscode/tools/setup_vscode.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ def overwrite_default_python_interpreter(isaaclab_settings: str) -> str:
"""
# read executable name
python_exe = sys.executable.replace("\\", "/")

# We make an exception for replacing the default interpreter if the
# path (/kit/python/bin/python3) indicates that we are using a local/container
# installation of IsaacSim. We will preserve the calling script as the default, python.sh.
# We want to use python.sh because it modifies LD_LIBRARY_PATH and PYTHONPATH
# (among other envars) that we need for all of our dependencies to be accessible.
if "kit/python/bin/python3" in python_exe:
return isaaclab_settings
# replace the default python interpreter in the Isaac Lab settings file with the path to the
# python interpreter in the Isaac Lab directory
isaaclab_settings = re.sub(
Expand Down
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
8 changes: 7 additions & 1 deletion 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 Expand Up @@ -159,7 +165,7 @@ format.

.. code:: bash
./isaaclab.sh -p source/standalone//workflows/robomimic/play.py --task Isaac-Lift-Cube-Franka-IK-Rel-v0 --checkpoint /PATH/TO/model.pth
./isaaclab.sh -p source/standalone/workflows/robomimic/play.py --task Isaac-Lift-Cube-Franka-IK-Rel-v0 --checkpoint /PATH/TO/model.pth
Reinforcement Learning
~~~~~~~~~~~~~~~~~~~~~~
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
Loading

0 comments on commit 1949a92

Please sign in to comment.