From ccd5c5f9e03e278f3d313703a54690b05cdb0f92 Mon Sep 17 00:00:00 2001 From: Chao Ni Date: Thu, 14 Dec 2023 14:18:28 +0100 Subject: [PATCH] add torque readings for implicit actuator --- CONTRIBUTORS.md | 1 + .../isaac/orbit/assets/articulation/articulation.py | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 1fb51d7165..53fca8f601 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -41,6 +41,7 @@ Guidelines for modifications: * René Zurbrügg * Ritvik Singh * Rosario Scalise +* Chao Ni ## Acknowledgements diff --git a/source/extensions/omni.isaac.orbit/omni/isaac/orbit/assets/articulation/articulation.py b/source/extensions/omni.isaac.orbit/omni/isaac/orbit/assets/articulation/articulation.py index ae9750305b..3ca1821530 100644 --- a/source/extensions/omni.isaac.orbit/omni/isaac/orbit/assets/articulation/articulation.py +++ b/source/extensions/omni.isaac.orbit/omni/isaac/orbit/assets/articulation/articulation.py @@ -679,10 +679,13 @@ def _apply_actuator_model(self): self._joint_effort_target_sim[:, actuator.joint_indices] = control_action.joint_efforts # update state of the actuator model if isinstance(actuator, ImplicitActuator): - # TODO read torque from simulation (#127) - pass - # self._data.computed_torques[:, actuator.joint_indices] = ??? - # self._data.applied_torques[:, actuator.joint_indices] = ??? + # read torque from simulation + self._data.computed_torque[:, actuator.joint_indices] = self._root_view.get_measured_joint_efforts( + joint_indices=actuator.joint_indices + ) + self._data.applied_torque[:, actuator.joint_indices] = self._root_view.get_applied_joint_efforts( + joint_indices=actuator.joint_indices + ) else: # -- torques self._data.computed_torque[:, actuator.joint_indices] = actuator.computed_effort