Skip to content

Commit 618de51

Browse files
ashwinvkNVooctipuskellyguo11
authored
Sets joint_friction_coeff only for selected physx_env_ids (isaac-sim#3119)
# Bugfix Previously, self._data.joint_dynamic_friction_coeff was being set for all environments, regardless of the intended targets. This behavior is incorrect — the friction coefficient should only be set for the specified physx_env_ids. Co-authored-by: ooctipus <zhengyuz@nvidia.com> Co-authored-by: Kelly Guo <kellyg@nvidia.com>
1 parent cfb8168 commit 618de51

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/isaaclab/isaaclab/assets/articulation/articulation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ def write_joint_friction_coefficient_to_sim(
865865
)
866866
else:
867867
friction_props = self.root_physx_view.get_dof_friction_properties()
868-
friction_props[physx_env_ids.cpu(), :, 0] = self._data.joint_friction_coeff.cpu()
868+
friction_props[physx_env_ids.cpu(), :, 0] = self._data.joint_friction_coeff[physx_env_ids, :].cpu()
869869

870870
def write_joint_dynamic_friction_coefficient_to_sim(
871871
self,
@@ -890,7 +890,7 @@ def write_joint_dynamic_friction_coefficient_to_sim(
890890
self._data.joint_dynamic_friction_coeff[env_ids, joint_ids] = joint_dynamic_friction_coeff
891891
# set into simulation
892892
friction_props = self.root_physx_view.get_dof_friction_properties()
893-
friction_props[physx_env_ids.cpu(), :, 1] = self._data.joint_dynamic_friction_coeff.cpu()
893+
friction_props[physx_env_ids.cpu(), :, 1] = self._data.joint_dynamic_friction_coeff[physx_env_ids, :].cpu()
894894

895895
def write_joint_viscous_friction_coefficient_to_sim(
896896
self,
@@ -915,7 +915,7 @@ def write_joint_viscous_friction_coefficient_to_sim(
915915
self._data.joint_viscous_friction_coeff[env_ids, joint_ids] = joint_viscous_friction_coeff
916916
# set into simulation
917917
friction_props = self.root_physx_view.get_dof_friction_properties()
918-
friction_props[physx_env_ids.cpu(), :, 2] = self._data.joint_viscous_friction_coeff.cpu()
918+
friction_props[physx_env_ids.cpu(), :, 2] = self._data.joint_viscous_friction_coeff[physx_env_ids, :].cpu()
919919

920920
"""
921921
Operations - Setters.

0 commit comments

Comments
 (0)