Unverified Commit 51413145 authored by Mayank Mittal's avatar Mayank Mittal Committed by GitHub

Simplifies running of scripts and unit-tests (#448)

# Description

With Isaac Sim 2023.1, it seems we no longer need to have try-catch
blocks in the scripts. This allows us to simplify all the scripts and
test runners. Along with that, it enables VSCode debugger support which
is crucial for many developers.

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## 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 run all the tests with `./orbit.sh --test` and they pass
- [ ] 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 b95d6f3f
......@@ -11,7 +11,6 @@
schemas
spawners
utils
runners
.. rubric:: Classes
......@@ -58,10 +57,3 @@ Utilities
.. automodule:: omni.isaac.orbit.sim.utils
:members:
:show-inheritance:
Runners
-------
.. automodule:: omni.isaac.orbit.sim.runners
:members:
:show-inheritance:
......@@ -102,7 +102,6 @@ for 200 steps, and saves it in the ``videos`` folder at a step interval of 1500
"""Rest everything follows."""
import gymnasium as gym
# adjust camera resolution and pose
......
......@@ -21,7 +21,7 @@ The tutorial corresponds to the ``create_empty.py`` script in the ``orbit/source
.. literalinclude:: ../../../../source/standalone/tutorials/00_sim/create_empty.py
:language: python
:emphasize-lines: 18-30,34-38,44-48,51,56-58,71
:emphasize-lines: 18-30,34,40-44,46-47,51-54,60-61
:linenos:
......@@ -47,24 +47,21 @@ and enabling off-screen rendering.
.. literalinclude:: ../../../../source/standalone/tutorials/00_sim/create_empty.py
:language: python
:lines: 18-30
:linenos:
:lineno-start: 18
:start-at: import argparse
:end-at: simulation_app = app_launcher.app
Importing python modules
------------------------
Once the simulation app is running, it is possible to import different Python modules from
Isaac Sim and other libraries. Here we import two modules:
Isaac Sim and other libraries. Here we import the following module:
* `carb`_: A library that provides various microservices and diagnostics utilities in Omniverse.
* :mod:`omni.isaac.orbit.sim`: A sub-package in Orbit for all the core simulator-related operations.
.. literalinclude:: ../../../../source/standalone/tutorials/00_sim/create_empty.py
:language: python
:lines: 36-38
:linenos:
:lineno-start: 36
:start-at: from omni.isaac.orbit.sim import SimulationCfg, SimulationContext
:end-at: from omni.isaac.orbit.sim import SimulationCfg, SimulationContext
Configuring the simulation context
......@@ -85,9 +82,9 @@ instance of the simulation context.
.. literalinclude:: ../../../../source/standalone/tutorials/00_sim/create_empty.py
:language: python
:lines: 44-48
:linenos:
:lineno-start: 44
:start-at: # Initialize the simulation context
:end-at: sim.set_camera_view([2.5, 2.5, 2.5], [0.0, 0.0, 0.0])
Following the creation of the simulation context, we have only configured the physics acting on the
simulated scene. This includes the device to use for simulation, the gravity vector, and other advanced
......@@ -120,22 +117,19 @@ set to True.
.. literalinclude:: ../../../../source/standalone/tutorials/00_sim/create_empty.py
:language: python
:lines: 56-58
:linenos:
:lineno-start: 56
:start-at: # Play the simulator
:end-at: sim.step()
Exiting the simulation
----------------------
Lastly, the simulation application is stopped and its window is closed by calling
:meth:`omni.isaac.kit.SimulationApp.close` method. We do this operation under a try-catch
statement to close the app gracefully in case an error happens.
:meth:`omni.isaac.kit.SimulationApp.close` method.
.. literalinclude:: ../../../../source/standalone/tutorials/00_sim/create_empty.py
:language: python
:lines: 70-71
:linenos:
:lineno-start: 70
:start-at: # close sim app
:end-at: simulation_app.close()
The Code Execution
......
......@@ -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: 43-82, 95
:emphasize-lines: 40-79, 91-92
:linenos:
......@@ -82,14 +82,13 @@ information on the available spawners, please refer to the :mod:`sim.spawners` m
Spawning a ground plane
-----------------------
The :class:`sim.spawners.GroundPlaneCfg` configures a grid-like ground plane with modifiable properties such as its
appearance and size.
The :class:`~sim.spawners.from_files.GroundPlaneCfg` configures a grid-like ground plane with
modifiable properties such as its appearance and size.
.. literalinclude:: ../../../../source/standalone/tutorials/00_sim/spawn_prims.py
:language: python
:lines: 45-47
:linenos:
:lineno-start: 45
:start-at: # Ground-plane
:end-at: cfg_ground.func("/World/defaultGroundPlane", cfg_ground)
Spawning lights
......@@ -101,9 +100,8 @@ from the scene and shines in a single direction.
.. literalinclude:: ../../../../source/standalone/tutorials/00_sim/spawn_prims.py
:language: python
:lines: 49-54
:linenos:
:lineno-start: 49
:start-at: # spawn distant light
:end-at: cfg_light_distant.func("/World/lightDistant", cfg_light_distant, translation=(1, 0, 10))
Spawning primitive shapes
......@@ -115,21 +113,19 @@ Here we make an Xform prim to group all the primitive shapes under it.
.. literalinclude:: ../../../../source/standalone/tutorials/00_sim/spawn_prims.py
:language: python
:lines: 56-57
:linenos:
:lineno-start: 56
:start-at: # create a new xform prim for all objects to be spawned under
:end-at: prim_utils.create_prim("/World/Objects", "Xform")
Next, we spawn a cone using the :class:`sim.spawners.ConeCfg` class. It is possible to specify the radius, height,
physics properties, and material properties of the cone. By default, the physics and material properties are disabled.
Next, we spawn a cone using the :class:`~sim.spawners.shapes.ConeCfg` class. It is possible to specify
the radius, height, physics properties, and material properties of the cone. By default, the physics and material
properties are disabled.
The first two cones we spawn ``Cone1`` and ``Cone2`` are visual elements and do not have physics enabled.
.. literalinclude:: ../../../../source/standalone/tutorials/00_sim/spawn_prims.py
:language: python
:lines: 58-65
:linenos:
:lineno-start: 58
:start-at: # spawn a red cone
:end-at: cfg_cone.func("/World/Objects/Cone2", cfg_cone, translation=(-1.0, -1.0, 1.0))
For the third cone ``ConeRigid``, we add rigid body physics to it by setting the attributes for that in the configuration
class. Through these attributes, we can specify the mass, friction, and restitution of the cone. If unspecified, they
......@@ -137,9 +133,8 @@ default to the default values set by USD Physics.
.. literalinclude:: ../../../../source/standalone/tutorials/00_sim/spawn_prims.py
:language: python
:lines: 67-78
:linenos:
:lineno-start: 67
:start-at: # spawn a green cone with colliders and rigid body
:end-before: # spawn a usd file of a table into the scene
Spawning from another file
......@@ -151,9 +146,8 @@ All of this information is stored in its USD file.
.. literalinclude:: ../../../../source/standalone/tutorials/00_sim/spawn_prims.py
:language: python
:lines: 80-82
:linenos:
:lineno-start: 80
:start-at: # spawn a usd file of a table into the scene
:end-at: cfg.func("/World/Objects/Table", cfg, translation=(0.0, 0.0, 1.05))
The table above is added as a reference to the scene. In layman terms, this means that the table is not actually added
to the scene, but a ``pointer`` to the table asset is added. This allows us to modify the table asset and have the changes
......
......@@ -23,7 +23,7 @@ directory.
.. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_articulation.py
:language: python
:emphasize-lines: 62-73, 95-108, 112-115, 120-121
:emphasize-lines: 60-71, 93-106, 110-113, 118-119
:linenos:
......@@ -49,9 +49,8 @@ an instance of the :class:`assets.Articulation` class by passing the configurati
.. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_articulation.py
:language: python
:lines: 62-73
:linenos:
:lineno-start: 62
:start-at: # Create separate groups called "Origin1", "Origin2", "Origin3"
:end-at: cartpole = Articulation(cfg=cartpole_cfg)
Running the simulation loop
......@@ -73,9 +72,8 @@ Finally, we call the :meth:`Articulation.reset` method to reset any internal buf
.. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_articulation.py
:language: python
:lines: 95-108
:linenos:
:lineno-start: 95
:start-at: # reset the scene entities
:end-at: robot.reset()
Stepping the simulation
"""""""""""""""""""""""
......@@ -97,9 +95,8 @@ the simulation.
.. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_articulation.py
:language: python
:lines: 112-115
:linenos:
:lineno-start: 112
:start-at: # Apply random action
:end-at: robot.write_data_to_sim()
Updating the state
......@@ -110,9 +107,8 @@ articulation. To update the state inside the buffer, we call the :meth:`assets.A
.. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_articulation.py
:language: python
:lines: 120-121
:linenos:
:lineno-start: 120
:start-at: # Update buffers
:end-at: robot.update(sim_dt)
The Code Execution
......
......@@ -20,7 +20,7 @@ The tutorial corresponds to the ``run_rigid_object.py`` script in the ``orbit/so
.. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_rigid_object.py
:language: python
:emphasize-lines: 59-78, 80-82, 102-112, 115-118, 122-123, 136-138, 143-144
:emphasize-lines: 57-76, 78-80, 100-110, 113-114, 120-121, 134-136, 141-142
:linenos:
......@@ -63,9 +63,8 @@ present in the scene, the rigid object prims are spawned at the locations ``/Wor
.. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_rigid_object.py
:language: python
:lines: 59-78
:linenos:
:lineno-start: 59
:start-at: # Create separate groups called "Origin1", "Origin2", "Origin3"
:end-at: cone_object = RigidObject(cfg=cone_cfg)
Since we want to interact with the rigid object, we pass this entity back to the main function. This entity
is then used to interact with the rigid object in the simulation loop. In later tutorials, we will see a more
......@@ -73,9 +72,8 @@ convenient way to handle multiple scene entities using the :class:`scene.Interac
.. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_rigid_object.py
:language: python
:lines: 80-82
:linenos:
:lineno-start: 80
:start-at: # return the scene information
:end-at: return scene_entities, origins
Running the simulation loop
......@@ -103,9 +101,8 @@ As the name suggests, this method writes the root state of the rigid object prim
.. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_rigid_object.py
:language: python
:lines: 102-112
:linenos:
:lineno-start: 102
:start-at: # reset root state
:end-at: cone_object.reset()
Stepping the simulation
"""""""""""""""""""""""
......@@ -116,9 +113,8 @@ external forces to the rigid object, so this method is not necessary. However, i
.. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_rigid_object.py
:language: python
:lines: 115-116
:linenos:
:lineno-start: 115
:start-at: # apply sim data
:end-at: cone_object.write_data_to_sim()
Updating the state
""""""""""""""""""
......@@ -128,9 +124,8 @@ inside the :class:`assets.RigidObject.data` attribute. This is done using the :m
.. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_rigid_object.py
:language: python
:lines: 122-123
:linenos:
:lineno-start: 122
:start-at: # update buffers
:end-at: cone_object.update(sim-dt)
The Code Execution
......
......@@ -40,7 +40,7 @@ This tutorial corresponds to the ``create_scene.py`` script within
.. literalinclude:: ../../../../source/standalone/tutorials/02_scene/create_scene.py
:language: python
:emphasize-lines: 55-68, 73-75, 96-97, 104-105, 110-111, 121-123
:emphasize-lines: 52-65, 70-72, 93-94, 101-102, 107-108, 118-120
:linenos:
......@@ -63,9 +63,7 @@ them now in the configuration class :class:`CartpoleSceneCfg` instead of manuall
.. literalinclude:: ../../../../source/standalone/tutorials/02_scene/create_scene.py
:language: python
:lines: 55-68
:linenos:
:lineno-start: 55
:pyobject: CartpoleSceneCfg
The variable names in the configuration class are used as keys to access the corresponding
entity from the :class:`scene.InteractiveScene` object. For example, the cartpole can
......@@ -110,9 +108,8 @@ This will be used to clone the scene for each environment.
.. literalinclude:: ../../../../source/standalone/tutorials/02_scene/create_scene.py
:language: python
:lines: 121-123
:linenos:
:lineno-start: 121
:start-at: # Design scene
:end-at: scene = InteractiveScene(scene_cfg)
Accessing scene elements
------------------------
......@@ -125,9 +122,8 @@ the cartpole is specified using the key ``"cartpole"`` in the configuration clas
.. literalinclude:: ../../../../source/standalone/tutorials/02_scene/create_scene.py
:language: python
:lines: 73-75
:linenos:
:lineno-start: 73
:start-at: # Extract scene entities
:end-at: robot = scene["cartpole"]
Running the simulation loop
---------------------------
......
......@@ -32,7 +32,7 @@ directory.
.. literalinclude:: ../../../../source/standalone/tutorials/03_envs/create_cartpole_base_env.py
:language: python
:emphasize-lines: 51-55, 58-75, 78-111, 114-133, 138-142, 147, 151, 156-157, 163-164
:emphasize-lines: 49-53, 56-73, 76-109, 112-131, 136-140, 145, 149, 154-155, 161-162
:linenos:
......@@ -79,8 +79,6 @@ Thus, we will create an action term that controls the force applied to the cart.
.. literalinclude:: ../../../../source/standalone/tutorials/03_envs/create_cartpole_base_env.py
:language: python
:pyobject: ActionsCfg
:linenos:
:lineno-start: 51
Defining observations
---------------------
......@@ -111,8 +109,6 @@ default values for this tutorial.
.. literalinclude:: ../../../../source/standalone/tutorials/03_envs/create_cartpole_base_env.py
:language: python
:pyobject: ObservationsCfg
:linenos:
:lineno-start: 58
Defining randomizations
-----------------------
......@@ -141,8 +137,6 @@ the cartpole and the pole at every reset.
.. literalinclude:: ../../../../source/standalone/tutorials/03_envs/create_cartpole_base_env.py
:language: python
:pyobject: RandomizationCfg
:linenos:
:lineno-start: 78
Tying it all together
---------------------
......@@ -159,8 +153,6 @@ be modified as needed. We recommend doing so by defining the :meth:`__post_init_
.. literalinclude:: ../../../../source/standalone/tutorials/03_envs/create_cartpole_base_env.py
:language: python
:pyobject: CartpoleEnvCfg
:linenos:
:lineno-start: 114
Running the simulation
----------------------
......@@ -179,8 +171,6 @@ for the environment. In this tutorial, we reset the simulation at regular interv
.. literalinclude:: ../../../../source/standalone/tutorials/03_envs/create_cartpole_base_env.py
:language: python
:pyobject: main
:linenos:
:lineno-start: 136
An important thing to note above is that the entire simulation loop is wrapped inside the
:meth:`torch.inference_mode` context manager. This is because the environment uses PyTorch
......
......@@ -49,7 +49,7 @@ The script for running the environment ``run_cartpole_rl_env.py`` is present in
.. literalinclude:: ../../../../source/standalone/tutorials/03_envs/run_cartpole_rl_env.py
:language: python
:emphasize-lines: 46-50, 64-65
:emphasize-lines: 43-47, 61-62
:linenos:
......@@ -86,8 +86,6 @@ For the cartpole task, we will use the following reward terms:
.. literalinclude:: ../../../../source/extensions/omni.isaac.orbit_tasks/omni/isaac/orbit_tasks/classic/cartpole/cartpole_env_cfg.py
:language: python
:pyobject: RewardsCfg
:linenos:
:lineno-start: 124
Defining termination criteria
-----------------------------
......@@ -111,8 +109,6 @@ or terminated term. These are used to indicate the two types of terminations as
.. literalinclude:: ../../../../source/extensions/omni.isaac.orbit_tasks/omni/isaac/orbit_tasks/classic/cartpole/cartpole_env_cfg.py
:language: python
:pyobject: TerminationsCfg
:linenos:
:lineno-start: 152
Defining commands
-----------------
......@@ -128,8 +124,6 @@ locomotion or manipulation tasks.
.. literalinclude:: ../../../../source/extensions/omni.isaac.orbit_tasks/omni/isaac/orbit_tasks/classic/cartpole/cartpole_env_cfg.py
:language: python
:pyobject: CommandsCfg
:linenos:
:lineno-start: 63
Defining curriculum
-------------------
......@@ -145,8 +139,6 @@ We use a simple pass-through curriculum to define a curriculum manager that does
.. literalinclude:: ../../../../source/extensions/omni.isaac.orbit_tasks/omni/isaac/orbit_tasks/classic/cartpole/cartpole_env_cfg.py
:language: python
:pyobject: CurriculumCfg
:linenos:
:lineno-start: 165
Tying it all together
---------------------
......@@ -158,8 +150,6 @@ only with the added RL components explained in the above sections.
.. literalinclude:: ../../../../source/extensions/omni.isaac.orbit_tasks/omni/isaac/orbit_tasks/classic/cartpole/cartpole_env_cfg.py
:language: python
:pyobject: CartpoleEnvCfg
:linenos:
:lineno-start: 177
Running the simulation loop
---------------------------
......@@ -173,8 +163,6 @@ such as the reward contribution from individual terms, the termination status of
.. literalinclude:: ../../../../source/standalone/tutorials/03_envs/run_cartpole_rl_env.py
:language: python
:pyobject: main
:linenos:
:lineno-start: 44
The Code Execution
......
......@@ -12,7 +12,8 @@ class.
.. literalinclude:: ../../../../source/standalone/tutorials/03_envs/run_cartpole_rl_env.py
:language: python
:lines: 39-50
:start-at: # create environment configuration
:end-at: env = RLTaskEnv(cfg=env_cfg)
While straightforward, this approach is not scalable as we have a large suite of environments.
In this tutorial, we will show how to use the :meth:`gymnasium.register` method to register
......@@ -25,7 +26,7 @@ the :meth:`gymnasium.make` function.
.. literalinclude:: ../../../../source/standalone/environments/random_agent.py
:language: python
:lines: 40-50
:lines: 40-51
The Code
......@@ -38,7 +39,7 @@ The tutorial corresponds to the ``random_agent.py`` script in the ``orbit/source
.. literalinclude:: ../../../../source/standalone/environments/random_agent.py
:language: python
:emphasize-lines: 40-42, 47-50
:emphasize-lines: 39-41, 46-51
:linenos:
......@@ -96,9 +97,8 @@ file which iterates over all the sub-packages and registers their respective env
.. literalinclude:: ../../../../source/standalone/environments/random_agent.py
:language: python
:lines: 40-41
:linenos:
:lineno-start: 40
:start-at: import omni.isaac.orbit_tasks # noqa: F401
:end-at: import omni.isaac.orbit_tasks # noqa: F401
In this tutorial, the task name is read from the command line. The task name is used to parse
the default configuration as well as to create the environment instance. In addition, other
......@@ -107,9 +107,8 @@ and whether to render, are used to override the default configuration.
.. literalinclude:: ../../../../source/standalone/environments/random_agent.py
:language: python
:lines: 47-50
:linenos:
:lineno-start: 47
:start-at: # create environment configuration
:end-at: env = gym.make(args_cli.task, cfg=env_cfg)
Once creating the environment, the rest of the execution follows the standard resetting and stepping.
......
......@@ -40,7 +40,7 @@ For this tutorial, we use the training script from `Stable-Baselines3`_ workflow
.. literalinclude:: ../../../../source/standalone/workflows/sb3/train.py
:language: python
:emphasize-lines: 61, 69, 74-76, 96-110, 125-126, 114-123
:emphasize-lines: 58, 61, 67-69, 78, 92-96, 98-99, 102-110, 112, 117-125, 127-128, 135-138
:linenos:
The Code Explained
......
......@@ -37,7 +37,7 @@ The tutorial corresponds to the ``add_sensors_on_robot.py`` script in the
.. literalinclude:: ../../../../source/standalone/tutorials/04_sensors/add_sensors_on_robot.py
:language: python
:emphasize-lines: 77-100, 152-162, 176-177
:emphasize-lines: 74-97, 145-155, 169-170
:linenos:
......@@ -85,9 +85,11 @@ and ``"front_cam"`` is the name of the prim associated with the camera sensor.
.. literalinclude:: ../../../../source/standalone/tutorials/04_sensors/add_sensors_on_robot.py
:language: python
:lines: 78-88
:linenos:
:lineno-start: 78
:start-at: camera = CameraCfg(
:end-before: height_scanner = RayCasterCfg(
Height scanner
--------------
The height-scanner is implemented as a virtual sensor using the NVIDIA Warp ray-casting kernels.
Through the :class:`sensors.RayCasterCfg`, we can specify the pattern of rays to cast and the
......@@ -108,9 +110,8 @@ The entire configuration of the height-scanner is as follows:
.. literalinclude:: ../../../../source/standalone/tutorials/04_sensors/add_sensors_on_robot.py
:language: python
:lines: 89-97
:linenos:
:lineno-start: 89
:start-at: height_scanner = RayCasterCfg(
:end-before: contact_forces = ContactSensorCfg(
Contact sensor
--------------
......@@ -138,9 +139,8 @@ The entire configuration of the contact sensor is as follows:
.. literalinclude:: ../../../../source/standalone/tutorials/04_sensors/add_sensors_on_robot.py
:language: python
:lines: 98-100
:linenos:
:lineno-start: 98
:start-at: contact_forces = ContactSensorCfg(
:lines: 1-3
Running the simulation loop
---------------------------
......@@ -150,9 +150,8 @@ when the simulation is played, i.e., it is important to call ``sim.reset()`` aft
.. literalinclude:: ../../../../source/standalone/tutorials/04_sensors/add_sensors_on_robot.py
:language: python
:lines: 176-177
:linenos:
:lineno-start: 177
:start-at: # Play the simulator
:end-at: sim.reset()
Besides that, the simulation loop is similar to the previous tutorials. The sensors are updated as part
of the scene update and they internally handle the updating of their buffers based on their update
......@@ -163,9 +162,8 @@ to access the data for the different sensors created in this tutorial:
.. literalinclude:: ../../../../source/standalone/tutorials/04_sensors/add_sensors_on_robot.py
:language: python
:lines: 152-162
:linenos:
:lineno-start: 152
:start-at: # print information from the sensors
:end-at: print("Received max contact force of: ", torch.max(scene["contact_forces"].data.net_forces_w).item())
The Code Execution
......
......@@ -25,7 +25,7 @@ The tutorial corresponds to the ``run_diff_ik.py`` script in the
.. literalinclude:: ../../../../source/standalone/tutorials/05_controllers/run_diff_ik.py
:language: python
:emphasize-lines: 103-105, 126-141, 160-162, 166-176
:emphasize-lines: 100-102, 123-138, 157-159, 163-173
:linenos:
......@@ -67,9 +67,8 @@ will use the absolute pose command mode.
.. literalinclude:: ../../../../source/standalone/tutorials/05_controllers/run_diff_ik.py
:language: python
:lines: 103-105
:linenos:
:lineno-start: 103
:start-at: # Create controller
:end-at: diff_ik_controller = DifferentialIKController(diff_ik_cfg, num_envs=scene.num_envs, device=sim.device)
Obtaining the robot's joint and body indices
--------------------------------------------
......@@ -97,9 +96,8 @@ this class.
.. literalinclude:: ../../../../source/standalone/tutorials/05_controllers/run_diff_ik.py
:language: python
:lines: 126-141
:linenos:
:lineno-start: 126
:start-at: # Specify robot-specific parameters
:end-before: # Define simulation stepping
Computing robot command
......@@ -115,9 +113,8 @@ the robot's base frame.
.. literalinclude:: ../../../../source/standalone/tutorials/05_controllers/run_diff_ik.py
:language: python
:lines: 160-162
:linenos:
:lineno-start: 160
:start-at: # reset controller
:end-at: diff_ik_controller.set_command(ik_commands)
We can then compute the desired joint positions using the
:meth:`~controllers.DifferentialIKController.compute` method.
......@@ -128,18 +125,16 @@ its value computed from the physics engine.
.. literalinclude:: ../../../../source/standalone/tutorials/05_controllers/run_diff_ik.py
:language: python
:lines: 166-176
:linenos:
:lineno-start: 166
:start-at: # obtain quantities from simulation
:end-at: joint_pos_des = diff_ik_controller.compute(ee_pos_b, ee_quat_b, jacobian, joint_pos)
The computed joint position targets can then be applied on the robot, as done in the
previous tutorials.
.. literalinclude:: ../../../../source/standalone/tutorials/05_controllers/run_diff_ik.py
:language: python
:lines: 178-180
:linenos:
:lineno-start: 178
:start-at: # apply actions
:end-at: scene.write_data_to_sim()
The Code Execution
......
......@@ -27,7 +27,6 @@ To make it convenient to use the module, we recommend importing the module as fo
"""
from .converters import * # noqa: F401, F403
from .runners import * # noqa: F401, F403
from .schemas import * # noqa: F401, F403
from .simulation_cfg import PhysxCfg, SimulationCfg # noqa: F401, F403
from .simulation_context import SimulationContext, build_simulation_context # noqa: F401, F403
......
# Copyright (c) 2022-2024, The ORBIT Project Developers.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
"""Sub-module with runners to simplify running main and unittests."""
from __future__ import annotations
import traceback
import unittest
import carb
from omni.isaac.kit import SimulationApp
__all__ = ["run_tests", "run_main"]
def run_tests(simulation_app: SimulationApp, verbosity: int = 2, try_except: bool = True):
"""Wrapper for running tests via ``unittest`` with the provided simulation app.
Args:
simulation_app: An instance of the :class:`omni.isaac.kit.SimulationApp`.
verbosity: Verbosity level for the test runner. Defaults to 2.
try_except: Whether to wrap ``unittest.main()`` in a try-except block. Defaults to True.
This is useful to remove the try-except block, as it causes issues with VSCode's debugger.
When False, there is a bit more console spam, but the debugger works as expected.
"""
_run_function(
fn=unittest.main, kwargs={"verbosity": verbosity}, simulation_app=simulation_app, try_except=try_except
)
def run_main(main_fn: callable[[], None], simulation_app: SimulationApp, try_except: bool = False):
"""Wrapper for running ``main`` with the provided simulation app.
Args:
main_fn: Main function to run.
simulation_app: An instance of the :class:`omni.isaac.kit.SimulationApp`.
try_except: Whether to wrap ``main()`` in a try-except block. Defaults to False.
This is useful to remove the try-except block, as it causes issues with VSCode's debugger.
When False, there is a bit more console spam, but the debugger works as expected.
"""
_run_function(fn=main_fn, kwargs={}, simulation_app=simulation_app, try_except=try_except)
"""
Private methods.
"""
def _run_function(fn: callable, kwargs: dict, simulation_app: SimulationApp, try_except: bool = False):
"""Wrapper for running a function with the provided simulation app.
Args:
fn: Function to run.
kwargs: Keyword arguments to pass to the function.
simulation_app: An instance of the :class:`omni.isaac.kit.SimulationApp`.
try_except: Whether to wrap ``fn()`` in a try-except block. Defaults to False.
This is useful to remove the try-except block, as it causes issues with VSCode's debugger.
When False, there is a bit more console spam, but the debugger works as expected.
"""
if try_except:
try:
fn(**kwargs)
except Exception as err:
# Log out exceptions before re-raising them
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# Close sim app
simulation_app.close()
else:
fn(**kwargs)
simulation_app.close()
......@@ -39,9 +39,6 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import torch
import traceback
import carb
import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.assets import Articulation
......@@ -128,13 +125,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -37,11 +37,7 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import torch
import traceback
import carb
import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.assets import Articulation
......@@ -168,13 +164,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -20,10 +20,8 @@ simulation_app = app_launcher.app
import ctypes
import torch
import traceback
import unittest
import carb
import omni.isaac.core.utils.stage as stage_utils
import omni.isaac.orbit.sim as sim_utils
......@@ -420,12 +418,7 @@ class TestArticulation(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -20,10 +20,8 @@ simulation_app = app_launcher.app
import ctypes
import torch
import traceback
import unittest
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.core.utils.stage as stage_utils
......@@ -142,12 +140,7 @@ class TestRigidObject(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -21,7 +21,6 @@ mpl_logger.setLevel(logging.WARNING)
"""Rest everything follows."""
import numpy as np
import os
import random
......
......@@ -22,7 +22,6 @@ mpl_logger.setLevel(logging.WARNING)
"""Rest everything follows."""
import matplotlib.pyplot as plt
import numpy as np
import os
......
......@@ -15,7 +15,6 @@ simulation_app = SimulationApp(config)
"""Rest everything follows."""
import unittest
import omni.isaac.core.utils.prims as prim_utils
......
......@@ -15,10 +15,8 @@ simulation_app = AppLauncher(headless=True).app
"""Rest everything follows."""
import torch
import traceback
import unittest
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.core.utils.stage as stage_utils
from omni.isaac.cloner import GridCloner
......@@ -207,12 +205,7 @@ class TestDifferentialIKController(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -22,9 +22,6 @@ from __future__ import annotations
"""Launch Isaac Sim Simulator first."""
import argparse
import traceback
import carb
# omni-isaac-orbit
from omni.isaac.orbit.app import AppLauncher
......@@ -46,7 +43,6 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import numpy as np
import os
import random
......@@ -250,13 +246,7 @@ def main():
if __name__ == "__main__":
try:
# Run the main function
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -40,10 +40,8 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import os
import torch
import traceback
import carb
import omni.isaac.core.utils.nucleus as nucleus_utils
......@@ -178,13 +176,7 @@ def main():
if __name__ == "__main__":
try:
# Run the main function
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -44,12 +44,9 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import numpy as np
import torch
import traceback
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.replicator.core as rep
from omni.isaac.cloner import GridCloner
......@@ -163,13 +160,7 @@ def main():
if __name__ == "__main__":
try:
# Run the main function
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -24,9 +24,7 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import ctypes
import traceback
import carb
from omni.isaac.core.simulation_context import SimulationContext
from omni.isaac.orbit.devices import Se3Keyboard
......@@ -88,13 +86,7 @@ def main():
if __name__ == "__main__":
try:
# Run the main function
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -34,11 +34,9 @@ app_launcher = AppLauncher(args_cli)
simulation_app = app_launcher.app
"""Rest everything follows."""
import os
import torch
import traceback
import carb
import omni.isaac.orbit.envs.mdp as mdp
import omni.isaac.orbit.sim as sim_utils
......@@ -244,13 +242,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -31,10 +31,8 @@ app_launcher = AppLauncher(args_cli)
simulation_app = app_launcher.app
"""Rest everything follows."""
import torch
import traceback
import carb
import torch
import omni.isaac.orbit.envs.mdp as mdp
import omni.isaac.orbit.sim as sim_utils
......@@ -264,13 +262,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -15,12 +15,9 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import traceback
import unittest
from collections import namedtuple
import carb
from omni.isaac.orbit.envs.mdp import NullCommandCfg
......@@ -53,12 +50,7 @@ class TestNullCommandTerm(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -16,12 +16,9 @@ simulation_app = AppLauncher(config).app
"""Rest everything follows."""
import torch
import traceback
import unittest
from collections import namedtuple
import carb
from omni.isaac.orbit.managers import ManagerTermBase, ObservationGroupCfg, ObservationManager, ObservationTermCfg
from omni.isaac.orbit.utils import configclass
......@@ -300,12 +297,7 @@ class TestObservationManager(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -15,12 +15,9 @@ simulation_app = AppLauncher(config).app
"""Rest everything follows."""
import traceback
import unittest
from collections import namedtuple
import carb
from omni.isaac.orbit.managers import RewardManager, RewardTermCfg
from omni.isaac.orbit.utils import configclass
......@@ -171,12 +168,7 @@ class TestRewardManager(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -40,10 +40,6 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import traceback
import carb
import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.assets import ArticulationCfg, AssetBaseCfg
from omni.isaac.orbit.scene import InteractiveScene, InteractiveSceneCfg
......@@ -150,13 +146,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -17,10 +17,8 @@ simulation_app = AppLauncher(config).app
"""Rest everything follows."""
import torch
import traceback
import unittest
import carb
import omni.isaac.core.utils.stage as stage_utils
from omni.isaac.core.simulation_context import SimulationContext
......@@ -209,12 +207,7 @@ class TestUsdVisualizationMarkers(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -29,10 +29,6 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import traceback
import carb
import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.assets import AssetBaseCfg
from omni.isaac.orbit.scene import InteractiveScene, InteractiveSceneCfg
......@@ -162,13 +158,7 @@ def main():
if __name__ == "__main__":
try:
# Run the main function
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -36,11 +36,8 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import torch
import traceback
import carb
import omni.isaac.core.utils.prims as prim_utils
from omni.isaac.cloner import GridCloner
from omni.isaac.core.simulation_context import SimulationContext
......@@ -172,13 +169,7 @@ def main():
if __name__ == "__main__":
try:
# Run the main function
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -41,11 +41,8 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import torch
import traceback
import carb
import omni.isaac.core.utils.prims as prim_utils
from omni.isaac.cloner import GridCloner
from omni.isaac.core.prims import RigidPrimView
......@@ -182,13 +179,7 @@ def main():
if __name__ == "__main__":
try:
# Run the main function
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -24,10 +24,8 @@ import os
import random
import scipy.spatial.transform as tf
import torch
import traceback
import unittest
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.core.utils.stage as stage_utils
import omni.replicator.core as rep
......@@ -381,12 +379,7 @@ class TestCamera(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -22,10 +22,8 @@ simulation_app = app_launcher.app
import math
import scipy.spatial.transform as tf
import torch
import traceback
import unittest
import carb
import omni.isaac.core.utils.stage as stage_utils
import omni.isaac.orbit.sim as sim_utils
......@@ -308,12 +306,7 @@ class TestFrameTransformer(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -20,10 +20,8 @@ import copy
import numpy as np
import os
import torch
import traceback
import unittest
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.core.utils.stage as stage_utils
import omni.replicator.core as rep
......@@ -567,12 +565,7 @@ class TestWarpCamera(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -21,11 +21,11 @@ app_launcher = AppLauncher(headless=True)
simulation_app = app_launcher.app
"""Rest everything follows."""
import unittest
from omni.isaac.core.utils.prims import is_prim_path_valid
from omni.isaac.orbit.sim.runners import run_tests
from omni.isaac.orbit.sim.simulation_cfg import SimulationCfg
from omni.isaac.orbit.sim.simulation_context import build_simulation_context
......@@ -100,4 +100,7 @@ class TestBuildSimulationContextHeadless(unittest.TestCase):
if __name__ == "__main__":
run_tests(simulation_app=simulation_app)
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -20,11 +20,11 @@ app_launcher = AppLauncher(headless=False)
simulation_app = app_launcher.app
"""Rest everything follows."""
import unittest
from omni.isaac.core.utils.prims import is_prim_path_valid
from omni.isaac.orbit.sim.runners import run_tests
from omni.isaac.orbit.sim.simulation_cfg import SimulationCfg
from omni.isaac.orbit.sim.simulation_context import build_simulation_context
......@@ -100,4 +100,7 @@ class TestBuildSimulationContextNonheadless(unittest.TestCase):
if __name__ == "__main__":
run_tests(simulation_app=simulation_app)
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -15,10 +15,8 @@ simulation_app = AppLauncher(headless=True).app
import os
import tempfile
import traceback
import unittest
import carb
import omni
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.core.utils.stage as stage_utils
......@@ -265,12 +263,7 @@ class TestMeshConverter(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -14,10 +14,8 @@ simulation_app = AppLauncher(headless=True).app
"""Rest everything follows."""
import traceback
import unittest
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.core.utils.stage as stage_utils
from omni.isaac.core.simulation_context import SimulationContext
......@@ -272,12 +270,7 @@ class TestPhysicsSchema(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -16,10 +16,8 @@ simulation_app = AppLauncher(headless=True).app
import ctypes
import numpy as np
import traceback
import unittest
import carb
import omni.isaac.core.utils.prims as prim_utils
from omni.isaac.core.simulation_context import SimulationContext as IsaacSimulationContext
......@@ -137,12 +135,7 @@ class TestSimulationContext(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -12,10 +12,8 @@ simulation_app = AppLauncher(headless=True).app
"""Rest everything follows."""
import traceback
import unittest
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.core.utils.stage as stage_utils
from omni.isaac.core.simulation_context import SimulationContext
......@@ -87,12 +85,7 @@ class TestSpawningFromFiles(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -14,10 +14,8 @@ simulation_app = AppLauncher(headless=True).app
"""Rest everything follows."""
import traceback
import unittest
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.core.utils.stage as stage_utils
from omni.isaac.core.simulation_context import SimulationContext
......@@ -164,12 +162,7 @@ class TestSpawningLights(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -14,10 +14,8 @@ simulation_app = AppLauncher(headless=True).app
"""Rest everything follows."""
import traceback
import unittest
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.core.utils.stage as stage_utils
from omni.isaac.core.simulation_context import SimulationContext
......@@ -173,12 +171,7 @@ class TestSpawningMaterials(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -14,10 +14,8 @@ simulation_app = AppLauncher(headless=True).app
"""Rest everything follows."""
import traceback
import unittest
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.core.utils.stage as stage_utils
from omni.isaac.core.simulation_context import SimulationContext
......@@ -125,12 +123,7 @@ class TestSpawningSensors(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -14,10 +14,8 @@ simulation_app = AppLauncher(headless=True).app
"""Rest everything follows."""
import traceback
import unittest
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.core.utils.stage as stage_utils
from omni.isaac.core.simulation_context import SimulationContext
......@@ -305,12 +303,7 @@ class TestSpawningUsdGeometries(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -18,10 +18,8 @@ simulation_app = AppLauncher(config).app
import math
import numpy as np
import os
import traceback
import unittest
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.core.utils.stage as stage_utils
from omni.isaac.core.articulations import ArticulationView
......@@ -160,12 +158,7 @@ class TestUrdfConverter(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -16,10 +16,8 @@ simulation_app = AppLauncher(config).app
"""Rest everything follows."""
import numpy as np
import traceback
import unittest
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.core.utils.stage as stage_utils
......@@ -88,12 +86,7 @@ class TestUtilities(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -9,7 +9,6 @@ from __future__ import annotations
import argparse
import os
import traceback
parser = argparse.ArgumentParser(description="Generate terrains using trimesh")
parser.add_argument(
......@@ -29,8 +28,6 @@ simulation_app = app_launcher.app
import trimesh
import carb
import omni.isaac.orbit.terrains.height_field as hf_gen
from omni.isaac.orbit.terrains.utils import color_meshes_by_height
......@@ -267,13 +264,7 @@ def main():
if __name__ == "__main__":
try:
# Run the main function
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -9,7 +9,6 @@ from __future__ import annotations
import argparse
import os
import traceback
parser = argparse.ArgumentParser(description="Generate terrains using trimesh")
parser.add_argument(
......@@ -30,8 +29,6 @@ simulation_app = app_launcher.app
import argparse
import trimesh
import carb
import omni.isaac.orbit.terrains.trimesh as mesh_gen
from omni.isaac.orbit.terrains.utils import color_meshes_by_height
......@@ -431,13 +428,7 @@ def main():
if __name__ == "__main__":
try:
# Run the main function
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -8,7 +8,6 @@ from __future__ import annotations
"""Launch Isaac Sim Simulator first."""
import os
import traceback
from omni.isaac.orbit.app import AppLauncher
......@@ -22,8 +21,6 @@ simulation_app = app_launcher.app
import shutil
import carb
from omni.isaac.orbit.terrains.config.rough import ROUGH_TERRAINS_CFG
from omni.isaac.orbit.terrains.terrain_generator import TerrainGenerator
......@@ -46,13 +43,7 @@ def main():
if __name__ == "__main__":
try:
# Run the main function
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -65,9 +65,7 @@ simulation_app = app_launcher.app
import numpy as np
import traceback
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.kit.commands
from omni.isaac.cloner import GridCloner
......@@ -202,13 +200,7 @@ def main():
if __name__ == "__main__":
try:
# Run the main function
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -19,15 +19,12 @@ simulation_app = app_launcher.app
import copy
import os
import traceback
import unittest
from collections.abc import Callable
from dataclasses import MISSING, asdict, field
from functools import wraps
from typing import ClassVar
import carb
from omni.isaac.orbit.utils.configclass import configclass
from omni.isaac.orbit.utils.dict import class_to_dict, update_class_from_dict
from omni.isaac.orbit.utils.io import dump_yaml, load_yaml
......@@ -708,12 +705,7 @@ class TestConfigClass(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -17,11 +17,8 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import traceback
import unittest
import carb
import omni.isaac.orbit.utils.dict as dict_utils
......@@ -86,12 +83,7 @@ class TestDictUtilities(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -6,7 +6,6 @@
from __future__ import annotations
import torch
import traceback
import unittest
from math import pi as PI
......@@ -20,7 +19,6 @@ from omni.isaac.orbit.app import AppLauncher
# launch omniverse app in headless mode
simulation_app = AppLauncher(headless=True).app
import carb
import omni.isaac.orbit.utils.math as math_utils
......@@ -114,12 +112,7 @@ class TestMathUtilities(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -18,11 +18,8 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import random
import traceback
import unittest
import carb
import omni.isaac.orbit.utils.string as string_utils
......@@ -133,12 +130,7 @@ class TestStringUtilities(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -18,11 +18,8 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import time
import traceback
import unittest
import carb
from omni.isaac.orbit.utils.timer import Timer
......@@ -52,12 +49,7 @@ class TestTimer(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -19,13 +19,10 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import gymnasium as gym
import torch
import traceback
import unittest
import carb
import omni.usd
from omni.isaac.orbit.envs import RLTaskEnv, RLTaskEnvCfg
......@@ -137,12 +134,7 @@ class TestEnvironments(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -18,14 +18,11 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import gymnasium as gym
import os
import torch
import traceback
import unittest
import carb
import omni.usd
from omni.isaac.orbit.envs import RLTaskEnv, RLTaskEnvCfg
......@@ -95,12 +92,7 @@ class TestRecordVideoWrapper(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -19,13 +19,10 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import gymnasium as gym
import torch
import traceback
import unittest
import carb
import omni.usd
from omni.isaac.orbit.envs import RLTaskEnvCfg
......@@ -120,12 +117,7 @@ class TestRlGamesVecEnvWrapper(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -19,13 +19,10 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import gymnasium as gym
import torch
import traceback
import unittest
import carb
import omni.usd
from omni.isaac.orbit.envs import RLTaskEnvCfg
......@@ -156,12 +153,7 @@ class TestRslRlVecEnvWrapper(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -19,14 +19,11 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import gymnasium as gym
import numpy as np
import torch
import traceback
import unittest
import carb
import omni.usd
from omni.isaac.orbit.envs import RLTaskEnvCfg
......@@ -126,12 +123,7 @@ class TestStableBaselines3VecEnvWrapper(unittest.TestCase):
if __name__ == "__main__":
try:
unittest.main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run main
unittest.main(verbosity=2, exit=False)
# close sim app
simulation_app.close()
......@@ -34,9 +34,7 @@ app_launcher = AppLauncher(args_cli)
simulation_app = app_launcher.app
import torch
import traceback
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.orbit.sim as sim_utils
......@@ -154,13 +152,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -30,10 +30,6 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import traceback
import carb
import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.assets import Articulation
from omni.isaac.orbit.sim import SimulationContext
......@@ -107,13 +103,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -35,9 +35,6 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import torch
import traceback
import carb
import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.markers import VisualizationMarkers, VisualizationMarkersCfg
......@@ -153,13 +150,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -70,9 +70,6 @@ simulation_app = app_launcher.app
import random
import torch
import traceback
import carb
import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.assets import AssetBase
......@@ -174,13 +171,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -37,9 +37,7 @@ simulation_app = app_launcher.app
import numpy as np
import torch
import traceback
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.orbit.sim as sim_utils
......@@ -184,13 +182,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -33,12 +33,8 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import gymnasium as gym
import torch
import traceback
import carb
import omni.isaac.contrib_tasks # noqa: F401
import omni.isaac.orbit_tasks # noqa: F401
......@@ -47,7 +43,7 @@ from omni.isaac.orbit_tasks.utils import parse_env_cfg
def main():
"""Random actions agent with Orbit environment."""
# parse configuration
# create environment configuration
env_cfg = parse_env_cfg(
args_cli.task, use_gpu=not args_cli.cpu, num_envs=args_cli.num_envs, use_fabric=not args_cli.disable_fabric
)
......@@ -73,13 +69,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -41,10 +41,8 @@ simulation_app = app_launcher.app
import gymnasium as gym
import torch
import traceback
from collections.abc import Sequence
import carb
import warp as wp
from omni.isaac.orbit.assets.rigid_object.rigid_object_data import RigidObjectData
......@@ -295,13 +293,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -38,7 +38,6 @@ simulation_app = app_launcher.app
import gymnasium as gym
import torch
import traceback
import carb
......@@ -124,13 +123,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -35,9 +35,6 @@ simulation_app = app_launcher.app
import gymnasium as gym
import torch
import traceback
import carb
import omni.isaac.contrib_tasks # noqa: F401
import omni.isaac.orbit_tasks # noqa: F401
......@@ -72,13 +69,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -67,9 +67,7 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import traceback
import carb
import omni.isaac.core.utils.prims as prim_utils
from omni.isaac.cloner import GridCloner
from omni.isaac.core.simulation_context import SimulationContext
......@@ -130,13 +128,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -40,7 +40,6 @@ optional arguments:
import argparse
import contextlib
from omni.isaac.orbit.app import AppLauncher
......@@ -81,8 +80,8 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import contextlib
import os
import traceback
import carb
import omni.isaac.core.utils.stage as stage_utils
......@@ -174,13 +173,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -33,9 +33,7 @@ from __future__ import annotations
import argparse
import contextlib
# omni-isaac-orbit
from omni.isaac.orbit.app import AppLauncher
# add argparse arguments
......@@ -66,8 +64,8 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import contextlib
import os
import traceback
import carb
import omni.isaac.core.utils.stage as stage_utils
......@@ -140,13 +138,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -31,10 +31,6 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import traceback
import carb
from omni.isaac.orbit.sim import SimulationCfg, SimulationContext
......@@ -59,13 +55,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -41,10 +41,6 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import traceback
import carb
import omni.isaac.orbit.sim as sim_utils
......@@ -94,13 +90,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -34,10 +34,6 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import traceback
import carb
from omni.isaac.orbit.sim import SimulationCfg, SimulationContext
......@@ -80,13 +76,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -31,9 +31,6 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import traceback
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.orbit.sim as sim_utils
......@@ -106,13 +103,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -35,9 +35,7 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import torch
import traceback
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.orbit.sim as sim_utils
......@@ -140,13 +138,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -36,9 +36,7 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import torch
import traceback
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.orbit.sim as sim_utils
......@@ -145,13 +143,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -36,9 +36,6 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import torch
import traceback
import carb
import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.assets import ArticulationCfg, AssetBaseCfg
......@@ -130,13 +127,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -31,11 +31,9 @@ app_launcher = AppLauncher(args_cli)
simulation_app = app_launcher.app
"""Rest everything follows."""
import math
import torch
import traceback
import carb
import omni.isaac.orbit.envs.mdp as mdp
from omni.isaac.orbit.envs import BaseEnv, BaseEnvCfg
......@@ -165,13 +163,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -42,9 +42,6 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import torch
import traceback
import carb
import omni.isaac.orbit.envs.mdp as mdp
import omni.isaac.orbit.sim as sim_utils
......@@ -301,13 +298,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -43,9 +43,6 @@ simulation_app = app_launcher.app
import os
import torch
import traceback
import carb
import omni.isaac.orbit.envs.mdp as mdp
import omni.isaac.orbit.sim as sim_utils
......@@ -244,13 +241,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -32,9 +32,6 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import torch
import traceback
import carb
from omni.isaac.orbit.envs import RLTaskEnv
......@@ -43,7 +40,7 @@ from omni.isaac.orbit_tasks.classic.cartpole.cartpole_env_cfg import CartpoleEnv
def main():
"""Main function."""
# parse the arguments
# create environment configuration
env_cfg = CartpoleEnvCfg()
env_cfg.scene.num_envs = args_cli.num_envs
# setup RL environment
......@@ -73,13 +70,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -43,9 +43,6 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import torch
import traceback
import carb
import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.assets import ArticulationCfg, AssetBaseCfg
......@@ -100,12 +97,8 @@ class SensorsSceneCfg(InteractiveSceneCfg):
)
def run_simulator(
sim: sim_utils.SimulationContext,
scene: InteractiveScene,
):
def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene):
"""Run the simulator."""
# Define simulation stepping
sim_dt = sim.get_physics_dt()
sim_time = 0.0
......@@ -182,13 +175,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -33,11 +33,8 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import torch
import traceback
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.orbit.sim as sim_utils
......@@ -149,13 +146,7 @@ def main():
if __name__ == "__main__":
try:
# Run the main function
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -35,12 +35,9 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import os
import torch
import traceback
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.replicator.core as rep
......@@ -185,13 +182,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -40,14 +40,11 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import numpy as np
import os
import random
import torch
import traceback
import carb
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.debug_draw._debug_draw as omni_debug_draw
import omni.replicator.core as rep
......@@ -250,13 +247,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -40,9 +40,6 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import torch
import traceback
import carb
import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.assets import AssetBaseCfg
......@@ -211,13 +208,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -44,9 +44,7 @@ import gymnasium as gym
import math
import os
import torch
import traceback
import carb
from rl_games.common import env_configurations, vecenv
from rl_games.common.player import BasePlayer
from rl_games.torch_runner import Runner
......@@ -147,13 +145,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -41,16 +41,14 @@ else:
# launch omniverse app
app_launcher = AppLauncher(args_cli, experience=app_experience)
simulation_app = app_launcher.app
"""Rest everything follows."""
"""Rest everything follows."""
import gymnasium as gym
import math
import os
import traceback
from datetime import datetime
import carb
from rl_games.common import env_configurations, vecenv
from rl_games.common.algo_observer import IsaacAlgoObserver
from rl_games.torch_runner import Runner
......@@ -141,13 +139,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -33,14 +33,10 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import contextlib
import gymnasium as gym
import os
import torch
import traceback
import carb
from omni.isaac.orbit.devices import Se3Keyboard, Se3SpaceMouse
from omni.isaac.orbit.utils.io import dump_pickle, dump_yaml
......@@ -168,13 +164,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -33,12 +33,9 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import gymnasium as gym
import torch
import traceback
import carb
import robomimic # noqa: F401
import robomimic.utils.file_utils as FileUtils
import robomimic.utils.torch_utils as TorchUtils
......@@ -88,13 +85,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -38,13 +38,10 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import gymnasium as gym
import os
import torch
import traceback
import carb
from rsl_rl.runners import OnPolicyRunner
import omni.isaac.contrib_tasks # noqa: F401
......@@ -105,13 +102,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
......@@ -49,14 +49,11 @@ simulation_app = app_launcher.app
"""Rest everything follows."""
import gymnasium as gym
import os
import torch
import traceback
from datetime import datetime
import carb
from rsl_rl.runners import OnPolicyRunner
from omni.isaac.orbit.envs import RLTaskEnvCfg
......@@ -137,13 +134,7 @@ def main():
if __name__ == "__main__":
try:
# run the main execution
main()
except Exception as err:
carb.log_error(err)
carb.log_error(traceback.format_exc())
raise
finally:
# close sim app
simulation_app.close()
# run the main function
main()
# close sim app
simulation_app.close()
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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