Skip to content

Commit

Permalink
PostureTask: Match implementation and documentation formula
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-caron committed Jul 26, 2024
1 parent 462839b commit 5c4a43d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ All notable changes to this project will be documented in this file.

### Fixed

- PostureTask: Match implementation and documentation formula
- Fix broken documentation links

### Removed
Expand Down
5 changes: 3 additions & 2 deletions pink/tasks/damping_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ class DampingTask(PostureTask):
The word "damping" is used here by analogy with forces that fight against
motion, and bring the robot to a rest if nothing else drives it.
The damping task is implemented as a special case of the posture task where
the gain $\alpha$ is zero.
Note:
The damping task is implemented as a special case of the posture task
where the gain $\alpha$ is zero.
"""

def __init__(self, cost: float, lm_damping: float = 0.0) -> None:
Expand Down
4 changes: 2 additions & 2 deletions pink/tasks/posture_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ def compute_error(self, configuration: Configuration) -> np.ndarray:
_, nv = get_root_joint_dim(configuration.model)
return pin.difference(
configuration.model,
configuration.q,
self.target_q,
configuration.q,
)[nv:]

def compute_jacobian(self, configuration: Configuration) -> np.ndarray:
Expand All @@ -122,7 +122,7 @@ def compute_jacobian(self, configuration: Configuration) -> np.ndarray:
Posture task Jacobian :math:`J(q)`.
"""
_, nv = get_root_joint_dim(configuration.model)
return -configuration.tangent.eye[nv:, :]
return configuration.tangent.eye[nv:, :]

def __repr__(self):
"""Human-readable representation of the task."""
Expand Down

0 comments on commit 5c4a43d

Please sign in to comment.