Unverified Commit 5f71ff47 authored by Ashwin Varghese Kuruttukulam's avatar Ashwin Varghese Kuruttukulam Committed by GitHub

Sets joint_friction_coeff only for selected physx_env_ids (#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: 's avatarooctipus <zhengyuz@nvidia.com>
Co-authored-by: 's avatarKelly Guo <kellyg@nvidia.com>
parent 538b649b
...@@ -865,7 +865,7 @@ class Articulation(AssetBase): ...@@ -865,7 +865,7 @@ class Articulation(AssetBase):
) )
else: else:
friction_props = self.root_physx_view.get_dof_friction_properties() friction_props = self.root_physx_view.get_dof_friction_properties()
friction_props[physx_env_ids.cpu(), :, 0] = self._data.joint_friction_coeff.cpu() friction_props[physx_env_ids.cpu(), :, 0] = self._data.joint_friction_coeff[physx_env_ids, :].cpu()
def write_joint_dynamic_friction_coefficient_to_sim( def write_joint_dynamic_friction_coefficient_to_sim(
self, self,
...@@ -890,7 +890,7 @@ class Articulation(AssetBase): ...@@ -890,7 +890,7 @@ class Articulation(AssetBase):
self._data.joint_dynamic_friction_coeff[env_ids, joint_ids] = joint_dynamic_friction_coeff self._data.joint_dynamic_friction_coeff[env_ids, joint_ids] = joint_dynamic_friction_coeff
# set into simulation # set into simulation
friction_props = self.root_physx_view.get_dof_friction_properties() friction_props = self.root_physx_view.get_dof_friction_properties()
friction_props[physx_env_ids.cpu(), :, 1] = self._data.joint_dynamic_friction_coeff.cpu() friction_props[physx_env_ids.cpu(), :, 1] = self._data.joint_dynamic_friction_coeff[physx_env_ids, :].cpu()
def write_joint_viscous_friction_coefficient_to_sim( def write_joint_viscous_friction_coefficient_to_sim(
self, self,
...@@ -915,7 +915,7 @@ class Articulation(AssetBase): ...@@ -915,7 +915,7 @@ class Articulation(AssetBase):
self._data.joint_viscous_friction_coeff[env_ids, joint_ids] = joint_viscous_friction_coeff self._data.joint_viscous_friction_coeff[env_ids, joint_ids] = joint_viscous_friction_coeff
# set into simulation # set into simulation
friction_props = self.root_physx_view.get_dof_friction_properties() friction_props = self.root_physx_view.get_dof_friction_properties()
friction_props[physx_env_ids.cpu(), :, 2] = self._data.joint_viscous_friction_coeff.cpu() friction_props[physx_env_ids.cpu(), :, 2] = self._data.joint_viscous_friction_coeff[physx_env_ids, :].cpu()
""" """
Operations - Setters. Operations - Setters.
......
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