Commit 581354c6 authored by Mayank Mittal's avatar Mayank Mittal Committed by David Hoeller

Adds images to showroom scripts documentation (#130)

# Description

This MR adds images to the showroom documentation page. It also modifies
the scripts to make sure the default camera placement is nice.

## Type of change

- This change requires a documentation update

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.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
- [ ] 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
parent 06715c2c
......@@ -87,8 +87,8 @@ Table of Contents
source/overview/environments
source/overview/reinforcement-learning/index
source/overview/teleop_imitation
source/overview/showroom
source/overview/basic_agents
source/overview/sample_scripts
.. toctree::
:maxdepth: 2
......
Basic Agents
============
Simple Agents
=============
Workflows
---------
......@@ -28,7 +28,7 @@ The list of environments available registered with OpenAI Gym can be found by ru
isaaclab.bat -p source\standalone\environments\list_envs.py
Basic agents
Dummy agents
~~~~~~~~~~~~
These include basic agents that output zero or random agents. They are
......
Showroom Demos
==============
The main core interface extension in Isaac Lab ``omni.isaac.lab`` provides
the main modules for actuators, objects, robots and sensors. We provide
a list of demo scripts and tutorials. These showcase how to use the provided
interfaces within a code in a minimal way.
A few quick showroom scripts to run and checkout:
- Spawn different quadrupeds and make robots stand using position commands:
.. tab-set::
:sync-group: os
.. tab-item:: :icon:`fa-brands fa-linux` Linux
:sync: linux
.. code:: bash
./isaaclab.sh -p source/standalone/demos/quadrupeds.py
.. tab-item:: :icon:`fa-brands fa-windows` Windows
:sync: windows
.. code:: batch
isaaclab.bat -p source\standalone\demos\quadrupeds.py
- Spawn different arms and apply random joint position commands:
.. tab-set::
:sync-group: os
.. tab-item:: :icon:`fa-brands fa-linux` Linux
:sync: linux
.. code:: bash
./isaaclab.sh -p source/standalone/demos/arms.py
.. tab-item:: :icon:`fa-brands fa-windows` Windows
:sync: windows
.. code:: batch
isaaclab.bat -p source\standalone\demos\arms.py
- Spawn different hands and command them to open and close:
.. tab-set::
:sync-group: os
.. tab-item:: :icon:`fa-brands fa-linux` Linux
:sync: linux
.. code:: bash
./isaaclab.sh -p source/standalone/demos/hands.py
.. tab-item:: :icon:`fa-brands fa-windows` Windows
:sync: windows
.. code:: batch
isaaclab.bat -p source\standalone\demos\hands.py
- Spawn procedurally generated terrains with different configurations:
.. tab-set::
:sync-group: os
.. tab-item:: :icon:`fa-brands fa-linux` Linux
:sync: linux
.. code:: bash
./isaaclab.sh -p source/standalone/demos/procedural_terrain.py
.. tab-item:: :icon:`fa-brands fa-windows` Windows
:sync: windows
.. code:: batch
isaaclab.bat -p source\standalone\demos\procedural_terrain.py
- Spawn different deformable (soft) bodies and let them fall from a height:
.. tab-set::
:sync-group: os
.. tab-item:: :icon:`fa-brands fa-linux` Linux
:sync: linux
.. code:: bash
./isaaclab.sh -p source/standalone/demos/deformables.py
.. tab-item:: :icon:`fa-brands fa-windows` Windows
:sync: windows
.. code:: batch
isaaclab.bat -p source\standalone\demos\deformables.py
- Spawn multiple markers that are useful for visualizations:
.. tab-set::
:sync-group: os
.. tab-item:: :icon:`fa-brands fa-linux` Linux
:sync: linux
.. code:: bash
./isaaclab.sh -p source/standalone/demos/markers.py
.. tab-item:: :icon:`fa-brands fa-windows` Windows
:sync: windows
.. code:: batch
isaaclab.bat -p source\standalone\demos\markers.py
Showroom Demos
==============
The main core interface extension in Isaac Lab ``omni.isaac.lab`` provides
the main modules for actuators, objects, robots and sensors. We provide
a list of demo scripts and tutorials. These showcase how to use the provided
interfaces within a code in a minimal way.
A few quick showroom scripts to run and checkout:
- Spawn different quadrupeds and make robots stand using position commands:
.. tab-set::
:sync-group: os
.. tab-item:: :icon:`fa-brands fa-linux` Linux
:sync: linux
.. code:: bash
./isaaclab.sh -p source/standalone/demos/quadrupeds.py
.. tab-item:: :icon:`fa-brands fa-windows` Windows
:sync: windows
.. code:: batch
isaaclab.bat -p source\standalone\demos\quadrupeds.py
.. image:: ../_static/demos/quadrupeds.jpg
:width: 100%
:alt: Quadrupeds in Isaac Lab
- Spawn different arms and apply random joint position commands:
.. tab-set::
:sync-group: os
.. tab-item:: :icon:`fa-brands fa-linux` Linux
:sync: linux
.. code:: bash
./isaaclab.sh -p source/standalone/demos/arms.py
.. tab-item:: :icon:`fa-brands fa-windows` Windows
:sync: windows
.. code:: batch
isaaclab.bat -p source\standalone\demos\arms.py
.. image:: ../_static/demos/arms.jpg
:width: 100%
:alt: Arms in Isaac Lab
- Spawn different hands and command them to open and close:
.. tab-set::
:sync-group: os
.. tab-item:: :icon:`fa-brands fa-linux` Linux
:sync: linux
.. code:: bash
./isaaclab.sh -p source/standalone/demos/hands.py
.. tab-item:: :icon:`fa-brands fa-windows` Windows
:sync: windows
.. code:: batch
isaaclab.bat -p source\standalone\demos\hands.py
.. image:: ../_static/demos/hands.jpg
:width: 100%
:alt: Dexterous hands in Isaac Lab
- Spawn procedurally generated terrains with different configurations:
.. tab-set::
:sync-group: os
.. tab-item:: :icon:`fa-brands fa-linux` Linux
:sync: linux
.. code:: bash
./isaaclab.sh -p source/standalone/demos/procedural_terrain.py
.. tab-item:: :icon:`fa-brands fa-windows` Windows
:sync: windows
.. code:: batch
isaaclab.bat -p source\standalone\demos\procedural_terrain.py
.. image:: ../_static/demos/procedural_terrain.jpg
:width: 100%
:alt: Procedural Terrains in Isaac Lab
- Spawn different deformable (soft) bodies and let them fall from a height:
.. tab-set::
:sync-group: os
.. tab-item:: :icon:`fa-brands fa-linux` Linux
:sync: linux
.. code:: bash
./isaaclab.sh -p source/standalone/demos/deformables.py
.. tab-item:: :icon:`fa-brands fa-windows` Windows
:sync: windows
.. code:: batch
isaaclab.bat -p source\standalone\demos\deformables.py
.. image:: ../_static/demos/deformables.jpg
:width: 100%
:alt: Deformable primitive-shaped objects in Isaac Lab
- Spawn multiple markers that are useful for visualizations:
.. tab-set::
:sync-group: os
.. tab-item:: :icon:`fa-brands fa-linux` Linux
:sync: linux
.. code:: bash
./isaaclab.sh -p source/standalone/demos/markers.py
.. tab-item:: :icon:`fa-brands fa-windows` Windows
:sync: windows
.. code:: batch
isaaclab.bat -p source\standalone\demos\markers.py
.. image:: ../_static/demos/markers.jpg
:width: 100%
:alt: Markers in Isaac Lab
......@@ -167,9 +167,15 @@ from a height and settling on to the ground. Meanwhile the other two cubes must
should see a marker showing the kinematic target position for the nodes at the bottom-left corner of the cubes.
To stop the simulation, you can either close the window, or press ``Ctrl+C`` in the terminal
This tutorial showed how to spawn rigid objects and wrap them in a :class:`DeformableObject` class to initialize their
physics handles which allows setting and obtaining their state. In the next tutorial, we will see how to interact
with an articulated object which is a collection of rigid objects connected by joints.
.. figure:: ../../_static/tutorials/tutorial_run_deformable_object.jpg
:align: center
:figwidth: 100%
:alt: result of run_deformable_object.py
This tutorial showed how to spawn deformable objects and wrap them in a :class:`DeformableObject` class to initialize their
physics handles which allows setting and obtaining their state. We also saw how to apply kinematic commands to the
deformable object to move the mesh nodes in a controlled manner. In the next tutorial, we will see how to create
a scene using the :class:`InteractiveScene` class.
.. _PhysX documentation: https://nvidia-omniverse.github.io/PhysX/physx/5.4.1/docs/SoftBodies.html
.. _partial kinematic: https://nvidia-omniverse.github.io/PhysX/physx/5.4.1/docs/SoftBodies.html#kinematic-soft-bodies
......@@ -345,12 +345,10 @@ class VisualizationMarkers:
# resolve prim path
marker_prim_path = f"{self.prim_path}/{name}"
# create a child prim for the marker
prim = cfg.func(prim_path=marker_prim_path, cfg=cfg)
marker_prim = cfg.func(prim_path=marker_prim_path, cfg=cfg)
# make the asset uninstanceable (in case it is)
# point instancer defines its own prototypes so if an asset is already instanced, this doesn't work.
self._process_prototype_prim(prim)
# remove any physics on the markers because they are only for visualization!
physx_utils.removeRigidBodySubtree(prim)
self._process_prototype_prim(marker_prim)
# add child reference to point instancer
self._instancer_manager.GetPrototypesRel().AddTarget(marker_prim_path)
# check that we loaded all the prototypes
......@@ -407,3 +405,6 @@ class VisualizationMarkers:
)
# add children to list
all_prims += child_prim.GetChildren()
# remove any physics on the markers because they are only for visualization!
physx_utils.removeRigidBodySubtree(prim)
......@@ -49,23 +49,25 @@ def main():
"""Main function."""
# Load kit helper
sim = SimulationContext(sim_utils.SimulationCfg(device="cpu", dt=0.01))
sim = SimulationContext(sim_utils.SimulationCfg(dt=0.005))
# Set main camera
sim.set_camera_view(eye=[3.5, 3.5, 3.5], target=[0.0, 0.0, 0.0])
sim.set_camera_view(eye=[3.0, 0.0, 2.25], target=[0.0, 0.0, 1.0])
# Spawn things into stage
# Ground-plane
cfg = sim_utils.GroundPlaneCfg()
cfg.func("/World/defaultGroundPlane", cfg)
# Lights
cfg = sim_utils.DistantLightCfg(intensity=3000.0, color=(0.75, 0.75, 0.75))
cfg = sim_utils.DomeLightCfg(intensity=2000.0, color=(0.75, 0.75, 0.75))
cfg.func("/World/Light", cfg)
# Define origins
origins = torch.tensor([
[0.0, -1.0, 0.0],
[0.0, 0.0, 0.0],
[0.0, 1.0, 0.0],
[0.0, 2.0, 0.0],
])
]).to(device=sim.device)
# Robots
cassie = Articulation(CASSIE_CFG.replace(prim_path="/World/Cassie"))
h1 = Articulation(H1_CFG.replace(prim_path="/World/H1"))
......
......@@ -82,7 +82,7 @@ def define_markers() -> VisualizationMarkers:
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(1.0, 0.25, 0.0)),
),
"robot_mesh": sim_utils.UsdFileCfg(
usd_path=f"{ISAACLAB_NUCLEUS_DIR}/Robots/ANYbotics/ANYmal-D/anymal_d.usd",
usd_path=f"{ISAACLAB_NUCLEUS_DIR}/Robots/ANYbotics/ANYmal-C/anymal_c.usd",
scale=(2.0, 2.0, 2.0),
visual_material=sim_utils.GlassMdlCfg(glass_color=(0.0, 0.1, 0.0)),
),
......
......@@ -156,7 +156,7 @@ def main():
# Initialize the simulation context
sim = sim_utils.SimulationContext(sim_utils.SimulationCfg(dt=0.01))
# Set main camera
sim.set_camera_view(eye=[2.5, 2.5, 2.5], target=[0.0, 0.0, 0.0])
sim.set_camera_view(eye=[5.0, 5.0, 5.0], target=[0.0, 0.0, 0.0])
# design scene
scene_entities, scene_origins = design_scene()
# Play the simulator
......
......@@ -6,6 +6,11 @@
"""
This script demonstrates how to simulate a quadcopter.
.. code-block:: bash
# Usage
./isaaclab.sh -p source/standalone/demos/quadcopter.py
"""
"""Launch Isaac Sim Simulator first."""
......@@ -42,9 +47,9 @@ def main():
"""Main function."""
# Load kit helper
sim = SimulationContext(sim_utils.SimulationCfg(device="cpu", dt=0.005))
sim = SimulationContext(sim_utils.SimulationCfg(dt=0.005))
# Set main camera
sim.set_camera_view(eye=[3.5, 3.5, 3.5], target=[0.0, 0.0, 0.0])
sim.set_camera_view(eye=[0.5, 0.5, 1.0], target=[0.0, 0.0, 0.5])
# Spawn things into stage
# Ground-plane
......@@ -55,11 +60,11 @@ def main():
cfg.func("/World/Light", cfg)
# Robots
robot_cfg = CRAZYFLIE_CFG
robot_cfg.spawn.func("/World/Crazyflie/Robot_1", robot_cfg.spawn, translation=(1.5, 0.5, 0.42))
robot_cfg = CRAZYFLIE_CFG.replace(prim_path="/World/Crazyflie")
robot_cfg.spawn.func("/World/Crazyflie", robot_cfg.spawn, translation=robot_cfg.init_state.pos)
# create handles for the robots
robot = Articulation(robot_cfg.replace(prim_path="/World/Crazyflie/Robot.*"))
robot = Articulation(robot_cfg)
# Play the simulator
sim.reset()
......@@ -92,7 +97,7 @@ def main():
# reset command
print(">>>>>>>> Reset!")
# apply action to the robot (make the robot float in place)
forces = torch.zeros(1, 4, 3, device=sim.device)
forces = torch.zeros(robot.num_instances, 4, 3, device=sim.device)
torques = torch.zeros_like(forces)
forces[..., 2] = robot_mass * gravity / 4.0
robot.set_external_force_and_torque(forces, torques, body_ids=prop_body_ids)
......
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