Skip to content

fix(robot): qlim and printing work for a robot with symbolic parameters - #856

Merged
petercorke merged 3 commits into
mainfrom
fix/symbolic-qlim
Oct 19, 2026
Merged

petercorke merged 3 commits into
mainfrom
fix/symbolic-qlim

Conversation

@petercorke

Copy link
Copy Markdown
Owner

print(robot) and robot.qlim raised TypeError: ufunc 'isnan' not supported for a robot made with symbolic=True, for example rtb.models.DH.Puma560(symbolic=True). Found while renovating symbolic.ipynb.

The qlim property tested the joint limits with np.isnan, which rejects the SymPy numbers a symbolic model holds. It now converts the limits to floats first. This does not change results for numeric models. A limit that is a free symbol still cannot be represented in the float array that qlim returns, and now raises the conversion error from NumPy.

New tests/test_symbolic_qlim.py (3 tests: the symbolic limits equal the numeric ones, a symbolic robot prints, and the default limits for an unset revolute joint). Full suite: only the 20 test_servo_half_turn failures from the stale compiled extension in my worktree; mypy clean. Written with AI assistance (Claude Code).

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@petercorke
petercorke enabled auto-merge (squash) October 19, 2026 08:22
@codacy-production

codacy-production Bot commented Oct 19, 2026 •

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
Security 1 high

View in Codacy

🟢 Metrics 373 complexity · 3 duplication

Metric Results
Complexity 373
Duplication 3

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.

@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (1ddf6dd) to head (b5787b3).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/roboticstoolbox/robot/BaseRobot.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main    #856   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files        146     146           
  Lines      16866   16867    +1     
=====================================
- Misses     16866   16867    +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@petercorke
petercorke merged commit 7666c63 into main Oct 19, 2026
22 of 23 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 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