Skip to content

Commit

Permalink
Fixes errors in tools and tutorial scripts (isaac-sim#1669)
Browse files Browse the repository at this point in the history
# Description

A few scripts in the tools and tutorials folder had outdated APIs that
caused errors when run.
This scripts fixes issues with 2 scripts:

- check_instanceable.py used an old `enable_flatcache` API that no
longer exists. this has been replaced with the new `enable_fabric` API
- run_usd_camera.py was indexing camera data outputs with incorrect
keys/indices, which is now fixed

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

- 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
- [ ] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

<!--
As you go through the checklist above, you can mark something as done by
putting an x character in it

For example,
- [x] I have done this task
- [ ] I have not done this task
-->
  • Loading branch information
kellyguo11 authored Jan 14, 2025
1 parent a73b63c commit e956ddb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions source/standalone/tools/check_instanceable.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ def main():
sim = SimulationContext(
stage_units_in_meters=1.0, physics_dt=0.01, rendering_dt=0.01, backend="torch", device="cuda:0"
)
# enable flatcache which avoids passing data over to USD structure
# enable fabric which avoids passing data over to USD structure
# this speeds up the read-write operation of GPU buffers
if sim.get_physics_context().use_gpu_pipeline:
sim.get_physics_context().enable_flatcache(True)
sim.get_physics_context().enable_fabric(True)
# enable hydra scene-graph instancing
# this is needed to visualize the scene when flatcache is enabled
# this is needed to visualize the scene when fabric is enabled
set_carb_setting(sim._settings, "/persistent/omnihydra/useSceneGraphInstancing", True)

# Create interface to clone the scene
Expand Down
2 changes: 1 addition & 1 deletion source/standalone/tutorials/04_sensors/run_usd_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def run_simulator(sim: sim_utils.SimulationContext, scene_entities: dict):
# Derive pointcloud from camera at camera_index
pointcloud = create_pointcloud_from_depth(
intrinsic_matrix=camera.data.intrinsic_matrices[camera_index],
depth=camera.data.output[camera_index]["distance_to_image_plane"],
depth=camera.data.output["distance_to_image_plane"][camera_index],
position=camera.data.pos_w[camera_index],
orientation=camera.data.quat_w_ros[camera_index],
device=sim.device,
Expand Down

0 comments on commit e956ddb

Please sign in to comment.