Skip to content

fix(robot): align joint constraints and geometry safety queries - #988

Open
Afloat16 wants to merge 6 commits into
petercorke:mainfrom
Afloat16:fix/joint-damper-indices
Open

Afloat16 wants to merge 6 commits into
petercorke:mainfrom
Afloat16:fix/joint-damper-indices

Conversation

@Afloat16

@Afloat16 Afloat16 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Batch the related Robot fixes from #988, #964, #965 and #977 in response to the request to consolidate fixes within the same module. The original commits remain parents of the integration commit, and all component regression tests are retained.

The existing implementations can omit a joint-limit constraint, project collision motion in inconsistent frames, miss a nearby gripper, or underestimate a robot's reach. These errors affect constrained motion, distance queries and automatically chosen plotting bounds.

Changes and numerical behavior

  • Align joint_velocity_damper limit columns with the configuration's joint indices. Keep the existing constraint shapes, damper equations and leading-coordinate n selection.
  • Evaluate collision-damper contact Jacobians in world axes, including the contact lever arm. Retain the existing subchain column placement and obstacle-velocity bounds.
  • Include gripper links in closest_point() and preserve the winning signed distance, world contact points, cutoff and skip behavior.
  • Include compound-transform translation norms in reach estimates, account for prismatic limits after offsets/flips, and count fixed DH distances by magnitude. Base and tool transforms remain outside the link-length estimate; an unbounded joint is not assigned a claimed finite travel bound.

Public numerical behavior changes for affected joint-limit constraints, collision constraints, gripper distances and reach estimates. Public signatures are unchanged. Coverage includes constrained-optimizer motion, independent distance-gradient checks, gripper collision geometry and reach bounds.

Validation

Revalidated after merging upstream main at bceb42c18877840280037539dac036f21d4fefe5 in commit a2fab6e2d590d58f54e1c882aba3eff480b7d55f. The contribution source and regression files are unchanged by this update.

PYTHONPATH=src python -m pytest \
  tests/test_joint_damper_indices.py tests/test_collision_damper_frames.py \
  tests/test_closest_grippers.py tests/test_robot_reach_bounds.py \
  tests/test_Robot.py tests/test_DHRobot.py tests/test_ERobot.py \
  --timeout=50 --timeout_method=thread -q

Result: 310 passed, 2 existing tests skipped. The collision tests ran with Coal available.

Validation used Linux, Python 3.12.14, NumPy 2.5.5, SciPy 1.18.1 and Matplotlib 3.11.2, with the source tree on PYTHONPATH=src. The Python kinematics/dynamics fallbacks were used. The compiled extension, other operating systems and the complete repository/platform matrix were not run locally.

python -m mypy passed for all 166 source files using upstream main's Python 3.11 target. git diff --check passed. The regression files are unchanged from the integration revision, where Ruff lint and format checks passed.

Contribution

Primary contributor: @Afloat16.

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

Afloat16 and others added 4 commits November 18, 2026 16:53
Transform the link-origin body Jacobian to the closest point in world axes using the SpatialMath adjoint. Preserve full-robot constraint columns and ignore end-effector tools when evaluating link contacts.

Co-Authored-By: ChatGPT (GPT-6 Astra Pro) <noreply@openai.com>
Compare collision geometry from the arm and all independently configured grippers. Preserve world contact points, the distance cutoff and skip semantics.

Co-Authored-By: ChatGPT (GPT-6 Astra Pro) <noreply@openai.com>
Include compound-transform translations and bound prismatic displacement
over signed joint limits after applying offsets and flips. Count fixed
DH distances by magnitude, retaining the longest-branch length sum.

Co-Authored-By: ChatGPT (GPT-6 Astra Pro) <noreply@openai.com>
Map link-order limits to configuration order before forming velocity
constraints, preserving the existing matrix shape and prefix contract.

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

codacy-production Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 69 complexity · 4 duplication

Metric Results
Complexity 69
Duplication 4

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.

@petercorke

Copy link
Copy Markdown
Owner

Hi @Afloat16,

Thank you for the effort you've put into these PRs—the numerical edge-case catches and accompanying tests are genuinely useful.

However, the volume and frequency of incoming PRs has become unsustainable to review. Reviewing, testing, and merging this many individual PRs comes at a very high cost to my personal time—time I would otherwise be spending on adding new features and maintaining the broader roadmap. Because of this, I've had to activate PR throttling on the repository.

Going forward, could you please:

  • Keep a maximum of 2–3 open PRs at any one time, and wait for those to be reviewed before opening more.
  • Batch related fixes (e.g., numerical edge cases within the same module) into a single PR rather than submitting one PR per micro-fix.

I appreciate your contributions, and working within these limits will make it much easier for me to review and merge your work.

Thanks,
Peter

Combine the existing fixes from PRs petercorke#988, petercorke#964, petercorke#965 and petercorke#977 into one reviewable Robot module change, following the maintainer's request to batch related fixes. Preserve each original commit as a parent and retain every regression.

Joint limits follow joint-index order; collision dampers use world-frame contact Jacobians; distance queries include grippers; reach bounds account for signed motion, offsets and compound translations.

Validation: 310 tests passed, 2 existing tests skipped; mypy passed for all 166 source files. Regression-test Ruff lint/format and git diff --check passed. Tested with Python 3.12 and the Python kinematics/dynamics fallbacks; compiled/platform CI was not run locally.

Co-Authored-By: ChatGPT (GPT-6 Astra Pro) <noreply@openai.com>
@Afloat16 Afloat16 changed the title fix(control): align joint-limit dampers with joint indices fix(robot): align joint constraints and geometry safety queries Nov 19, 2026
Integrate upstream main bceb42c without changing the contribution files.
Revalidate the related regression suites and mypy against Python 3.11
configuration while retaining the existing commit history.

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

Afloat16 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks, Peter. The open set is now limited to three related batches:

The component PRs are consolidated into those batches, and the remaining topics are closed for queuing rather than competing for review. I will keep the open set within your 2–3 PR limit and wait for reviews before bringing another topic forward.

All three current heads integrate main bceb42c18877840280037539dac036f21d4fefe5; their descriptions identify behavior changes and validation. The CI matrices have now completed on all three unchanged heads: #988 a2fab6e2, #971 fae5e497, and #957 f3fc039a. All checks have passed apart from the expected skips, with no failed or pending checks. The three batches are ready for your review at a pace that works for you.

This branch has not been deployed

No deployments
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