Repository navigation
fix(robot): Robot.set_default_backend replaces rtbtool's monkey-patch; URDFRobot drops a dead guard - #810
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…; URDFRobot drops a dead guard rtbtool assigned a string to Robot.default_backend on the class, replacing the property for every robot. It worked because an instance assignment then shadows the class attribute. Robot.set_default_backend(be) is a classmethod that sets a class-level default which the property falls back to; the robot's own value still wins, and the property stays a property. URDFRobot wrapped elink.geometry = [...] in try/except AttributeError, with a comment that geometry has no setter. It has one, and every visual that parses has a shape (a missing mesh or an empty geometry is a URDFError at parse time), so the guard could not fire. Removed, with tests for both facts. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| ErrorProne | 1 high |
| Security | 8 high |
🟢 Metrics 9 complexity · 0 duplication
Metric Results Complexity 9 Duplication 0
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 Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #810 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 144 144
Lines 14914 14917 +3
=====================================
- Misses 14914 14917 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Items 58 and 59 of the typing pass.
58,
rtbtool:rtbtoolassigned a string toRobot.default_backendon the class, replacing the property for every robot. It worked because an instance assignment then shadows the class attribute, and needed atype: ignore.Robot.set_default_backend(be)is a classmethod that sets a class-level default which thedefault_backendproperty falls back to. The robot's own value still wins, the property stays a property, andrtbtoolcalls the classmethod.59,
URDFRobot:elink.geometry = [...]was insidetry/except AttributeError, under a comment saying geometry has no setter. It has one (Link.py), and the assignment works. Every visual that parses has a shape (a missing mesh, an empty<geometry/>, no<geometry>or an unknown shape tag is aURDFErrorat parse time), so the guard could not fire. It is removed, and tests assert both facts.Tests
tests/test_default_backend.py, written first: 4 of 4 failed (AttributeError: no attribute 'set_default_backend'), then pass.tests/test_urdf_visual_geometry.py: shapes reach the link, and four malformed visuals are rejected when parsed.mainhere (stale compiled extension). mypy clean on 164 files.Related issue
None.
🤖 Generated with Claude Code