Skip to content

Commit

Permalink
Updates asset and docker paths to Isaac Sim 4.2 (#129)
Browse files Browse the repository at this point in the history
# Description

Updates asset and docker paths to Isaac Sim 4.2

## Type of change

- New feature (non-breaking change which adds functionality)

## 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
  • Loading branch information
Dhoeller19 committed Sep 20, 2024
1 parent 581354c commit e75ff98
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/postmerge-ci-buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ phases:
commands:
- echo "Building a docker image"
- docker login -u \$oauthtoken -p $NGC_TOKEN nvcr.io
- docker build -t $IMAGE_NAME:latest-1.1 --build-arg ISAACSIM_VERSION_ARG=4.1.0 --build-arg ISAACSIM_ROOT_PATH_ARG=/isaac-sim --build-arg ISAACLAB_PATH_ARG=/workspace/isaaclab --build-arg DOCKER_USER_HOME_ARG=/root -f docker/Dockerfile.base .
- docker build -t $IMAGE_NAME:latest-1.1 --build-arg ISAACSIM_VERSION_ARG=4.2.0 --build-arg ISAACSIM_ROOT_PATH_ARG=/isaac-sim --build-arg ISAACLAB_PATH_ARG=/workspace/isaaclab --build-arg DOCKER_USER_HOME_ARG=/root -f docker/Dockerfile.base .
- echo "Pushing the docker image"
- docker push $IMAGE_NAME:latest-1.1
- docker tag $IMAGE_NAME:latest-1.1 $IMAGE_NAME:latest-1.1-b$CODEBUILD_BUILD_NUMBER
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/premerge-ci-buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ phases:
pre_build:
commands:
- echo "Launching EC2 instance to run tests"
- INSTANCE_ID=$(aws ec2 run-instances --image-id ami-05c519412a83cc291 --count 1 --instance-type g5.2xlarge --key-name production/ssh/isaaclab --security-group-ids sg-02617e4b8916794c4 --subnet-id subnet-0907ceaeb40fd9eac --block-device-mappings 'DeviceName=/dev/sda1,Ebs={VolumeSize=500}' --output text --query 'Instances[0].InstanceId')
- INSTANCE_ID=$(aws ec2 run-instances --image-id ami-064d9f428f75cebb1 --count 1 --instance-type g5.2xlarge --key-name production/ssh/isaaclab --security-group-ids sg-02617e4b8916794c4 --subnet-id subnet-0907ceaeb40fd9eac --block-device-mappings 'DeviceName=/dev/sda1,Ebs={VolumeSize=500}' --output text --query 'Instances[0].InstanceId')
- aws ec2 wait instance-running --instance-ids $INSTANCE_ID
- EC2_INSTANCE_IP=$(aws ec2 describe-instances --filters "Name=instance-state-name,Values=running" "Name=instance-id,Values=$INSTANCE_ID" --query 'Reservations[*].Instances[*].[PrivateIpAddress]' --output text)
- mkdir -p ~/.ssh
Expand Down Expand Up @@ -41,7 +41,7 @@ phases:
'
- ssh ubuntu@$EC2_INSTANCE_IP "docker login -u \\\$oauthtoken -p $NGC_TOKEN nvcr.io"
- ssh ubuntu@$EC2_INSTANCE_IP "cd $SRC_DIR;
docker build -t isaac-lab-dev --build-arg ISAACSIM_VERSION_ARG=4.1.0 --build-arg ISAACSIM_ROOT_PATH_ARG=/isaac-sim --build-arg ISAACLAB_PATH_ARG=/workspace/isaaclab --build-arg DOCKER_USER_HOME_ARG=/root -f docker/Dockerfile.base . ;
docker build -t isaac-lab-dev --build-arg ISAACSIM_VERSION_ARG=4.2.0 --build-arg ISAACSIM_ROOT_PATH_ARG=/isaac-sim --build-arg ISAACLAB_PATH_ARG=/workspace/isaaclab --build-arg DOCKER_USER_HOME_ARG=/root -f docker/Dockerfile.base . ;
docker run --rm --entrypoint bash --gpus all --network=host --name isaac-lab-test isaac-lab-dev ./isaaclab.sh -t &&
exit $?"
post_build:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/features/hydra.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Setting parameters to None

To set parameters to None, use the ``null`` keyword, which is a special keyword in Hydra that is automatically converted to None.
In the above example, we could also disable the ``joint_pos_rel`` observation by setting it to None with
``env.observations.policy.joint_pos_rel.func=null``.
``env.observations.policy.joint_pos_rel=null``.

Dictionaries
^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ def _load_extensions(self):

# set the nucleus directory manually to the latest published Nucleus
# note: this is done to ensure prior versions of Isaac Sim still use the latest assets
assets_path = "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/4.1"
assets_path = "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/4.2"
carb_settings_iface.set_string("/persistent/isaac/asset_root/default", assets_path)
carb_settings_iface.set_string("/persistent/isaac/asset_root/cloud", assets_path)
carb_settings_iface.set_string("/persistent/isaac/asset_root/nvidia", assets_path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class TiledCamera(Camera):
- ``"rgba"``: A 4-channel rendered color image with alpha channel.
- ``"distance_to_camera"``: An image containing the distance to camera optical center.
- ``"distance_to_image_plane"``: An image containing distances of 3D points from camera plane along camera's z-axis.
- ``"depth"``: The same as ``"distance_to_image_plane"``.
- ``"depth"``: Alias for ``"distance_to_image_plane"``.
- ``"normals"``: An image containing the local surface normal vectors at each pixel.
- ``"motion_vectors"``: An image containing the motion vector data at each pixel.
- ``"semantic_segmentation"``: The semantic segmentation data.
Expand Down Expand Up @@ -207,7 +207,7 @@ def _initialize_impl(self):
annotator = rep.AnnotatorRegistry.get_annotator(
"distance_to_image_plane", device=self.device, do_array_copy=False
)
self._annotators["distance_to_image_plane"] = annotator
self._annotators[annotator_type] = annotator
# note: we are verbose here to make it easier to understand the code.
# if colorize is true, the data is mapped to colors and a uint8 4 channel image is returned.
# if colorize is false, the data is returned as a uint32 image with ids as values.
Expand Down Expand Up @@ -279,9 +279,6 @@ def _update_buffers_impl(self, env_ids: Sequence[int]):
# alias rgb as first 3 channels of rgba
if data_type == "rgba" and "rgb" in self.cfg.data_types:
self._data.output["rgb"] = self._data.output["rgba"][..., :3]
# alias depth as distance_to_image_plane
elif data_type == "distance_to_image_plane" and "depth" in self.cfg.data_types:
self._data.output["depth"] = self._data.output["distance_to_image_plane"]

"""
Private Helpers
Expand Down Expand Up @@ -327,13 +324,14 @@ def _create_buffers(self):
if "rgb" in self.cfg.data_types:
# RGB is the first 3 channels of RGBA
data_dict["rgb"] = data_dict["rgba"][..., :3]
if "depth" in self.cfg.data_types or "distance_to_image_plane" in self.cfg.data_types:
if "distance_to_image_plane" in self.cfg.data_types:
data_dict["distance_to_image_plane"] = torch.zeros(
(self._view.count, self.cfg.height, self.cfg.width, 1), device=self.device, dtype=torch.float32
).contiguous()
if "depth" in self.cfg.data_types:
# assume distance_to_image_plane if depth is included in data types
data_dict["depth"] = data_dict["distance_to_image_plane"]
data_dict["depth"] = torch.zeros(
(self._view.count, self.cfg.height, self.cfg.width, 1), device=self.device, dtype=torch.float32
).contiguous()
if "distance_to_camera" in self.cfg.data_types:
data_dict["distance_to_camera"] = torch.zeros(
(self._view.count, self.cfg.height, self.cfg.width, 1), device=self.device, dtype=torch.float32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def test_data_types(self):
self.assertTrue(camera_both.is_initialized)
self.assertListEqual(list(camera_distance.data.output.keys()), ["distance_to_camera"])
self.assertListEqual(list(camera_depth.data.output.keys()), ["depth"])
self.assertListEqual(list(camera_both.data.output.keys()), ["distance_to_camera"])
self.assertListEqual(list(camera_both.data.output.keys()), ["depth", "distance_to_camera"])

del camera_distance, camera_depth, camera_both

Expand All @@ -272,7 +272,7 @@ def test_depth_only_camera(self):
# Check if camera prim is set correctly and that it is a camera prim
self.assertEqual(camera._sensor_prims[1].GetPath().pathString, "/World/Origin_1/CameraSensor")
self.assertIsInstance(camera._sensor_prims[0], UsdGeom.Camera)
self.assertListEqual(sorted(camera.data.output.keys()), sorted(["depth", "distance_to_image_plane"]))
self.assertListEqual(sorted(camera.data.output.keys()), ["distance_to_camera"])

# Simulate for a few steps
# note: This is a workaround to ensure that the textures are loaded.
Expand All @@ -295,12 +295,12 @@ def test_depth_only_camera(self):
# update camera
camera.update(self.dt)
# check image data
im_data = camera.data.output["depth"]
im_data = camera.data.output["distance_to_camera"]
self.assertEqual(im_data.shape, (num_cameras, self.camera_cfg.height, self.camera_cfg.width, 1))
for i in range(4):
self.assertGreater((im_data[i]).mean().item(), 0.0)
# Check data type of image
self.assertEqual(camera.data.output["depth"].dtype, torch.float)
self.assertEqual(camera.data.output["distance_to_camera"].dtype, torch.float)
del camera

def test_rgba_only_camera(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __post_init__(self):
prim_path="{ENV_REGEX_NS}/Object",
init_state=DeformableObjectCfg.InitialStateCfg(pos=[0.5, 0, 0.05], rot=[0.707, 0, 0, 0.707]),
spawn=UsdFileCfg(
usd_path=f"{ISAACLAB_NUCLEUS_DIR}/Objects/teddy_bear.usd",
usd_path=f"{ISAACLAB_NUCLEUS_DIR}/Objects/Teddy_Bear/teddy_bear.usd",
scale=(0.01, 0.01, 0.01),
),
)
Expand Down

0 comments on commit e75ff98

Please sign in to comment.