Skip to content

feat(task): Add ManipulabilityTask for maximizing robot manipulability#185

Merged
stephane-caron merged 27 commits intostephane-caron:mainfrom
danielsanjosepro:feat-manipulability
Apr 20, 2026
Merged

feat(task): Add ManipulabilityTask for maximizing robot manipulability#185
stephane-caron merged 27 commits intostephane-caron:mainfrom
danielsanjosepro:feat-manipulability

Conversation

@danielsanjosepro
Copy link
Copy Markdown
Contributor

@danielsanjosepro danielsanjosepro commented Feb 24, 2026

Summary

This PR adds a new ManipulabilityTask that maximizes the manipulability of a robot manipulator. Higher manipulability means the robot can "move more easily" in all directions, avoiding singular configurations.
This add a controller similar to the MMC of Jesse Haviland and Peter Corke [1]: https://jhavl.github.io/mmc/
The task minimizes:

$$| \dot{m} - \dot{m}_\text{desired} | ^2 = | J_m \dot{q} - \dot{m}_\text{desired} | ^2$$

...where $J_m$ is the manipulability jacobian and $\dot{m}_\text{desired}$ is the desired change of manipulability rate (larger values make the controller more agressive).

This definition diverges from Haviland's [1] but follows a more pink-like standard.

What is included:

New task:

  • ManipulabilityTask: A new task that computes and maximizes the manipulability measure.
  • Support for configurable Jacobian masks ("position", "orientation", or custom.)

New examples:

  1. Planar 2-DOF (planar_2dof_manipulability.py): A simple planar robot arm with interactive Viser sliders to tune manipulability rate and damping in real-time.
2026-02-24.15-37-13.mp4
  1. Panda comparison (arm_panda_manipulability_comparison.py): Side-by-side comparison of two Panda arms tracking the same target - one with ManipulabilityTask (full opacity) and one without (gray, 50% opacity).
2026-02-24.15-42-35.mp4

Limitations:

  • Not suited for 1kHz control: the hessian is computed in python since the pinocchio bindings for it are currently not available. The solver with the task takes around 1-2 ms, with medium variance. The timing is plotted in the example. Probably the implementation of PlaCo [2] is faster.
  • Local IK limitation: The task is still "local" only. Therefore, depending on the previous configurations, it might not lead to a configuration with good manipulability (in the long term). It is interesting to play around with the Panda example and see that you can end up in worse configurations depending on how you move the robot. Probably using a planner (RRT) with manipulability cost will lead to better results...

References / Related Work

[1] Behavior similar to the MMC controller (Manipulability Motion Control) by Haviland and Corke
[2] Similar to PlaCo's manipulability regularization

@stephane-caron
Copy link
Copy Markdown
Owner

stephane-caron commented Mar 11, 2026

Thank you @danielsanjosepro for this PR. The manipulability task looks like a great addition, and examples and video are particularly helpful 👍

This message to let you know that reviewing this PR is on my radar. I'll wrap up a release for v4.1.0 with your previous additions, then we can include the new task in a release of its own, like v4.2.0.

Copy link
Copy Markdown
Owner

@stephane-caron stephane-caron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is in an excellent state 🤩 I only have one suggestion regarding documenting and checking the revolute-joint assumption in the task constructor. Other review comments are minor nits.

Comment thread pink/tasks/manipulability_task.py Outdated
Comment thread pink/tasks/manipulability_task.py Outdated
Comment thread pink/tasks/manipulability_task.py Outdated
Comment thread pink/tasks/manipulability_task.py Outdated
Comment thread pink/tasks/manipulability_task.py Outdated
Comment thread examples/planar_2dof_manipulability.py Outdated
Comment thread pink/tasks/manipulability_task.py Outdated
@danielsanjosepro
Copy link
Copy Markdown
Contributor Author

I added the revolute joint test (and a test for it) and went through the other comments thanks for the extensive review :)

Copy link
Copy Markdown
Owner

@stephane-caron stephane-caron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you for this high-quality contribution to the library 👍

@stephane-caron stephane-caron merged commit b8eccdf into stephane-caron:main Apr 20, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants