Skip to content

Commit

Permalink
add torque readings for implicit actuator
Browse files Browse the repository at this point in the history
  • Loading branch information
chao-hexagon committed Dec 14, 2023
1 parent ffd9a16 commit ccd5c5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Guidelines for modifications:
* René Zurbrügg
* Ritvik Singh
* Rosario Scalise
* Chao Ni

## Acknowledgements

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ccd5c5f

Please sign in to comment.