Commit e75ff988 authored by David Hoeller's avatar David Hoeller

Updates asset and docker paths to Isaac Sim 4.2 (#129)

# 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
parent 581354c6
...@@ -5,7 +5,7 @@ phases: ...@@ -5,7 +5,7 @@ phases:
commands: commands:
- echo "Building a docker image" - echo "Building a docker image"
- docker login -u \$oauthtoken -p $NGC_TOKEN nvcr.io - 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" - echo "Pushing the docker image"
- docker push $IMAGE_NAME:latest-1.1 - docker push $IMAGE_NAME:latest-1.1
- docker tag $IMAGE_NAME:latest-1.1 $IMAGE_NAME:latest-1.1-b$CODEBUILD_BUILD_NUMBER - docker tag $IMAGE_NAME:latest-1.1 $IMAGE_NAME:latest-1.1-b$CODEBUILD_BUILD_NUMBER
......
...@@ -4,7 +4,7 @@ phases: ...@@ -4,7 +4,7 @@ phases:
pre_build: pre_build:
commands: commands:
- echo "Launching EC2 instance to run tests" - 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 - 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) - 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 - mkdir -p ~/.ssh
...@@ -41,7 +41,7 @@ phases: ...@@ -41,7 +41,7 @@ phases:
' '
- ssh ubuntu@$EC2_INSTANCE_IP "docker login -u \\\$oauthtoken -p $NGC_TOKEN nvcr.io" - ssh ubuntu@$EC2_INSTANCE_IP "docker login -u \\\$oauthtoken -p $NGC_TOKEN nvcr.io"
- ssh ubuntu@$EC2_INSTANCE_IP "cd $SRC_DIR; - 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 && docker run --rm --entrypoint bash --gpus all --network=host --name isaac-lab-test isaac-lab-dev ./isaaclab.sh -t &&
exit $?" exit $?"
post_build: post_build:
......
...@@ -111,7 +111,7 @@ Setting parameters to None ...@@ -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. 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 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 Dictionaries
^^^^^^^^^^^^ ^^^^^^^^^^^^
......
...@@ -643,7 +643,7 @@ class AppLauncher: ...@@ -643,7 +643,7 @@ class AppLauncher:
# set the nucleus directory manually to the latest published Nucleus # 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 # 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/default", assets_path)
carb_settings_iface.set_string("/persistent/isaac/asset_root/cloud", 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) carb_settings_iface.set_string("/persistent/isaac/asset_root/nvidia", assets_path)
......
...@@ -42,7 +42,7 @@ class TiledCamera(Camera): ...@@ -42,7 +42,7 @@ class TiledCamera(Camera):
- ``"rgba"``: A 4-channel rendered color image with alpha channel. - ``"rgba"``: A 4-channel rendered color image with alpha channel.
- ``"distance_to_camera"``: An image containing the distance to camera optical center. - ``"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. - ``"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. - ``"normals"``: An image containing the local surface normal vectors at each pixel.
- ``"motion_vectors"``: An image containing the motion vector data at each pixel. - ``"motion_vectors"``: An image containing the motion vector data at each pixel.
- ``"semantic_segmentation"``: The semantic segmentation data. - ``"semantic_segmentation"``: The semantic segmentation data.
...@@ -207,7 +207,7 @@ class TiledCamera(Camera): ...@@ -207,7 +207,7 @@ class TiledCamera(Camera):
annotator = rep.AnnotatorRegistry.get_annotator( annotator = rep.AnnotatorRegistry.get_annotator(
"distance_to_image_plane", device=self.device, do_array_copy=False "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. # 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 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. # if colorize is false, the data is returned as a uint32 image with ids as values.
...@@ -279,9 +279,6 @@ class TiledCamera(Camera): ...@@ -279,9 +279,6 @@ class TiledCamera(Camera):
# alias rgb as first 3 channels of rgba # alias rgb as first 3 channels of rgba
if data_type == "rgba" and "rgb" in self.cfg.data_types: if data_type == "rgba" and "rgb" in self.cfg.data_types:
self._data.output["rgb"] = self._data.output["rgba"][..., :3] 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 Private Helpers
...@@ -327,13 +324,14 @@ class TiledCamera(Camera): ...@@ -327,13 +324,14 @@ class TiledCamera(Camera):
if "rgb" in self.cfg.data_types: if "rgb" in self.cfg.data_types:
# RGB is the first 3 channels of RGBA # RGB is the first 3 channels of RGBA
data_dict["rgb"] = data_dict["rgba"][..., :3] 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( data_dict["distance_to_image_plane"] = torch.zeros(
(self._view.count, self.cfg.height, self.cfg.width, 1), device=self.device, dtype=torch.float32 (self._view.count, self.cfg.height, self.cfg.width, 1), device=self.device, dtype=torch.float32
).contiguous() ).contiguous()
if "depth" in self.cfg.data_types: if "depth" in self.cfg.data_types:
# assume distance_to_image_plane if depth is included in data types data_dict["depth"] = torch.zeros(
data_dict["depth"] = data_dict["distance_to_image_plane"] (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: if "distance_to_camera" in self.cfg.data_types:
data_dict["distance_to_camera"] = torch.zeros( data_dict["distance_to_camera"] = torch.zeros(
(self._view.count, self.cfg.height, self.cfg.width, 1), device=self.device, dtype=torch.float32 (self._view.count, self.cfg.height, self.cfg.width, 1), device=self.device, dtype=torch.float32
......
...@@ -247,7 +247,7 @@ class TestTiledCamera(unittest.TestCase): ...@@ -247,7 +247,7 @@ class TestTiledCamera(unittest.TestCase):
self.assertTrue(camera_both.is_initialized) self.assertTrue(camera_both.is_initialized)
self.assertListEqual(list(camera_distance.data.output.keys()), ["distance_to_camera"]) self.assertListEqual(list(camera_distance.data.output.keys()), ["distance_to_camera"])
self.assertListEqual(list(camera_depth.data.output.keys()), ["depth"]) 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 del camera_distance, camera_depth, camera_both
...@@ -272,7 +272,7 @@ class TestTiledCamera(unittest.TestCase): ...@@ -272,7 +272,7 @@ class TestTiledCamera(unittest.TestCase):
# Check if camera prim is set correctly and that it is a camera prim # 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.assertEqual(camera._sensor_prims[1].GetPath().pathString, "/World/Origin_1/CameraSensor")
self.assertIsInstance(camera._sensor_prims[0], UsdGeom.Camera) 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 # Simulate for a few steps
# note: This is a workaround to ensure that the textures are loaded. # note: This is a workaround to ensure that the textures are loaded.
...@@ -295,12 +295,12 @@ class TestTiledCamera(unittest.TestCase): ...@@ -295,12 +295,12 @@ class TestTiledCamera(unittest.TestCase):
# update camera # update camera
camera.update(self.dt) camera.update(self.dt)
# check image data # 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)) self.assertEqual(im_data.shape, (num_cameras, self.camera_cfg.height, self.camera_cfg.width, 1))
for i in range(4): for i in range(4):
self.assertGreater((im_data[i]).mean().item(), 0.0) self.assertGreater((im_data[i]).mean().item(), 0.0)
# Check data type of image # 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 del camera
def test_rgba_only_camera(self): def test_rgba_only_camera(self):
......
...@@ -60,7 +60,7 @@ class FrankaTeddyBearLiftEnvCfg(FrankaCubeLiftEnvCfg): ...@@ -60,7 +60,7 @@ class FrankaTeddyBearLiftEnvCfg(FrankaCubeLiftEnvCfg):
prim_path="{ENV_REGEX_NS}/Object", prim_path="{ENV_REGEX_NS}/Object",
init_state=DeformableObjectCfg.InitialStateCfg(pos=[0.5, 0, 0.05], rot=[0.707, 0, 0, 0.707]), init_state=DeformableObjectCfg.InitialStateCfg(pos=[0.5, 0, 0.05], rot=[0.707, 0, 0, 0.707]),
spawn=UsdFileCfg( 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), scale=(0.01, 0.01, 0.01),
), ),
) )
......
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