Skip to content

fix(models): make KinovaGen3 load via robot_descriptions, add XACRO_ARGS support#546

Merged
petercorke merged 3 commits into
mainfrom
fix/kinovagen3-rd-xacro-args
Jul 5, 2026
Merged

fix(models): make KinovaGen3 load via robot_descriptions, add XACRO_ARGS support#546
petercorke merged 3 commits into
mainfrom
fix/kinovagen3-rd-xacro-args

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Summary

  • KinovaGen3() always raised FileNotFoundError: it pointed at "kortex_description/robots/gen3.xacro" in the bundled rtb-data xacro tree, which has no kortex_description folder at all.
  • robot_descriptions does have a working gen3_description entry (repo ros2_kortex), but its xacro file needs a substitution argument to select the 6dof/7dof arm variant — it exposes XACRO_ARGS = {"dof": "7"} alongside XACRO_PATH. _load_urdf_from_RD() only ever read URDF_PATH/XACRO_PATH and silently dropped XACRO_ARGS, so even switching to RD naively would still fail on an unresolved xacro property.
  • This gap likely affects other RD models exposing XACRO_ARGS too (several UR/xArm/FR3/Rizon variants), though gen3 is the first one this toolbox actually hits.
  • Fix: thread XACRO_ARGS through as XacroDoc's subargs, and switch KinovaGen3.py to the bare "gen3" RD lookup instead of the missing bundled path.

Test plan

  • rtb.models.URDF.KinovaGen3() constructs and prints correctly (7-DOF arm, matches docstring's qr/qz exactly)
  • Full test suite: 652 passed, 13 skipped, no regressions
  • Regression-checked every other RD-loaded model (Jaco, PR2, UR3/5/10, YuMi, Frankie) still constructs fine with the new subargs=None passthrough

🤖 Generated with Claude Code

…RGS support

KinovaGen3.py pointed at "kortex_description/robots/gen3.xacro" in the
bundled rtb-data tree, which doesn't exist there (no kortex_description
folder at all) — always raised FileNotFoundError.

robot_descriptions does have a working gen3_description entry, but its
xacro file requires a substitution argument (XACRO_ARGS = {"dof": "7"})
to select the 6dof/7dof arm variant; without it xacro fails on an
unresolved property reference. _load_urdf_from_RD only ever read
URDF_PATH/XACRO_PATH and silently ignored XACRO_ARGS — a gap that likely
affects other RD models exposing the same attribute (several UR/xArm/FR3
variants), even though this is the first one this toolbox actually hits.

Thread XACRO_ARGS through as XacroDoc's subargs, and switch KinovaGen3 to
the bare "gen3" RD lookup instead of the missing bundled path.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@petercorke petercorke merged commit d746ce4 into main Jul 5, 2026
16 checks passed
@petercorke petercorke deleted the fix/kinovagen3-rd-xacro-args branch July 5, 2026 08:30
@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
src/roboticstoolbox/models/URDF/URDFRobot.py 0.00% 6 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##            main    #546    +/-   ##
======================================
  Coverage   0.00%   0.00%            
======================================
  Files        137     137            
  Lines      13690   13449   -241     
======================================
+ Misses     13690   13449   -241     

☔ 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