Skip to content

Commit 01d83a3

Browse files
committed
address comment
1 parent 314991b commit 01d83a3

File tree

4 files changed

+41
-10
lines changed

4 files changed

+41
-10
lines changed

source/isaaclab_newton/docs/CHANGELOG.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@ Added
1010
* Added ``set_friction_index/mask`` and ``set_restitution_index/mask`` methods to
1111
Newton assets for native material property randomization.
1212

13-
Changed
14-
^^^^^^^
15-
16-
* Removed ``shape_material_mu`` and ``shape_material_restitution`` data properties.
17-
* Removed hardcoded ``default_body_armature`` from Newton cloner. Use
18-
:class:`~isaaclab.envs.mdp.randomize_rigid_body_inertia` event term instead.
19-
2013

2114
0.5.9 (2026-03-16)
2215
~~~~~~~~~~~~~~~~~~

source/isaaclab_newton/isaaclab_newton/assets/articulation/articulation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3903,10 +3903,10 @@ def _resolve_shape_ids(self, shape_ids: Sequence[int] | torch.Tensor | wp.array
39033903
Returns:
39043904
A warp array of shape indices or a tensor of shape indices.
39053905
"""
3906-
if isinstance(shape_ids, list):
3907-
return wp.array(shape_ids, dtype=wp.int32, device=self.device)
39083906
if (shape_ids is None) or (shape_ids == slice(None)):
39093907
return self._ALL_SHAPE_INDICES
3908+
elif isinstance(shape_ids, list):
3909+
return wp.array(shape_ids, dtype=wp.int32, device=self.device)
39103910
return shape_ids
39113911

39123912
def _resolve_fixed_tendon_ids(

source/isaaclab_physx/test/assets/test_rigid_object.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,44 @@ def test_rigid_body_set_material_properties(num_cubes, device):
604604
torch.testing.assert_close(materials_to_check.reshape(num_cubes, 3), materials)
605605

606606

607+
@pytest.mark.parametrize("num_cubes", [1, 2])
608+
@pytest.mark.parametrize("device", ["cuda:0", "cpu"])
609+
@pytest.mark.isaacsim_ci
610+
def test_set_material_properties_index(num_cubes, device):
611+
"""Test setting material properties using the set_material_properties_index API."""
612+
with build_simulation_context(
613+
device=device, gravity_enabled=True, add_ground_plane=True, auto_add_lighting=True
614+
) as sim:
615+
sim._app_control_on_stop_handle = None
616+
# Generate cubes scene
617+
cube_object, _ = generate_cubes_scene(num_cubes=num_cubes, device=device)
618+
619+
# Play sim
620+
sim.reset()
621+
622+
# Get number of shapes
623+
max_shapes = cube_object.root_view.max_shapes
624+
625+
# Generate random material properties: (static_friction, dynamic_friction, restitution)
626+
materials = torch.empty(num_cubes, max_shapes, 3, device="cpu").uniform_(0.0, 1.0)
627+
# Ensure dynamic friction <= static friction
628+
materials[..., 1] = torch.min(materials[..., 0], materials[..., 1])
629+
630+
# Use the new set_material_properties_index API
631+
env_ids = torch.arange(num_cubes, dtype=torch.int32)
632+
cube_object.set_material_properties_index(materials=materials, env_ids=env_ids)
633+
634+
# Simulate physics
635+
sim.step()
636+
cube_object.update(sim.cfg.dt)
637+
638+
# Get material properties from simulation
639+
materials_check = wp.to_torch(cube_object.root_view.get_material_properties())
640+
641+
# Check if material properties are set correctly
642+
torch.testing.assert_close(materials_check, materials)
643+
644+
607645
@pytest.mark.parametrize("num_cubes", [1, 2])
608646
@pytest.mark.parametrize("device", ["cuda:0", "cpu"])
609647
@pytest.mark.isaacsim_ci

source/isaaclab_tasks/config/extension.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
# Note: Semantic Versioning is used: https://semver.org/
4-
version = "1.5.14"
4+
version = "1.5.13"
55

66
# Description
77
title = "Isaac Lab Environments"

0 commit comments

Comments
 (0)