Skip to content

Commit 7455d3d

Browse files
lorenwelLorenz Wellhausen
andauthored
Fix PDActuator docstring to match actual implementation (#3493)
# Description The docstring of the `IdealPDActuator` didn't match its implementation. Desired and actual joint positions and velocities were swapped. Actual implementation is like this: ``` def compute( self, control_action: ArticulationActions, joint_pos: torch.Tensor, joint_vel: torch.Tensor ) -> ArticulationActions: # compute errors error_pos = control_action.joint_positions - joint_pos error_vel = control_action.joint_velocities - joint_vel # calculate the desired joint torques self.computed_effort = self.stiffness * error_pos + self.damping * error_vel + control_action.joint_efforts ``` It is "`desired - current`", the current docstring says the opposite: <img width="524" height="60" alt="image" src="https://github.com/user-attachments/assets/efdc7348-1587-4ed6-be58-875e804e8db9" /> ## Type of change - Documentation update ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there Co-authored-by: Lorenz Wellhausen <[email protected]>
1 parent e4d644f commit 7455d3d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/isaaclab/isaaclab/actuators/actuator_pd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class IdealPDActuator(ActuatorBase):
152152
153153
.. math::
154154
155-
\tau_{j, computed} = k_p * (q - q_{des}) + k_d * (\dot{q} - \dot{q}_{des}) + \tau_{ff}
155+
\tau_{j, computed} = k_p * (q_{des} - q) + k_d * (\dot{q}_{des} - \dot{q}) + \tau_{ff}
156156
157157
where, :math:`k_p` and :math:`k_d` are joint stiffness and damping gains, :math:`q` and :math:`\dot{q}`
158158
are the current joint positions and velocities, :math:`q_{des}`, :math:`\dot{q}_{des}` and :math:`\tau_{ff}`

0 commit comments

Comments
 (0)