Skip to content

fix(models): patch broken upstream RD files for Valkyrie and Fetch#543

Merged
petercorke merged 2 commits into
mainfrom
fix/valkyrie-fetch-rd-patch
Jul 5, 2026
Merged

fix(models): patch broken upstream RD files for Valkyrie and Fetch#543
petercorke merged 2 commits into
mainfrom
fix/valkyrie-fetch-rd-patch

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Summary

  • Valkyrie() and Fetch() both already load via robot_descriptions (bare-name path), but the upstream files served by RD are themselves broken: Valkyrie's valkyrie_sim.urdf contains an unexpanded xacro macro with no definition anywhere in its own repo, and Fetch's fetch.urdf uses an undeclared XML namespace prefix (unbound prefix). Neither is fixable upstream — openai/roboschool is archived (no PRs possible), and the missing Valkyrie macro would have to be invented from scratch with no source of truth.
  • Valkyrie is referenced in the RVC3 textbook, so a working model is required, not optional cleanup. Fetch was equally trivial to fix, so both were patched rather than deleting either.
  • Added an optional patch: Callable[[str], str] hook to URDF_file/URDF_read/URDFRobot.__init__ that runs on the raw file text before xacro/XML processing. Each model defines a small local patch function that surgically strips the one broken, Gazebo-simulation-only element responsible — neither has any bearing on kinematics/dynamics/geometry.
  • Each patch function documents the exact robot_descriptions version and upstream commit it targets, so it can be confirmed safe to delete if upstream ever fixes the file (the regex would simply stop matching).

Test plan

  • rtb.models.URDF.Valkyrie() and .Fetch() both construct and print() correctly, matching their docstring runblock examples exactly
  • Full test suite: 652 passed, 13 skipped, no regressions

🤖 Generated with Claude Code

Both models already load via robot_descriptions, but the upstream files
themselves are broken: Valkyrie's valkyrie_sim.urdf still contains an
unexpanded xacro macro call with no definition anywhere in its repo, and
Fetch's fetch.urdf uses an undeclared XML namespace prefix (unbound
prefix). Neither is fixable upstream (roboschool is archived; the
nasa-urdf-robots macro would have to be invented from scratch).

Add an optional patch hook to URDF_file/URDF_read/URDFRobot.__init__ that
runs on the raw text before xacro/XML processing, and use it in each
model to surgically strip the one broken, Gazebo-simulation-only element
responsible — neither block has any bearing on kinematics, dynamics, or
geometry. Each patch documents exactly which robot_descriptions version
and upstream commit it targets, so it can be removed if upstream ever
fixes the underlying file.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@petercorke petercorke merged commit acb8c6b into main Jul 5, 2026
15 checks passed
@petercorke petercorke deleted the fix/valkyrie-fetch-rd-patch branch July 5, 2026 08:18
@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (a9ed8d4) to head (44942c0).
⚠️ Report is 46 commits behind head on main.

Files with missing lines Patch % Lines
src/roboticstoolbox/models/URDF/URDFRobot.py 0.00% 13 Missing ⚠️
src/roboticstoolbox/models/URDF/Valkyrie.py 0.00% 4 Missing ⚠️
src/roboticstoolbox/models/URDF/Fetch.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##            main    #543    +/-   ##
======================================
  Coverage   0.00%   0.00%            
======================================
  Files        137     137            
  Lines      13690   13446   -244     
======================================
+ Misses     13690   13446   -244     

☔ 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.

@github-actions github-actions Bot mentioned this pull request Jul 5, 2026
petercorke added a commit that referenced this pull request Jul 5, 2026
Valkyrie, Fetch, and KinovaGen3 are now fixed on main; FetchCamera is
removed entirely (so its entry would be a harmless no-op, but delete it
for hygiene). Only LBR remains genuinely broken.
petercorke added a commit that referenced this pull request Jul 5, 2026
…547)

* test(models): add smoke test that every DH/URDF/ETS model constructs

Existing tests are hand-written per model, so a model exported in
__all__ can go completely untested -- Valkyrie, Fetch, KinovaGen3,
FetchCamera, and LBR all had zero coverage this way, three of them
silently broken with nothing to catch it (see tech-debt.md).

Iterates each category's own __all__ directly (rather than scanning
module __dict__/inspect.getmembers, which would also pick up re-exported
base classes like Robot/URDFRobot) and asserts every listed class
constructs with no arguments. Known-currently-broken models are tracked
in an explicit EXPECTED_FAILURES set, which fails loudly in *both*
directions: a newly-broken model fails the test, and a since-fixed
"expected failure" that starts passing also fails the test, forcing its
entry to be cleaned up rather than silently going stale.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* test(models): trim EXPECTED_FAILURES now that #543/#545/#546 are merged

Valkyrie, Fetch, and KinovaGen3 are now fixed on main; FetchCamera is
removed entirely (so its entry would be a harmless no-op, but delete it
for hygiene). Only LBR remains genuinely broken.

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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