Skip to content

Commit

Permalink
Merge pull request #7 from NVlabs/mgussert/isaacsim_module_name_update
Browse files Browse the repository at this point in the history
isaacsim 4.5 update
  • Loading branch information
jaybdub authored Feb 6, 2025
2 parents 49413c9 + 496e55e commit 6381e9d
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 38 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

# main

# ref-4.5

Release targeting Isaac Sim 4.5

- Updated to use isaacsim.* rather than omni.* import calls
- Added minor fixes to API discrepancies
- Added required extension loading for replay rendering
- Updated README to include setup instructions for Isaac Sim 4.5

# ref-4.2

Release targeting Isaac Sim 4.2
Expand Down
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ To get started with MobilityGen follow the setup and usage instructions below!
- [How to implement a custom scenario](#how-to-custom-scenario)
- [📝 Data Format](#-data-format)
- [👏 Contributing](#-contributing)
-

<a id="setup"></a>
## 🛠️ Setup
Expand All @@ -64,7 +65,9 @@ Follow these steps to set up MobilityGen

### Step 1 - Install Isaac Sim

1. Using the ``Omniverse Launcher`` install ``Isaac Sim 4.2.0``
1. Download [Isaac Sim 4.5.0](https://docs.isaacsim.omniverse.nvidia.com/latest/installation/download.html)

> We'll assume you use the zip file and extract it to ``~/isaacsim``.
### Step 2 - Clone this repository

Expand All @@ -86,25 +89,31 @@ Next, we'll call ``link_app.sh`` to link the Isaac Sim installation directory to
cd MobilityGen
```
2. Run the following to link the ``app`` folder
2. Run the following to link the ``app`` folder and pass it the path to where you installed Isaac Sim
```bash
./link_app.sh
./link_app.sh --path ~/isaacsim
```
<details>
> This step is helpful as it (1) Enables us to use VS code autocompletion (2) Allows us to call ./app/python.sh to launch Isaac Sim Python scripts (3) Allows us to call ./app/isaac-sim.sh to launch Isaac Sim.
</details>
### Step 4 - Install the C++ path planner (for procedural generation)
### Step 4 - Install other python dependencies (including C++ path planner) (for procedural generation)
1. Install miscellaneous python dependencies
```bash
./app/python.sh -m pip install tqdm
```
1. Navigate to the path planner directory
2. Navigate to the path planner directory
```bash
cd MobilityGen/path_planner
```
2. Install with pip using the Isaac Sim python interpreter
3. Install with pip using the Isaac Sim python interpreter
```bash
../app/python.sh -m pip install -e .
Expand Down
8 changes: 4 additions & 4 deletions exts/omni.ext.mobility_gen/omni/ext/mobility_gen/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

import os

import omni.isaac.core.utils.prims as prim_utils
from omni.isaac.core.utils.stage import open_stage
import omni.isaac.core.objects as objects
from omni.isaac.core.utils.stage import add_reference_to_stage
import isaacsim.core.utils.prims as prim_utils
from isaacsim.core.utils.stage import open_stage
import isaacsim.core.api.objects as objects
from isaacsim.core.utils.stage import add_reference_to_stage


from omni.ext.mobility_gen.occupancy_map import OccupancyMap
Expand Down
19 changes: 10 additions & 9 deletions exts/omni.ext.mobility_gen/omni/ext/mobility_gen/robots.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
from typing import List, Type, Tuple, Union

# Isaac Sim Imports
from omni.isaac.core.prims.xform_prim import XFormPrim
from omni.isaac.core.robots.robot import Robot as _Robot
from omni.isaac.core.articulations import ArticulationView as _ArticulationView
from omni.isaac.wheeled_robots.robots import WheeledRobot as _WheeledRobot
from omni.isaac.wheeled_robots.controllers.differential_controller import DifferentialController
from omni.isaac.examples.humanoid.h1 import H1FlatTerrainPolicy
from omni.isaac.examples.quadruped.quadruped_example import SpotFlatTerrainPolicy
import omni.isaac.core.utils.numpy.rotations as rot_utils
from isaacsim.core.prims import SingleXFormPrim as XFormPrim
from isaacsim.core.api.robots.robot import Robot as _Robot
from isaacsim.core.prims import Articulation as _ArticulationView
from isaacsim.robot.wheeled_robots.robots import WheeledRobot as _WheeledRobot
from isaacsim.robot.wheeled_robots.controllers.differential_controller import DifferentialController
from isaacsim.robot.policy.examples.robots.h1 import H1FlatTerrainPolicy
from isaacsim.robot.policy.examples.robots import SpotFlatTerrainPolicy
import isaacsim.core.utils.numpy.rotations as rot_utils

# Extension imports
from omni.ext.mobility_gen.common import Buffer, Module
Expand Down Expand Up @@ -147,6 +147,7 @@ def build_front_camera(cls, prim_path):
# Add camera
camera_path = os.path.join(prim_path, cls.front_camera_base_path)
front_camera_xform = XFormPrim(camera_path)

stage = get_stage()
front_camera_prim = stage_get_prim(stage, camera_path)
prim_rotate_x(front_camera_prim, cls.front_camera_rotation[0])
Expand Down Expand Up @@ -349,7 +350,7 @@ def build(cls, prim_path: str):
def write_action(self, step_size):
action = self.action.get_value()
command = np.array([action[0], 0., action[1]])
self.controller.advance(step_size, command)
self.controller.forward(step_size, command)

def set_pose_2d(self, pose):
super().set_pose_2d(pose)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@
import numpy as np
from typing import Tuple


import omni.isaac.core.utils.numpy.rotations as rot_utils
import omni.isaac.core.objects as objects

import isaacsim.core.utils.numpy.rotations as rot_utils
import isaacsim.core.api.objects as objects

from omni.ext.mobility_gen.utils.global_utils import get_stage
from omni.ext.mobility_gen.utils.stage_utils import stage_add_dome_light
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@


import omni.kit
import omni.isaac.core
import isaacsim.core
from pxr import Usd

from omni.isaac.core_nodes.bindings import _omni_isaac_core_nodes
from isaacsim.core.nodes.bindings import _isaacsim_core_nodes
from omni.kit.viewport.utility import get_active_viewport
from .stage_utils import stage_get_prim

Expand All @@ -38,20 +38,20 @@ def new_stage() -> Usd.Stage:
return stage


def new_world(physics_dt: float = 0.01, stage_units_in_meters: float = 1.0) -> omni.isaac.core.World:
def new_world(physics_dt: float = 0.01, stage_units_in_meters: float = 1.0) -> isaacsim.core.api.World:
world = get_world()
if world is not None:
omni.isaac.core.World.clear_instance()
omni.isaac.core.World(physics_dt=physics_dt, stage_units_in_meters=stage_units_in_meters)
return omni.isaac.core.World.instance()
isaacsim.core.api.World.clear_instance()
isaacsim.core.api.World(physics_dt=physics_dt, stage_units_in_meters=stage_units_in_meters)
return isaacsim.core.api.World.instance()


def get_world() -> omni.isaac.core.World:
return omni.isaac.core.World.instance()
def get_world() -> isaacsim.core.api.World:
return isaacsim.core.api.World.instance()


def get_timestamp():
return _omni_isaac_core_nodes.acquire_interface().get_sim_time_monotonic()
return _isaacsim_core_nodes.acquire_interface().get_sim_time_monotonic()


def save_stage(path: str, default_prim: str | None = None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import tempfile
import omni.kit.usd
import typing as tp
from omni.isaac.occupancy_map.bindings import _occupancy_map
from omni.isaac.occupancy_map.utils import compute_coordinates, update_location
from isaacsim.asset.gen.omap.bindings import _omap as _occupancy_map
from isaacsim.asset.gen.omap.utils import compute_coordinates, update_location
from pxr import Sdf, UsdGeom, UsdPhysics, Usd, UsdShade, Kind

from ..types import Point2d
Expand Down Expand Up @@ -75,7 +75,8 @@ async def occupancy_map_generate_from_prim_async(

app = get_app()

om = _occupancy_map.acquire_occupancy_map_interface()
om = _occupancy_map.acquire_omap_interface()

timeline = omni.timeline.get_timeline_interface()

await app.next_update_async()
Expand Down Expand Up @@ -183,7 +184,7 @@ async def occupancy_map_generate_from_prim_async(
occupied_thresh=ROS_OCCUPIED_THRESH_DEFAULT
)

_occupancy_map.release_occupancy_map_interface(om)
_occupancy_map.release_omap_interface(om)

return occupancy_map

Expand Down
3 changes: 2 additions & 1 deletion scripts/replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@
"./app/python.sh",
"scripts/replay_implementation.py",
"--ext-folder", "exts",
"--enable", "omni.isaac.mobility_gen",
"--enable", "omni.ext.mobility_gen",
"--enable", "omni.isaac.examples",
"--enable", "isaacsim.asset.gen.omap",
"--input_path", recording_path,
"--output_path", output_path,
"--render_interval", str(args.render_interval),
Expand Down
2 changes: 1 addition & 1 deletion scripts/replay_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"scripts/replay_implementation.py",
"--ext-folder", "exts",
"--enable", "omni.ext.mobility_gen",
"--enable", "omni.isaac.examples",
"--enable", "isaacsim.asset.gen.omap",
"--input_path", recording_path,
"--output_path", output_path,
"--render_interval", str(args.render_interval),
Expand Down

0 comments on commit 6381e9d

Please sign in to comment.