Unverified Commit 7455d3df authored by Lorenz Wellhausen's avatar Lorenz Wellhausen Committed by GitHub

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: 's avatarLorenz Wellhausen <lorenz.wellhausen@rivr.ai>
parent e4d644f2
......@@ -152,7 +152,7 @@ class IdealPDActuator(ActuatorBase):
.. math::
\tau_{j, computed} = k_p * (q - q_{des}) + k_d * (\dot{q} - \dot{q}_{des}) + \tau_{ff}
\tau_{j, computed} = k_p * (q_{des} - q) + k_d * (\dot{q}_{des} - \dot{q}) + \tau_{ff}
where, :math:`k_p` and :math:`k_d` are joint stiffness and damping gains, :math:`q` and :math:`\dot{q}`
are the current joint positions and velocities, :math:`q_{des}`, :math:`\dot{q}_{des}` and :math:`\tau_{ff}`
......
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