Skip to content

fix(pyplot): draw world-space velocity and force ellipsoids - #983

Closed
Afloat16 wants to merge 3 commits into
petercorke:mainfrom
Afloat16:fix/world-manipulability-ellipsoids
Closed

Afloat16 wants to merge 3 commits into
petercorke:mainfrom
Afloat16:fix/world-manipulability-ellipsoids

Conversation

@Afloat16

@Afloat16 Afloat16 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The 3D plotting backend uses the end-effector Jacobian while drawing the ellipsoids in world axes. It also takes reciprocal velocity radii and direct force radii, exchanging the two capabilities.

For a Puma 560 at qn, rendered velocity points have squared unit-rate residuals from 6.64 to 37.84 instead of 1. Force points have squared joint-effort norms from 0.0264 to 0.151 instead of 1. A rank-deficient but bounded velocity ellipsoid is also skipped.

Change

Construct the world Jacobian by rotating the terminal-frame Jacobian with the forward-kinematics rotation, then use its thin SVD. This handles both DHRobot and Robot/URDF base conventions. Its singular values are velocity radii; their reciprocals are force radii. Keep degenerate velocity sets visible and retain the warning/skip behavior for an unbounded singular force ellipsoid. Document the world axes, joint-rate bound, and scale convention.

Behavior change: 3D ellipsoid axes and sizes now describe the requested physical capability. Flat velocity sets are drawn. The separate planar-ellipse implementation is unchanged.

Validation

  • 33 regressions exercise actual DH Puma/Panda and URDF Panda models, translational/angular modes, force/velocity duality, rotated and translated bases, tools, centers, scaling, redraws, and rank-deficient revolute/prismatic robots.
  • Independent forward-kinematics differences supply the reference Jacobian. Velocity points are checked through minimum-norm joint rates and forces through virtual work; the tests draw the actual Matplotlib artists.
  • Unchanged main: 31 failed, 2 passed.
  • New tests plus three existing plotting modules: 82 passed, 1 skipped, 6 subtests passed.
  • mypy: all 166 source files passed. New-test Ruff lint/format and git diff --check pass.
  • The full repository/platform matrix was not run locally.

Prior work

Checked all 108 prior fork heads and relevant upstream patches. No earlier fork change implements this geometry. #407 corrects selection of translational/angular rows; #788 changes axes/argument handling; #198 and #594 update animation/teaching. They do not fix the world frame or dual radii.

Primary contributor: Afloat16.

Prepared with ChatGPT (GPT-6 Astra Pro) assistance.

Use the world Jacobian and its singular values to render the bounded
velocity capability and the dual force ellipsoid. Keep finite degenerate
velocity sets visible and skip only unbounded singular force ellipsoids.

Co-Authored-By: ChatGPT (GPT-6 Astra Pro) <noreply@openai.com>
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 high

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
ErrorProne 1 high

View in Codacy

🟢 Metrics 19 complexity · 0 duplication

Metric Results
Complexity 19
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Afloat16 and others added 2 commits November 18, 2026 20:41
Use the forward-kinematics rotation with the body Jacobian so the
world-axis rendering also handles Robot/URDF base transforms.

Co-Authored-By: ChatGPT (GPT-6 Astra Pro) <noreply@openai.com>
Keep the validated option handling while making the Jacobian assignment
explicit before selecting translational or angular rows.

Co-Authored-By: ChatGPT (GPT-6 Astra Pro) <noreply@openai.com>
@Afloat16 Afloat16 closed this Nov 19, 2026
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.

1 participant