Commit d494e00e authored by Kelly Guo's avatar Kelly Guo Committed by Kelly Guo

Fixes extension renaming and adds documentation for RL training (#207)

# Description

This change fixes some lingering extension renaming for the deprecated
omni.isaac.ui extension.
Additionally, new documentation for RL training is added to provide a
guideline and some troubleshooting tips for RL training with Isaac Lab.
parent ee91a42d
...@@ -12,3 +12,4 @@ learning frameworks. ...@@ -12,3 +12,4 @@ learning frameworks.
rl_existing_scripts rl_existing_scripts
rl_frameworks rl_frameworks
performance_benchmarks performance_benchmarks
training_guide
This diff is collapsed.
...@@ -59,6 +59,9 @@ For SpaceMouse, these are as follows: ...@@ -59,6 +59,9 @@ For SpaceMouse, these are as follows:
Move arm along z-axis: Push or pull the SpaceMouse Move arm along z-axis: Push or pull the SpaceMouse
Rotate arm: Twist the SpaceMouse Rotate arm: Twist the SpaceMouse
The next section describes how teleoperation devices can be used for data collection for imitation learning.
Imitation Learning Imitation Learning
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
......
...@@ -67,7 +67,7 @@ compatibility issues with some Linux distributions. If you encounter any issues, ...@@ -67,7 +67,7 @@ compatibility issues with some Linux distributions. If you encounter any issues,
env_isaaclab\Scripts\activate env_isaaclab\Scripts\activate
- Next, install a CUDA-enabled PyTorch 2.4.0 build based on the CUDA version available on your system. This step is optional for Linux, but required for Windows to ensure a CUDA-compatible version of PyTorch is installed. - Next, install a CUDA-enabled PyTorch 2.5.1 build based on the CUDA version available on your system. This step is optional for Linux, but required for Windows to ensure a CUDA-compatible version of PyTorch is installed.
.. tab-set:: .. tab-set::
...@@ -75,13 +75,13 @@ compatibility issues with some Linux distributions. If you encounter any issues, ...@@ -75,13 +75,13 @@ compatibility issues with some Linux distributions. If you encounter any issues,
.. code-block:: bash .. code-block:: bash
pip install torch==2.4.0 --index-url https://download.pytorch.org/whl/cu118 pip install torch==2.5.1 --index-url https://download.pytorch.org/whl/cu118
.. tab-item:: CUDA 12 .. tab-item:: CUDA 12
.. code-block:: bash .. code-block:: bash
pip install torch==2.4.0 --index-url https://download.pytorch.org/whl/cu121 pip install torch==2.5.1 --index-url https://download.pytorch.org/whl/cu121
- Before installing Isaac Sim, ensure the latest pip version is installed. To update pip, run - Before installing Isaac Sim, ensure the latest pip version is installed. To update pip, run
...@@ -117,7 +117,7 @@ Verifying the Isaac Sim installation ...@@ -117,7 +117,7 @@ Verifying the Isaac Sim installation
.. code:: bash .. code:: bash
# experience files can be absolute path, or relative path searched in isaacsim/apps or omni/apps # experience files can be absolute path, or relative path searched in isaacsim/apps or omni/apps
isaacsim omni.isaac.sim.python.kit isaacsim isaacsim.exp.full.kit
.. attention:: .. attention::
......
...@@ -45,15 +45,8 @@ from isaaclab_assets import H1_CFG # isort:skip ...@@ -45,15 +45,8 @@ from isaaclab_assets import H1_CFG # isort:skip
from isaaclab_assets import G1_CFG # isort:skip from isaaclab_assets import G1_CFG # isort:skip
def main(): def design_scene(sim: sim_utils.SimulationContext) -> tuple[list, torch.Tensor]:
"""Main function.""" """Designs the scene."""
# Load kit helper
sim_cfg = sim_utils.SimulationCfg(dt=0.005, device=args_cli.device)
sim = SimulationContext(sim_cfg)
# Set main camera
sim.set_camera_view(eye=[3.0, 0.0, 2.25], target=[0.0, 0.0, 1.0])
# Spawn things into stage
# Ground-plane # Ground-plane
cfg = sim_utils.GroundPlaneCfg() cfg = sim_utils.GroundPlaneCfg()
cfg.func("/World/defaultGroundPlane", cfg) cfg.func("/World/defaultGroundPlane", cfg)
...@@ -74,12 +67,11 @@ def main(): ...@@ -74,12 +67,11 @@ def main():
g1 = Articulation(G1_CFG.replace(prim_path="/World/G1")) g1 = Articulation(G1_CFG.replace(prim_path="/World/G1"))
robots = [cassie, h1, g1] robots = [cassie, h1, g1]
# Play the simulator return robots, origins
sim.reset()
# Now we are ready!
print("[INFO]: Setup complete...")
def run_simulator(sim: sim_utils.SimulationContext, robots: list[Articulation], origins: torch.Tensor):
"""Runs the simulation loop."""
# Define simulation stepping # Define simulation stepping
sim_dt = sim.get_physics_dt() sim_dt = sim.get_physics_dt()
sim_time = 0.0 sim_time = 0.0
...@@ -116,6 +108,27 @@ def main(): ...@@ -116,6 +108,27 @@ def main():
robot.update(sim_dt) robot.update(sim_dt)
def main():
"""Main function."""
# Load kit helper
sim_cfg = sim_utils.SimulationCfg(dt=0.005, device=args_cli.device)
sim = SimulationContext(sim_cfg)
# Set main camera
sim.set_camera_view(eye=[3.0, 0.0, 2.25], target=[0.0, 0.0, 1.0])
# design scene
robots, origins = design_scene(sim)
# Play the simulator
sim.reset()
# Now we are ready!
print("[INFO]: Setup complete...")
# Run the simulator
run_simulator(sim, robots, origins)
if __name__ == "__main__": if __name__ == "__main__":
# run the main function # run the main function
main() main()
......
...@@ -8,7 +8,7 @@ Utility to convert a MJCF into USD format. ...@@ -8,7 +8,7 @@ Utility to convert a MJCF into USD format.
MuJoCo XML Format (MJCF) is an XML file format used in MuJoCo to describe all elements of a robot. For more information, see: http://www.mujoco.org/book/XMLreference.html MuJoCo XML Format (MJCF) is an XML file format used in MuJoCo to describe all elements of a robot. For more information, see: http://www.mujoco.org/book/XMLreference.html
This script uses the MJCF importer extension from Isaac Sim (``omni.isaac.mjcf_importer``) to convert a MJCF asset into USD format. It is designed as a convenience script for command-line use. For more information on the MJCF importer, see the documentation for the extension: This script uses the MJCF importer extension from Isaac Sim (``isaacsim.asset.importer.mjcf``) to convert a MJCF asset into USD format. It is designed as a convenience script for command-line use. For more information on the MJCF importer, see the documentation for the extension:
https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/ext_omni_isaac_mjcf.html https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/ext_omni_isaac_mjcf.html
......
...@@ -9,7 +9,7 @@ Utility to convert a URDF into USD format. ...@@ -9,7 +9,7 @@ Utility to convert a URDF into USD format.
Unified Robot Description Format (URDF) is an XML file format used in ROS to describe all elements of Unified Robot Description Format (URDF) is an XML file format used in ROS to describe all elements of
a robot. For more information, see: http://wiki.ros.org/urdf a robot. For more information, see: http://wiki.ros.org/urdf
This script uses the URDF importer extension from Isaac Sim (``omni.isaac.urdf_importer``) to convert a This script uses the URDF importer extension from Isaac Sim (``isaacsim.asset.importer.urdf``) to convert a
URDF asset into USD format. It is designed as a convenience script for command-line use. For more URDF asset into USD format. It is designed as a convenience script for command-line use. For more
information on the URDF importer, see the documentation for the extension: information on the URDF importer, see the documentation for the extension:
https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/ext_omni_isaac_urdf.html https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/ext_omni_isaac_urdf.html
......
...@@ -14,10 +14,10 @@ Currently, the sub-package provides the following classes: ...@@ -14,10 +14,10 @@ Currently, the sub-package provides the following classes:
.. note:: .. note::
For some simple use-cases, it may be sufficient to use the debug drawing utilities from Isaac Sim. For some simple use-cases, it may be sufficient to use the debug drawing utilities from Isaac Sim.
The debug drawing API is available in the `omni.isaac.debug_drawing`_ module. It allows drawing of The debug drawing API is available in the `isaacsim.util.debug_drawing`_ module. It allows drawing of
points and splines efficiently on the UI. points and splines efficiently on the UI.
.. _omni.isaac.debug_drawing: https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/ext_omni_isaac_debug_drawing.html .. _isaacsim.util.debug_drawing: https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/ext_omni_isaac_debug_drawing.html
""" """
......
...@@ -14,7 +14,7 @@ import omni.log ...@@ -14,7 +14,7 @@ import omni.log
from .ui_widget_wrapper import UIWidgetWrapper from .ui_widget_wrapper import UIWidgetWrapper
if TYPE_CHECKING: if TYPE_CHECKING:
import omni.isaac.ui import isaacsim.gui.components
import omni.ui import omni.ui
...@@ -155,7 +155,9 @@ class ImagePlot(UIWidgetWrapper): ...@@ -155,7 +155,9 @@ class ImagePlot(UIWidgetWrapper):
with omni.ui.HStack(): with omni.ui.HStack():
# Write the leftmost label for what this plot is # Write the leftmost label for what this plot is
omni.ui.Label( omni.ui.Label(
self._label, width=omni.isaac.ui.ui_utils.LABEL_WIDTH, alignment=omni.ui.Alignment.LEFT_TOP self._label,
width=isaacsim.gui.components.ui_utils.LABEL_WIDTH,
alignment=omni.ui.Alignment.LEFT_TOP,
) )
with omni.ui.Frame(width=self._aspect_ratio * self._widget_height, height=self._widget_height): with omni.ui.Frame(width=self._aspect_ratio * self._widget_height, height=self._widget_height):
self._base_plot = omni.ui.ImageWithProvider(self._byte_provider) self._base_plot = omni.ui.ImageWithProvider(self._byte_provider)
...@@ -192,7 +194,7 @@ class ImagePlot(UIWidgetWrapper): ...@@ -192,7 +194,7 @@ class ImagePlot(UIWidgetWrapper):
def _change_mode(value): def _change_mode(value):
self._curr_mode = value self._curr_mode = value
omni.isaac.ui.ui_utils.dropdown_builder( isaacsim.gui.components.ui_utils.dropdown_builder(
label="Mode", label="Mode",
type="dropdown", type="dropdown",
items=["Original", "Normalization", "Colorization"], items=["Original", "Normalization", "Colorization"],
......
...@@ -15,7 +15,7 @@ from isaacsim.core.api.simulation_context import SimulationContext ...@@ -15,7 +15,7 @@ from isaacsim.core.api.simulation_context import SimulationContext
from .ui_widget_wrapper import UIWidgetWrapper from .ui_widget_wrapper import UIWidgetWrapper
if TYPE_CHECKING: if TYPE_CHECKING:
import omni.isaac.ui import isaacsim.gui.components
import omni.ui import omni.ui
...@@ -397,7 +397,7 @@ class LiveLinePlot(UIWidgetWrapper): ...@@ -397,7 +397,7 @@ class LiveLinePlot(UIWidgetWrapper):
max_legend = max([len(legend) for legend in self._legends]) max_legend = max([len(legend) for legend in self._legends])
CHAR_WIDTH = 8 CHAR_WIDTH = 8
with omni.ui.VGrid( with omni.ui.VGrid(
row_height=omni.isaac.ui.ui_utils.LABEL_HEIGHT, row_height=isaacsim.gui.components.ui_utils.LABEL_HEIGHT,
column_width=max_legend * CHAR_WIDTH + 6, column_width=max_legend * CHAR_WIDTH + 6,
): ):
for idx in range(len(self._y_data)): for idx in range(len(self._y_data)):
...@@ -442,7 +442,7 @@ class LiveLinePlot(UIWidgetWrapper): ...@@ -442,7 +442,7 @@ class LiveLinePlot(UIWidgetWrapper):
with omni.ui.HStack(): with omni.ui.HStack():
omni.ui.Label( omni.ui.Label(
"Limits", "Limits",
width=omni.isaac.ui.ui_utils.LABEL_WIDTH, width=isaacsim.gui.components.ui_utils.LABEL_WIDTH,
alignment=omni.ui.Alignment.LEFT_CENTER, alignment=omni.ui.Alignment.LEFT_CENTER,
) )
...@@ -460,10 +460,10 @@ class LiveLinePlot(UIWidgetWrapper): ...@@ -460,10 +460,10 @@ class LiveLinePlot(UIWidgetWrapper):
omni.ui.Button( omni.ui.Button(
"Re-Scale", "Re-Scale",
width=omni.isaac.ui.ui_utils.BUTTON_WIDTH, width=isaacsim.gui.components.ui_utils.BUTTON_WIDTH,
clicked_fn=self._rescale_btn_pressed, clicked_fn=self._rescale_btn_pressed,
alignment=omni.ui.Alignment.LEFT_CENTER, alignment=omni.ui.Alignment.LEFT_CENTER,
style=omni.isaac.ui.ui_utils.get_style(), style=isaacsim.gui.components.ui_utils.get_style(),
) )
omni.ui.CheckBox(model=self._autoscale_model, tooltip="", width=4) omni.ui.CheckBox(model=self._autoscale_model, tooltip="", width=4)
...@@ -498,7 +498,7 @@ class LiveLinePlot(UIWidgetWrapper): ...@@ -498,7 +498,7 @@ class LiveLinePlot(UIWidgetWrapper):
self.clear() self.clear()
self._filter_mode = value self._filter_mode = value
omni.isaac.ui.ui_utils.dropdown_builder( isaacsim.gui.components.ui_utils.dropdown_builder(
label="Filter", label="Filter",
type="dropdown", type="dropdown",
items=["None", "Lowpass", "Integrate", "Derivative"], items=["None", "Lowpass", "Integrate", "Derivative"],
...@@ -512,10 +512,10 @@ class LiveLinePlot(UIWidgetWrapper): ...@@ -512,10 +512,10 @@ class LiveLinePlot(UIWidgetWrapper):
# Button # Button
omni.ui.Button( omni.ui.Button(
"Play/Pause", "Play/Pause",
width=omni.isaac.ui.ui_utils.BUTTON_WIDTH, width=isaacsim.gui.components.ui_utils.BUTTON_WIDTH,
clicked_fn=_toggle_paused, clicked_fn=_toggle_paused,
alignment=omni.ui.Alignment.LEFT_CENTER, alignment=omni.ui.Alignment.LEFT_CENTER,
style=omni.isaac.ui.ui_utils.get_style(), style=isaacsim.gui.components.ui_utils.get_style(),
) )
def _create_ui_widget(self): def _create_ui_widget(self):
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# This file has been adapted from _isaac_sim/exts/omni.isaac.ui/omni/isaac/ui/element_wrappers/base_ui_element_wrappers.py # This file has been adapted from _isaac_sim/exts/isaacsim.gui.components/isaacsim/gui/components/element_wrappers/base_ui_element_wrappers.py
from __future__ import annotations from __future__ import annotations
......
...@@ -32,7 +32,7 @@ from isaaclab.envs.ui import ManagerBasedRLEnvWindow ...@@ -32,7 +32,7 @@ from isaaclab.envs.ui import ManagerBasedRLEnvWindow
from isaaclab.scene import InteractiveSceneCfg from isaaclab.scene import InteractiveSceneCfg
from isaaclab.utils import configclass from isaaclab.utils import configclass
enable_extension("omni.isaac.ui") enable_extension("isaacsim.gui.components")
@configclass @configclass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment