Unverified Commit 80cff164 authored by Mayank Mittal's avatar Mayank Mittal Committed by GitHub

Passes device from CLI args to simulation config in standalone scripts (#1114)

# Description

This pull request fixes an issue where the device was being parsed by
the app launcher but not set into the scripts. This change ensures that
the device is correctly passed from CLI arguments to the simulation
configuration in standalone scripts.

## 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
`./isaaclab.sh --format`
- [ ] 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 7b4dde86
...@@ -23,13 +23,13 @@ numbers of cameras that can run in your task environment up to a ...@@ -23,13 +23,13 @@ numbers of cameras that can run in your task environment up to a
certain specified system resource utilization threshold (without training; taking zero actions certain specified system resource utilization threshold (without training; taking zero actions
at each timestep). at each timestep).
This guide accompanies the ``benchmark_cameras.py`` script in the ``IsaacLab/source/standalone/tutorials/04_sensors`` This guide accompanies the ``benchmark_cameras.py`` script in the ``source/standalone/benchmarks``
directory. directory.
.. dropdown:: Code for benchmark_cameras.py .. dropdown:: Code for benchmark_cameras.py
:icon: code :icon: code
.. literalinclude:: ../../../source/standalone/tutorials/04_sensors/benchmark_cameras.py .. literalinclude:: ../../../source/standalone/benchmarks/benchmark_cameras.py
:language: python :language: python
:linenos: :linenos:
...@@ -41,7 +41,7 @@ First, run ...@@ -41,7 +41,7 @@ First, run
.. code-block:: bash .. code-block:: bash
./isaaclab.sh -p source/standalone/tutorials/04_sensors/benchmark_cameras.py -h ./isaaclab.sh -p source/standalone/benchmarks/benchmark_cameras.py -h
to see all possible parameters you can vary with this utility. to see all possible parameters you can vary with this utility.
...@@ -61,7 +61,7 @@ only in RGB mode, run ...@@ -61,7 +61,7 @@ only in RGB mode, run
.. code-block:: bash .. code-block:: bash
./isaaclab.sh -p source/standalone/tutorials/04_sensors/benchmark_cameras.py \ ./isaaclab.sh -p source/standalone/benchmarks/benchmark_cameras.py \
--task Isaac-Cartpole-v0 --num_tiled_cameras 100 \ --task Isaac-Cartpole-v0 --num_tiled_cameras 100 \
--task_num_cameras_per_env 2 \ --task_num_cameras_per_env 2 \
--tiled_camera_data_types rgb --tiled_camera_data_types rgb
...@@ -74,7 +74,7 @@ you can run with cartpole, you could run: ...@@ -74,7 +74,7 @@ you can run with cartpole, you could run:
.. code-block:: bash .. code-block:: bash
./isaaclab.sh -p source/standalone/tutorials/04_sensors/benchmark_cameras.py \ ./isaaclab.sh -p source/standalone/benchmarks/benchmark_cameras.py \
--task Isaac-Cartpole-v0 --num_tiled_cameras 100 \ --task Isaac-Cartpole-v0 --num_tiled_cameras 100 \
--task_num_cameras_per_env 2 \ --task_num_cameras_per_env 2 \
--tiled_camera_data_types rgb --autotune \ --tiled_camera_data_types rgb --autotune \
...@@ -97,7 +97,7 @@ For example, to view 100 random objects with 2 standard cameras, one could run ...@@ -97,7 +97,7 @@ For example, to view 100 random objects with 2 standard cameras, one could run
.. code-block:: bash .. code-block:: bash
./isaaclab.sh -p source/standalone/tutorials/04_sensors/benchmark_cameras.py \ ./isaaclab.sh -p source/standalone/benchmarks/benchmark_cameras.py \
--height 100 --width 100 --num_standard_cameras 2 \ --height 100 --width 100 --num_standard_cameras 2 \
--standard_camera_data_types instance_segmentation_fast normals --num_objects 100 \ --standard_camera_data_types instance_segmentation_fast normals --num_objects 100 \
--experiment_length 100 --experiment_length 100
...@@ -118,4 +118,4 @@ If your system has a hard time handling the desired cameras, you can try the fol ...@@ -118,4 +118,4 @@ If your system has a hard time handling the desired cameras, you can try the fol
- Decrease the number of objects in the scene - Decrease the number of objects in the scene
If your system is able to handle the amount of cameras, then the time statistics will be printed to the terminal. If your system is able to handle the amount of cameras, then the time statistics will be printed to the terminal.
After the simulations stops it can be closed with CTRL C. After the simulations stops it can be closed with CTRL+C.
...@@ -53,13 +53,13 @@ Classic environments that are based on IsaacGymEnvs implementation of MuJoCo-sty ...@@ -53,13 +53,13 @@ Classic environments that are based on IsaacGymEnvs implementation of MuJoCo-sty
| | | | | | | |
| | |cartpole-direct-link| | | | | |cartpole-direct-link| | |
+------------------+-----------------------------+-------------------------------------------------------------------------+ +------------------+-----------------------------+-------------------------------------------------------------------------+
| |cartpole| | |manager-camera-rgb-link| | Move the cart to keep the pole upwards in the classic cartpole control | | |cartpole| | |cartpole-rgb-link| | Move the cart to keep the pole upwards in the classic cartpole control |
| | | and perceptive inputs | | | | and perceptive inputs |
| | |manager-camera-dpt-link| | | | | |cartpole-depth-link| | |
| | | | | | | |
| | |cartpole-camera-rgb-link| | | | | |cartpole-rgb-direct-link| | |
| | | | | | | |
| | |cartpole-camera-dpt-link| | | | | |cartpole-depth-direct-link|| |
+------------------+-----------------------------+-------------------------------------------------------------------------+ +------------------+-----------------------------+-------------------------------------------------------------------------+
.. |humanoid| image:: ../_static/tasks/classic/humanoid.jpg .. |humanoid| image:: ../_static/tasks/classic/humanoid.jpg
...@@ -69,16 +69,14 @@ Classic environments that are based on IsaacGymEnvs implementation of MuJoCo-sty ...@@ -69,16 +69,14 @@ Classic environments that are based on IsaacGymEnvs implementation of MuJoCo-sty
.. |humanoid-link| replace:: `Isaac-Humanoid-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/humanoid/humanoid_env_cfg.py>`__ .. |humanoid-link| replace:: `Isaac-Humanoid-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/humanoid/humanoid_env_cfg.py>`__
.. |ant-link| replace:: `Isaac-Ant-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/ant/ant_env_cfg.py>`__ .. |ant-link| replace:: `Isaac-Ant-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/ant/ant_env_cfg.py>`__
.. |cartpole-link| replace:: `Isaac-Cartpole-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/cartpole/cartpole_env_cfg.py>`__ .. |cartpole-link| replace:: `Isaac-Cartpole-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/cartpole/cartpole_env_cfg.py>`__
.. |cartpole-rgb-link| replace:: `Isaac-Cartpole-RGB-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/cartpole/cartpole_camera_env_cfg.py>`__
.. |cartpole-depth-link| replace:: `Isaac-Cartpole-Depth-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/cartpole/cartpole_camera_env_cfg.py>`__
.. |humanoid-direct-link| replace:: `Isaac-Humanoid-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/humanoid/humanoid_env.py>`__ .. |humanoid-direct-link| replace:: `Isaac-Humanoid-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/humanoid/humanoid_env.py>`__
.. |ant-direct-link| replace:: `Isaac-Ant-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/ant/ant_env.py>`__ .. |ant-direct-link| replace:: `Isaac-Ant-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/ant/ant_env.py>`__
.. |manager-camera-rgb-link| replace:: `Isaac-Cartpole-RGB-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/cartpole/cartpole_camera_env_cfg.py>`__
.. |manager-camera-dpt-link| replace:: `Isaac-Cartpole-Depth-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/cartpole/cartpole_camera_env_cfg.py>`__
.. |cartpole-direct-link| replace:: `Isaac-Cartpole-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/cartpole/cartpole_env.py>`__ .. |cartpole-direct-link| replace:: `Isaac-Cartpole-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/cartpole/cartpole_env.py>`__
.. |manager-camera-rgb-link| replace:: `Isaac-Cartpole-RGB-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/cartpole/cartpole_camera_env_cfg.py>`__ .. |cartpole-rgb-direct-link| replace:: `Isaac-Cartpole-RGB-Camera-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/cartpole/cartpole_camera_env.py>`__
.. |manager-camera-dpt-link| replace:: `Isaac-Cartpole-Depth-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/cartpole/cartpole_camera_env_cfg.py>`__ .. |cartpole-depth-direct-link| replace:: `Isaac-Cartpole-Depth-Camera-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/cartpole/cartpole_camera_env.py>`__
.. |cartpole-camera-rgb-link| replace:: `Isaac-Cartpole-RGB-Camera-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/cartpole/cartpole_camera_env.py>`__
.. |cartpole-camera-dpt-link| replace:: `Isaac-Cartpole-Depth-Camera-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/cartpole/cartpole_camera_env.py>`__
Manipulation Manipulation
~~~~~~~~~~~~ ~~~~~~~~~~~~
......
...@@ -178,11 +178,11 @@ class AppLauncher: ...@@ -178,11 +178,11 @@ class AppLauncher:
* ``experience`` (str): The experience file to load when launching the SimulationApp. If a relative path * ``experience`` (str): The experience file to load when launching the SimulationApp. If a relative path
is provided, it is resolved relative to the ``apps`` folder in Isaac Sim and Isaac Lab (in that order). is provided, it is resolved relative to the ``apps`` folder in Isaac Sim and Isaac Lab (in that order).
If provided as an empty string, the experience file is determined based on the headless flag: If provided as an empty string, the experience file is determined based on the command-line flags:
* If headless and enable_cameras are True, the experience file is set to ``isaaclab.python.headless.rendering.kit``. * If headless and enable_cameras are True, the experience file is set to ``isaaclab.python.headless.rendering.kit``.
* If headless is False and enable_cameras is True, the experience file is set to ``isaaclab.python.rendering.kit``. * If headless is False and enable_cameras is True, the experience file is set to ``isaaclab.python.rendering.kit``.
* If headless is False and enable_cameras is False, the experience file is set to ``isaaclab.python.kit``. * If headless and enable_cameras are False, the experience file is set to ``isaaclab.python.kit``.
* If headless is True and enable_cameras is False, the experience file is set to ``isaaclab.python.headless.kit``. * If headless is True and enable_cameras is False, the experience file is set to ``isaaclab.python.headless.kit``.
Args: Args:
......
...@@ -5,18 +5,19 @@ ...@@ -5,18 +5,19 @@
""" """
This script might help you determine how many cameras your system can realistically run This script might help you determine how many cameras your system can realistically run
at different desired settings. You can supply different task environments at different desired settings.
to inject cameras into, or just test a sample scene. Additionally,
you can automatically find the maximum amount of cameras you can run a task with through the You can supply different task environments to inject cameras into, or just test a sample scene.
autotune functionality. Additionally, you can automatically find the maximum amount of cameras you can run a task with
through the auto-tune functionality.
.. code-block:: bash .. code-block:: bash
# Usage with GUI # Usage with GUI
./isaaclab.sh -p source/standalone/tutorials/04_sensors/benchmark_cameras.py -h ./isaaclab.sh -p source/standalone/benchmarks/benchmark_cameras.py -h
# Usage with headless # Usage with headless
./isaaclab.sh -p source/standalone/tutorials/04_sensors/benchmark_cameras.py -h --headless ./isaaclab.sh -p source/standalone/benchmarks/benchmark_cameras.py -h --headless
""" """
...@@ -753,7 +754,7 @@ def main(): ...@@ -753,7 +754,7 @@ def main():
print("[INFO]: Designing the scene") print("[INFO]: Designing the scene")
if args_cli.task is None: if args_cli.task is None:
print("[INFO]: No task environment provided, creating random scene.") print("[INFO]: No task environment provided, creating random scene.")
sim_cfg = sim_utils.SimulationCfg(device="cpu" if args_cli.cpu else "cuda") sim_cfg = sim_utils.SimulationCfg(device=args_cli.device)
sim = sim_utils.SimulationContext(sim_cfg) sim = sim_utils.SimulationContext(sim_cfg)
# Set main camera # Set main camera
sim.set_camera_view([2.5, 2.5, 2.5], [0.0, 0.0, 0.0]) sim.set_camera_view([2.5, 2.5, 2.5], [0.0, 0.0, 0.0])
......
...@@ -210,7 +210,7 @@ def run_simulator(sim: sim_utils.SimulationContext, entities: dict[str, Articula ...@@ -210,7 +210,7 @@ def run_simulator(sim: sim_utils.SimulationContext, entities: dict[str, Articula
def main(): def main():
"""Main function.""" """Main function."""
# Initialize the simulation context # Initialize the simulation context
sim_cfg = sim_utils.SimulationCfg() sim_cfg = sim_utils.SimulationCfg(device=args_cli.device)
sim = sim_utils.SimulationContext(sim_cfg) sim = sim_utils.SimulationContext(sim_cfg)
# Set main camera # Set main camera
sim.set_camera_view([3.5, 0.0, 3.2], [0.0, 0.0, 0.5]) sim.set_camera_view([3.5, 0.0, 3.2], [0.0, 0.0, 0.5])
......
...@@ -47,9 +47,9 @@ from omni.isaac.lab_assets import G1_CFG # isort:skip ...@@ -47,9 +47,9 @@ from omni.isaac.lab_assets import G1_CFG # isort:skip
def main(): def main():
"""Main function.""" """Main function."""
# Load kit helper # Load kit helper
sim = SimulationContext(sim_utils.SimulationCfg(dt=0.005)) sim_cfg = sim_utils.SimulationCfg(dt=0.005, device=args_cli.device)
sim = SimulationContext(sim_cfg)
# Set main camera # Set main camera
sim.set_camera_view(eye=[3.0, 0.0, 2.25], target=[0.0, 0.0, 1.0]) sim.set_camera_view(eye=[3.0, 0.0, 2.25], target=[0.0, 0.0, 1.0])
......
...@@ -9,10 +9,10 @@ This script demonstrates the different camera sensors that can be attached to a ...@@ -9,10 +9,10 @@ This script demonstrates the different camera sensors that can be attached to a
.. code-block:: bash .. code-block:: bash
# Usage # Usage
./isaaclab.sh -p source/standalone/demos/cameras.py --disable_fabric ./isaaclab.sh -p source/standalone/demos/cameras.py --enable_cameras
# Usage in headless mode # Usage in headless mode
./isaaclab.sh -p source/standalone/demos/cameras.py --headless --enable_cameras --disable_fabric ./isaaclab.sh -p source/standalone/demos/cameras.py --headless --enable_cameras
""" """
...@@ -274,16 +274,8 @@ def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene): ...@@ -274,16 +274,8 @@ def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene):
def main(): def main():
"""Main function.""" """Main function."""
# note: tile rendered cameras doesn't update the camera poses when using the GPU pipeline and Fabric.
# this is a bug which should be fixed in the future releases.
sim_cfg = sim_utils.SimulationCfg(dt=0.005)
# check if fabric is enabled
if args_cli.disable_fabric:
sim_cfg.use_fabric = False
sim_cfg.device = "cpu"
# Initialize the simulation context # Initialize the simulation context
sim_cfg = sim_utils.SimulationCfg(dt=0.005, device=args_cli.device, use_fabric=not args_cli.disable_fabric)
sim = sim_utils.SimulationContext(sim_cfg) sim = sim_utils.SimulationContext(sim_cfg)
# Set main camera # 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.5, 3.5, 3.5], target=[0.0, 0.0, 0.0])
......
...@@ -177,7 +177,7 @@ def run_simulator(sim: sim_utils.SimulationContext, entities: dict[str, Deformab ...@@ -177,7 +177,7 @@ def run_simulator(sim: sim_utils.SimulationContext, entities: dict[str, Deformab
def main(): def main():
"""Main function.""" """Main function."""
# Initialize the simulation context # Initialize the simulation context
sim_cfg = sim_utils.SimulationCfg(dt=0.01) sim_cfg = sim_utils.SimulationCfg(dt=0.01, device=args_cli.device)
sim = sim_utils.SimulationContext(sim_cfg) sim = sim_utils.SimulationContext(sim_cfg)
# Set main camera # Set main camera
sim.set_camera_view([4.0, 4.0, 3.0], [0.5, 0.5, 0.0]) sim.set_camera_view([4.0, 4.0, 3.0], [0.5, 0.5, 0.0])
......
...@@ -143,9 +143,9 @@ def run_simulator(sim: sim_utils.SimulationContext, entities: dict[str, Articula ...@@ -143,9 +143,9 @@ def run_simulator(sim: sim_utils.SimulationContext, entities: dict[str, Articula
def main(): def main():
"""Main function.""" """Main function."""
# Initialize the simulation context # Initialize the simulation context
sim = sim_utils.SimulationContext(sim_utils.SimulationCfg(dt=0.01)) sim_cfg = sim_utils.SimulationCfg(dt=0.01, device=args_cli.device)
sim = sim_utils.SimulationContext(sim_cfg)
# Set main camera # Set main camera
sim.set_camera_view(eye=[0.0, -0.5, 1.5], target=[0.0, -0.2, 0.5]) sim.set_camera_view(eye=[0.0, -0.5, 1.5], target=[0.0, -0.2, 0.5])
# design scene # design scene
......
...@@ -94,7 +94,8 @@ def define_markers() -> VisualizationMarkers: ...@@ -94,7 +94,8 @@ def define_markers() -> VisualizationMarkers:
def main(): def main():
"""Main function.""" """Main function."""
# Load kit helper # Load kit helper
sim = SimulationContext(sim_utils.SimulationCfg(dt=0.01)) sim_cfg = sim_utils.SimulationCfg(dt=0.01, device=args_cli.device)
sim = SimulationContext(sim_cfg)
# Set main camera # Set main camera
sim.set_camera_view([0.0, 18.0, 12.0], [0.0, 3.0, 0.0]) sim.set_camera_view([0.0, 18.0, 12.0], [0.0, 3.0, 0.0])
......
...@@ -152,9 +152,9 @@ def run_simulator(sim: sim_utils.SimulationContext, entities: dict[str, AssetBas ...@@ -152,9 +152,9 @@ def run_simulator(sim: sim_utils.SimulationContext, entities: dict[str, AssetBas
def main(): def main():
"""Main function.""" """Main function."""
# Initialize the simulation context # Initialize the simulation context
sim = sim_utils.SimulationContext(sim_utils.SimulationCfg(dt=0.01)) sim_cfg = sim_utils.SimulationCfg(dt=0.01, device=args_cli.device)
sim = sim_utils.SimulationContext(sim_cfg)
# Set main camera # Set main camera
sim.set_camera_view(eye=[5.0, 5.0, 5.0], 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 # design scene
......
...@@ -45,9 +45,9 @@ from omni.isaac.lab_assets import CRAZYFLIE_CFG # isort:skip ...@@ -45,9 +45,9 @@ from omni.isaac.lab_assets import CRAZYFLIE_CFG # isort:skip
def main(): def main():
"""Main function.""" """Main function."""
# Load kit helper # Load kit helper
sim = SimulationContext(sim_utils.SimulationCfg(dt=0.005)) sim_cfg = sim_utils.SimulationCfg(dt=0.005, device=args_cli.device)
sim = SimulationContext(sim_cfg)
# Set main camera # Set main camera
sim.set_camera_view(eye=[0.5, 0.5, 1.0], target=[0.0, 0.0, 0.5]) sim.set_camera_view(eye=[0.5, 0.5, 1.0], target=[0.0, 0.0, 0.5])
......
...@@ -70,7 +70,7 @@ def main(): ...@@ -70,7 +70,7 @@ def main():
"""Main function.""" """Main function."""
# Initialize the simulation context # Initialize the simulation context
sim_cfg = sim_utils.SimulationCfg(dt=0.01) sim_cfg = sim_utils.SimulationCfg(dt=0.01, device=args_cli.device)
sim = sim_utils.SimulationContext(sim_cfg) sim = sim_utils.SimulationContext(sim_cfg)
# Set main camera # Set main camera
sim.set_camera_view([2.0, 0.0, 2.5], [-0.5, 0.0, 0.5]) sim.set_camera_view([2.0, 0.0, 2.5], [-0.5, 0.0, 0.5])
......
...@@ -92,7 +92,7 @@ def main(): ...@@ -92,7 +92,7 @@ def main():
"""Main function.""" """Main function."""
# Initialize the simulation context # Initialize the simulation context
sim_cfg = sim_utils.SimulationCfg(dt=0.01) sim_cfg = sim_utils.SimulationCfg(dt=0.01, device=args_cli.device)
sim = sim_utils.SimulationContext(sim_cfg) sim = sim_utils.SimulationContext(sim_cfg)
# Set main camera # Set main camera
sim.set_camera_view([2.0, 0.0, 2.5], [-0.5, 0.0, 0.5]) sim.set_camera_view([2.0, 0.0, 2.5], [-0.5, 0.0, 0.5])
......
...@@ -120,7 +120,7 @@ def run_simulator(sim: sim_utils.SimulationContext, entities: dict[str, Articula ...@@ -120,7 +120,7 @@ def run_simulator(sim: sim_utils.SimulationContext, entities: dict[str, Articula
def main(): def main():
"""Main function.""" """Main function."""
# Load kit helper # Load kit helper
sim_cfg = sim_utils.SimulationCfg(device="cpu") sim_cfg = sim_utils.SimulationCfg(device=args_cli.device)
sim = SimulationContext(sim_cfg) sim = SimulationContext(sim_cfg)
# Set main camera # Set main camera
sim.set_camera_view([2.5, 0.0, 4.0], [0.0, 0.0, 2.0]) sim.set_camera_view([2.5, 0.0, 4.0], [0.0, 0.0, 2.0])
......
...@@ -146,7 +146,7 @@ def run_simulator(sim: sim_utils.SimulationContext, entities: dict[str, Deformab ...@@ -146,7 +146,7 @@ def run_simulator(sim: sim_utils.SimulationContext, entities: dict[str, Deformab
def main(): def main():
"""Main function.""" """Main function."""
# Load kit helper # Load kit helper
sim_cfg = sim_utils.SimulationCfg() sim_cfg = sim_utils.SimulationCfg(device=args_cli.device)
sim = SimulationContext(sim_cfg) sim = SimulationContext(sim_cfg)
# Set main camera # Set main camera
sim.set_camera_view(eye=[3.0, 0.0, 1.0], target=[0.0, 0.0, 0.5]) sim.set_camera_view(eye=[3.0, 0.0, 1.0], target=[0.0, 0.0, 0.5])
......
...@@ -125,7 +125,7 @@ def run_simulator(sim: sim_utils.SimulationContext, entities: dict[str, RigidObj ...@@ -125,7 +125,7 @@ def run_simulator(sim: sim_utils.SimulationContext, entities: dict[str, RigidObj
def main(): def main():
"""Main function.""" """Main function."""
# Load kit helper # Load kit helper
sim_cfg = sim_utils.SimulationCfg() sim_cfg = sim_utils.SimulationCfg(device=args_cli.device)
sim = SimulationContext(sim_cfg) sim = SimulationContext(sim_cfg)
# Set main camera # Set main camera
sim.set_camera_view(eye=[1.5, 0.0, 1.0], target=[0.0, 0.0, 0.0]) sim.set_camera_view(eye=[1.5, 0.0, 1.0], target=[0.0, 0.0, 0.0])
......
...@@ -109,7 +109,7 @@ def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene): ...@@ -109,7 +109,7 @@ def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene):
def main(): def main():
"""Main function.""" """Main function."""
# Load kit helper # Load kit helper
sim_cfg = sim_utils.SimulationCfg(device="cpu") sim_cfg = sim_utils.SimulationCfg(device=args_cli.device)
sim = SimulationContext(sim_cfg) sim = SimulationContext(sim_cfg)
# Set main camera # Set main camera
sim.set_camera_view([2.5, 0.0, 4.0], [0.0, 0.0, 2.0]) sim.set_camera_view([2.5, 0.0, 4.0], [0.0, 0.0, 2.0])
......
...@@ -156,7 +156,7 @@ def main(): ...@@ -156,7 +156,7 @@ def main():
"""Main function.""" """Main function."""
# Initialize the simulation context # Initialize the simulation context
sim_cfg = sim_utils.SimulationCfg(dt=0.005) sim_cfg = sim_utils.SimulationCfg(dt=0.005, device=args_cli.device)
sim = sim_utils.SimulationContext(sim_cfg) sim = sim_utils.SimulationContext(sim_cfg)
# Set main camera # 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.5, 3.5, 3.5], target=[0.0, 0.0, 0.0])
......
...@@ -164,7 +164,8 @@ def run_simulator(sim: sim_utils.SimulationContext, scene_entities: dict): ...@@ -164,7 +164,8 @@ def run_simulator(sim: sim_utils.SimulationContext, scene_entities: dict):
def main(): def main():
"""Main function.""" """Main function."""
# Load kit helper # Load kit helper
sim = SimulationContext(sim_utils.SimulationCfg(dt=0.005)) sim_cfg = sim_utils.SimulationCfg(dt=0.005, device=args_cli.device)
sim = SimulationContext(sim_cfg)
# Set main camera # 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=[2.5, 2.5, 2.5], target=[0.0, 0.0, 0.0])
# Design the scene # Design the scene
......
...@@ -129,7 +129,7 @@ def run_simulator(sim: sim_utils.SimulationContext, scene_entities: dict): ...@@ -129,7 +129,7 @@ def run_simulator(sim: sim_utils.SimulationContext, scene_entities: dict):
def main(): def main():
"""Main function.""" """Main function."""
# Load simulation context # Load simulation context
sim_cfg = sim_utils.SimulationCfg() sim_cfg = sim_utils.SimulationCfg(device=args_cli.device)
sim = sim_utils.SimulationContext(sim_cfg) sim = sim_utils.SimulationContext(sim_cfg)
# Set main camera # Set main camera
sim.set_camera_view([0.0, 15.0, 15.0], [0.0, 0.0, -2.5]) sim.set_camera_view([0.0, 15.0, 15.0], [0.0, 0.0, -2.5])
......
...@@ -190,7 +190,7 @@ def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene): ...@@ -190,7 +190,7 @@ def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene):
def main(): def main():
"""Main function.""" """Main function."""
# Load kit helper # Load kit helper
sim_cfg = sim_utils.SimulationCfg(dt=0.01) sim_cfg = sim_utils.SimulationCfg(dt=0.01, device=args_cli.device)
sim = sim_utils.SimulationContext(sim_cfg) sim = sim_utils.SimulationContext(sim_cfg)
# Set main camera # Set main camera
sim.set_camera_view([2.5, 2.5, 2.5], [0.0, 0.0, 0.0]) sim.set_camera_view([2.5, 2.5, 2.5], [0.0, 0.0, 0.0])
......
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