Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Isaac 4.5 Upgrade #1094

Open
wants to merge 29 commits into
base: og-develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f332402
Update installation for isaac 4.5
hang-yin Feb 6, 2025
0f6af06
Fix material prim shader input
hang-yin Feb 6, 2025
8e506bb
Remove deprecated particle visualization extension
hang-yin Feb 6, 2025
91bce6a
Update isaacsim module name
hang-yin Feb 7, 2025
2aa339f
Bug fix for get_sdf_value_type_name
hang-yin Feb 7, 2025
7c9197b
Update deprecated util functions
hang-yin Feb 7, 2025
a0d7249
Tmp fix for kinematic only rigid prims
hang-yin Feb 7, 2025
b00b14a
Kit file 4.5 first iteration
hang-yin Feb 7, 2025
9777e02
Isaac 4.5 bug fix for articulation view initialization
hang-yin Feb 8, 2025
9367488
Merge branch 'og-develop' into isaac_4_5
hang-yin Feb 8, 2025
aad483d
Temporarily remove projection emitter visualization for 4.5 upgrade
hang-yin Feb 10, 2025
51974b9
Enforce isaac 4.5 version
hang-yin Feb 10, 2025
12fab4e
Robot photo update
hang-yin Feb 10, 2025
0315df9
Tmp fix for opacity setting
hang-yin Feb 11, 2025
62a5758
Update to new simulation manager warmup logic
hang-yin Feb 11, 2025
7f42412
Kinematic-only rigid prim pose fixes
hang-yin Feb 11, 2025
1ccaba8
Robot pictures update
hang-yin Feb 13, 2025
e690481
Fix scene graph test
hang-yin Feb 13, 2025
ab9217a
Tweak locobot gain for robot load and drive test
hang-yin Feb 13, 2025
7ea8bb9
Updata simulation stepping logic to account for changes in Isaac 4.5
hang-yin Feb 13, 2025
554eade
Fix transition rule test by avoiding physx error during object penetr…
hang-yin Feb 18, 2025
9d4ea02
Fix object removal test by manually refreshing physics handle
hang-yin Feb 18, 2025
bfc2c85
Remove suppressReadback flag so that it doesn't turn on gpu pipeline
hang-yin Feb 19, 2025
6bcae1a
Allow point instancer particles to get instantiated when flatcache is on
hang-yin Feb 19, 2025
c4eb7a6
Fix physics view after detachment
hang-yin Feb 19, 2025
67b8258
Fix physics view after ag release
hang-yin Feb 19, 2025
edb7cf8
Fix adding_objects context during simulation play
hang-yin Feb 19, 2025
d7f3d78
Update handles right after physics sim view is invalidated
hang-yin Feb 19, 2025
7b43a86
Merge branch 'og-develop' of https://github.com/StanfordVL/OmniGibson…
hang-yin Feb 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/assets/robots/A1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/robots/Fetch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/robots/Freight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/robots/Locobot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/robots/R1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/robots/Stretch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/robots/Tiago.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/robots/Turtlebot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions omnigibson/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ def clear(
sim._partial_clear()

# Then close the stage and remove pointers to the simulator object.
assert lazy.omni.isaac.core.utils.stage.close_stage()
assert lazy.isaacsim.core.utils.stage.close_stage()
sim = None
lazy.omni.isaac.core.simulation_context.SimulationContext.clear_instance()
lazy.isaacsim.core.api.SimulationContext.clear_instance()

# Then relaunch the simulator.
launch(**init_kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
Turtlebot: 0.2,
Husky: 0.05,
Freight: 0.1,
Locobot: 1.5,
Locobot: 1.0,
BehaviorRobot: 0.2,
R1: 0.2,
}
Expand Down
1 change: 0 additions & 1 deletion omnigibson/envs/data_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ def _optimize_sim_for_data_collection(self, viewport_camera_path):
lazy.carb.settings.get_settings().set_bool("/physics/mouseInteractionEnabled", False)
lazy.carb.settings.get_settings().set_bool("/physics/mouseGrab", False)
lazy.carb.settings.get_settings().set_bool("/physics/forceGrab", False)
lazy.carb.settings.get_settings().set_bool("/physics/suppressReadback", True)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this flag is equivalent to turning on GPU pipeline - removing


# Set the dump filter for better performance
# TODO: Possibly remove this feature once we have fully tensorized state saving, which may be more efficient
Expand Down
18 changes: 8 additions & 10 deletions omnigibson/examples/robots/import_custom_robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,22 +404,22 @@ def add_sensor(stage, root_prim, sensor_type, link_name, parent_link_name=None,
parent_link_prim = None
else:
parent_path = f"{root_prim_path}/{parent_link_name}"
assert lazy.omni.isaac.core.utils.prims.is_prim_path_valid(
assert lazy.isaacsim.core.utils.prims.is_prim_path_valid(
parent_path
), f"Could not find parent link within robot with name {parent_link_name}!"
parent_link_prim = lazy.omni.isaac.core.utils.prims.get_prim_at_path(parent_path)
parent_link_prim = lazy.isaacsim.core.utils.prims.get_prim_at_path(parent_path)

# If parent link is defined, link prim should NOT exist (this should be a new link)
link_prim_path = f"{root_prim_path}/{link_name}"
link_prim_exists = lazy.omni.isaac.core.utils.prims.is_prim_path_valid(link_prim_path)
link_prim_exists = lazy.isaacsim.core.utils.prims.is_prim_path_valid(link_prim_path)
if parent_link_prim is not None:
assert not link_prim_exists, f"Since parent link is defined, link_name {link_name} must be a link that is NOT pre-existing within the robot's set of links!"
# Manually create a new prim (specified offset)
create_rigid_prim(
stage=stage,
link_prim_path=link_prim_path,
)
link_prim_xform = lazy.omni.isaac.core.prims.xform_prim.XFormPrim(prim_path=link_prim_path)
link_prim_xform = lazy.isaacsim.core.prims.xform_prim.XFormPrim(prim_path=link_prim_path)

# Create fixed joint to connect the two together
create_joint(
Expand All @@ -433,7 +433,7 @@ def add_sensor(stage, root_prim, sensor_type, link_name, parent_link_name=None,

# Set child prim to the appropriate local pose -- this should be the parent local pose transformed by
# the additional offset
parent_prim_xform = lazy.omni.isaac.core.prims.xform_prim.XFormPrim(prim_path=parent_path)
parent_prim_xform = lazy.isaacsim.core.prims.xform_prim.XFormPrim(prim_path=parent_path)
parent_pos, parent_quat = parent_prim_xform.get_local_pose()
parent_quat = parent_quat[[1, 2, 3, 0]]
parent_pose = T.pose2mat((th.tensor(parent_pos), th.tensor(parent_quat)))
Expand Down Expand Up @@ -873,7 +873,7 @@ def import_custom_robot(config):
)

# Get current stage
stage = lazy.omni.isaac.core.utils.stage.get_current_stage()
stage = lazy.isaacsim.core.utils.stage.get_current_stage()

# Add visual spheres, cameras, and lidars
if cfg.eef_vis_links:
Expand Down Expand Up @@ -933,10 +933,8 @@ def import_custom_robot(config):
# - all of the root link's descendant links (all links except self)

# Compute AABB
bbox_cache = lazy.omni.isaac.core.utils.bounds.create_bbox_cache(use_extents_hint=False)
aabb = lazy.omni.isaac.core.utils.bounds.compute_aabb(
bbox_cache=bbox_cache, prim_path=prim.GetPrimPath().pathString
)
bbox_cache = lazy.isaacsim.core.utils.bounds.create_bbox_cache(use_extents_hint=False)
aabb = lazy.isaacsim.core.utils.bounds.compute_aabb(bbox_cache=bbox_cache, prim_path=prim.GetPrimPath().pathString)
z_offset = aabb[2]

# Update the root link's CoM
Expand Down
54 changes: 27 additions & 27 deletions omnigibson/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,32 @@

# List of NVIDIA PyPI packages needed for OmniGibson
ISAAC_SIM_PACKAGES = [
"omniverse_kit-106.0.1.126909",
"isaacsim_kernel-4.1.0.0",
"isaacsim_app-4.1.0.0",
"isaacsim_core-4.1.0.0",
"isaacsim_gui-4.1.0.0",
"isaacsim_utils-4.1.0.0",
"isaacsim_storage-4.1.0.0",
"isaacsim_asset-4.1.0.0",
"isaacsim_sensor-4.1.0.0",
"isaacsim_robot_motion-4.1.0.0",
"isaacsim_robot-4.1.0.0",
"isaacsim_benchmark-4.1.0.0",
"isaacsim_code_editor-4.1.0.0",
"isaacsim_ros1-4.1.0.0",
"isaacsim_cortex-4.1.0.0",
"isaacsim_example-4.1.0.0",
"isaacsim_replicator-4.1.0.0",
"isaacsim_rl-4.1.0.0",
"isaacsim_robot_setup-4.1.0.0",
"isaacsim_ros2-4.1.0.0",
"isaacsim_template-4.1.0.0",
"isaacsim_test-4.1.0.0",
"isaacsim-4.1.0.0",
"isaacsim_extscache_physics-4.1.0.0",
"isaacsim_extscache_kit-4.1.0.0",
"isaacsim_extscache_kit_sdk-4.1.0.0",
"omniverse_kit-106.5.0.162521",
"isaacsim_kernel-4.5.0.0",
"isaacsim_app-4.5.0.0",
"isaacsim_core-4.5.0.0",
"isaacsim_gui-4.5.0.0",
"isaacsim_utils-4.5.0.0",
"isaacsim_storage-4.5.0.0",
"isaacsim_asset-4.5.0.0",
"isaacsim_sensor-4.5.0.0",
"isaacsim_robot_motion-4.5.0.0",
"isaacsim_robot-4.5.0.0",
"isaacsim_benchmark-4.5.0.0",
"isaacsim_code_editor-4.5.0.0",
"isaacsim_ros1-4.5.0.0",
"isaacsim_cortex-4.5.0.0",
"isaacsim_example-4.5.0.0",
"isaacsim_replicator-4.5.0.0",
"isaacsim_rl-4.5.0.0",
"isaacsim_robot_setup-4.5.0.0",
"isaacsim_ros2-4.5.0.0",
"isaacsim_template-4.5.0.0",
"isaacsim_test-4.5.0.0",
"isaacsim-4.5.0.0",
"isaacsim_extscache_physics-4.5.0.0",
"isaacsim_extscache_kit-4.5.0.0",
"isaacsim_extscache_kit_sdk-4.5.0.0",
]
BASE_URL = "https://pypi.nvidia.com"

Expand Down Expand Up @@ -215,7 +215,7 @@ def _launcher_based_install(isaac_sim_path: Optional[Path]):
isaac_version_str = version_content.split("-")[0]
isaac_version_tuple = tuple(map(int, isaac_version_str.split(".")[:3]))

if isaac_version_tuple not in ((4, 0, 0), (4, 1, 0)):
if isaac_version_tuple not in ((4, 0, 0), (4, 1, 0), (4, 5, 0)):
click.echo(f"Isaac Sim version {isaac_version_str} is not supported by OmniGibson.")
return False

Expand Down
1 change: 1 addition & 0 deletions omnigibson/object_states/attached_to.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ def _detach(self):
if self.parent_link is not None:
# Remove the attachment joint prim from the stage
og.sim.stage.RemovePrim(self.attachment_joint_prim_path)
og.sim.update_handles()

# Remove child reference from the parent object
self.parent.states[AttachedTo].children[self.parent_link.body_name] = None
Expand Down
99 changes: 7 additions & 92 deletions omnigibson/object_states/particle_modifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from omnigibson.object_states.toggle import ToggledOn
from omnigibson.object_states.update_state_mixin import UpdateStateMixin
from omnigibson.prims.geom_prim import VisualGeomPrim
from omnigibson.prims.prim_base import BasePrim
from omnigibson.systems.system_base import PhysicalParticleSystem
from omnigibson.utils.constants import ParticleModifyCondition, ParticleModifyMethod, PrimType
from omnigibson.utils.geometry_utils import (
Expand Down Expand Up @@ -157,14 +156,14 @@ def create_projection_visualization(
if material is not None:
prototype.material = material
# Override the prototype used by the instancer
instancer_prim = lazy.omni.isaac.core.utils.prims.get_prim_at_path(instancer_path)
instancer_prim = lazy.isaacsim.core.utils.prims.get_prim_at_path(instancer_path)
instancer_prim.GetProperty("inputs:prototypes").SetTargets([prototype_path])

# Destroy the old mat path since we don't use the sprites
lazy.omni.isaac.core.utils.prims.delete_prim(mat_path)
lazy.isaacsim.core.utils.prims.delete_prim(mat_path)

# Modify the settings of the emitter to match the desired shape from inputs
emitter_prim = lazy.omni.isaac.core.utils.prims.get_prim_at_path(emitter_path)
emitter_prim = lazy.isaacsim.core.utils.prims.get_prim_at_path(emitter_path)
emitter_prim.GetProperty("inputs:active").Set(True)
emitter_prim.GetProperty("inputs:rate").Set(m.PROJECTION_VISUALIZATION_RATE)
emitter_prim.GetProperty("inputs:lifespan").Set(projection_height.item() / m.PROJECTION_VISUALIZATION_SPEED)
Expand All @@ -183,7 +182,7 @@ def create_projection_visualization(
og.sim.render()

# Return the particle system prim which "owns" everything
return lazy.omni.isaac.core.utils.prims.get_prim_at_path(system_path), emitter_prim
return lazy.isaacsim.core.utils.prims.get_prim_at_path(system_path), emitter_prim


class ParticleModifier(IntrinsicObjectState, LinkBasedStateMixin, UpdateStateMixin):
Expand Down Expand Up @@ -351,7 +350,7 @@ def overlap_callback(hit):
mesh_prim_path = f"{self.link.prim_path}/mesh_0"

# Create a primitive shape if it doesn't already exist
pre_existing_mesh = lazy.omni.isaac.core.utils.prims.get_prim_at_path(mesh_prim_path)
pre_existing_mesh = lazy.isaacsim.core.utils.prims.get_prim_at_path(mesh_prim_path)
if not pre_existing_mesh:
# Projection mesh params must be specified in order to determine scalings
assert self._projection_mesh_params is not None, (
Expand Down Expand Up @@ -1011,7 +1010,6 @@ def __init__(

self.projection_system = None
self.projection_system_prim = None
self.projection_emitter = None

# Run super
super().__init__(obj=obj, method=method, conditions=conditions, projection_mesh_params=projection_mesh_params)
Expand All @@ -1025,79 +1023,6 @@ def _initialize(self):
# This will initialize the system if it's not initialized already.
system = self.obj.scene.get_system(system_name)

if self.visualize:
assert self._projection_mesh_params["type"] in {
"Cylinder",
"Cone",
}, f"{self.__class__.__name__} visualization only supports Cylinder and Cone types!"
radius, height = (
th.mean(self._projection_mesh_params["extents"][:2]) / 2.0,
self._projection_mesh_params["extents"][2],
)
# Generate the projection visualization
particle_radius = (
m.VISUAL_PARTICLE_PROJECTION_PARTICLE_RADIUS
if self.obj.scene.is_visual_particle_system(system_name=system.name)
else system.particle_radius
)

name_prefix = f"{self.obj.name}_{self.__class__.__name__}"
# Create the projection visualization if it doesn't already exist, otherwise we reference it directly
projection_name = f"{name_prefix}_projection_visualization"
projection_path = f"/OmniGraph/{projection_name}"
projection_visualization_path = f"{self.link.prim_path}/projection_visualization"
if lazy.omni.isaac.core.utils.prims.is_prim_path_valid(projection_path):
self.projection_system = lazy.omni.isaac.core.utils.prims.get_prim_at_path(projection_path)
self.projection_emitter = lazy.omni.isaac.core.utils.prims.get_prim_at_path(
f"{projection_path}/emitter"
)
else:
self.projection_system, self.projection_emitter = create_projection_visualization(
scene=self.obj.scene,
prim_path=projection_visualization_path,
shape=self._projection_mesh_params["type"],
projection_name=projection_name,
projection_radius=radius,
projection_height=height,
particle_radius=particle_radius,
parent_scale=self.link.scale,
material=system.material,
)
relative_projection_system_path = absolute_prim_path_to_scene_relative(
self.obj.scene, self.projection_system.GetPrimPath().pathString
)
self.projection_system_prim = BasePrim(
relative_prim_path=relative_projection_system_path, name=projection_name
)
self.projection_system_prim.load(self.obj.scene)

# Create the visual geom instance referencing the generated source mesh prim, and then hide it
relative_projection_source_path = absolute_prim_path_to_scene_relative(
self.obj.scene, projection_visualization_path
)
self.projection_source_sphere = VisualGeomPrim(
relative_prim_path=relative_projection_source_path, name=f"{name_prefix}_projection_source_sphere"
)
self.projection_source_sphere.load(self.obj.scene)
self.projection_source_sphere.initialize()
self.projection_source_sphere.visible = False
# Rotate by 90 degrees in y-axis so that the projection visualization aligns with the projection mesh
self.projection_source_sphere.set_position_orientation(
orientation=T.euler2quat(th.tensor([0, math.pi / 2, 0], dtype=th.float32)), frame="parent"
)

# Make sure the meta mesh is aligned with the meta link if visualizing
# This corresponds to checking (a) position of tip of projection mesh should align with origin of
# meta link, and (b) zero relative orientation between the meta link and the projection mesh
local_pos, local_quat = self.projection_mesh.get_position_orientation(frame="parent")
assert th.all(
th.isclose(local_pos + th.tensor([0, 0, height / 2.0]), th.zeros_like(local_pos))
), "Projection mesh tip should align with meta link position!"
local_euler = T.quat2euler(local_quat)
assert th.all(
th.isclose(local_euler, th.zeros_like(local_euler))
), "Projection mesh orientation should align with meta link orientation!"

# Store which method to use for sampling particle locations
if self._sample_with_raycast:
if self.method == ParticleModifyMethod.PROJECTION:
Expand Down Expand Up @@ -1192,16 +1117,6 @@ def _compute_particle_spawn_information(self, system):
)
self._in_mesh_local_particle_directions = directions / th.norm(directions, dim=-1).reshape(-1, 1)

def _update(self):
# If we're about to check for modification, update whether it the visualization should be active or not
if self.visualize and self._current_step == 0:
# Only one system in our conditions, so next(iter()) suffices
is_active = all(condition(self.obj) for condition in next(iter(self.conditions.values())))
self.projection_emitter.GetProperty("inputs:active").Set(is_active)

# Run super
super()._update()

def remove(self):
# We need to remove the projection visualization if it exists
if self.projection_system_prim is not None:
Expand Down Expand Up @@ -1488,8 +1403,8 @@ def systems_to_check(self):

@property
def projection_is_active(self):
# Only active if the projection mesh is enabled
return self.projection_emitter.GetProperty("inputs:active").Get()
# Only one system in our conditions, so next(iter()) suffices
return all(condition(self.obj) for condition in next(iter(self.conditions.values())))

@classproperty
def meta_link_type(cls):
Expand Down
4 changes: 2 additions & 2 deletions omnigibson/object_states/toggle.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def _initialize(self):
assert self.obj.prim_type != PrimType.CLOTH, f"Cannot create ToggledOn state for cloth object {self.obj.name}!"

mesh_prim_path = f"{self.link.prim_path}/mesh_0"
pre_existing_mesh = lazy.omni.isaac.core.utils.prims.get_prim_at_path(mesh_prim_path)
pre_existing_mesh = lazy.isaacsim.core.utils.prims.get_prim_at_path(mesh_prim_path)
# Create a primitive mesh if it doesn't already exist
if not pre_existing_mesh:
self.scale = m.DEFAULT_SCALE if self.scale is None else self.scale
Expand All @@ -113,7 +113,7 @@ def _initialize(self):
)
else:
# Infer radius from mesh if not specified as an input
lazy.omni.isaac.core.utils.bounds.recompute_extents(prim=pre_existing_mesh)
lazy.isaacsim.core.utils.bounds.recompute_extents(prim=pre_existing_mesh)
self.scale = vtarray_to_torch(pre_existing_mesh.GetAttribute("xformOp:scale").Get())

# Create the visual geom instance referencing the generated mesh prim
Expand Down
4 changes: 2 additions & 2 deletions omnigibson/objects/dataset_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,10 +445,10 @@ def scales_in_link_frame(self):
if parent_name in scales and child_name not in scales:
scale_in_parent_lf = scales[parent_name]
# The location of the joint frame is scaled using the scale in the parent frame
quat0 = lazy.omni.isaac.core.utils.rotations.gf_quat_to_np_array(
quat0 = lazy.isaacsim.core.utils.rotations.gf_quat_to_np_array(
prim.GetAttribute("physics:localRot0").Get()
)[[1, 2, 3, 0]]
quat1 = lazy.omni.isaac.core.utils.rotations.gf_quat_to_np_array(
quat1 = lazy.isaacsim.core.utils.rotations.gf_quat_to_np_array(
prim.GetAttribute("physics:localRot1").Get()
)[[1, 2, 3, 0]]
# Invert the child link relationship, and multiply the two rotations together to get the final rotation
Expand Down
Loading
Loading