Skip to content

fix(models): distinguish not-found vs renamed robot_descriptions models#537

Merged
petercorke merged 2 commits into
mainfrom
fix/rd-error-messages
Jul 4, 2026
Merged

fix(models): distinguish not-found vs renamed robot_descriptions models#537
petercorke merged 2 commits into
mainfrom
fix/rd-error-messages

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Summary

  • _load_rd_module previously raised the same generic "Robot model 'X' is not available..." ValueError whether the name was a genuine typo or had simply moved to a different name in robot_descriptions.
  • Now checks robot_descriptions.DESCRIPTIONS (a static registry, no network call) to distinguish the two cases:
    • Genuinely not found: Toolbox uses robot_descriptions to provide URDF robot models. The requested model named "X" can not be found.
    • Renamed/available under another name: ...The requested model named "X" is now named "Y".
  • robot_descriptions renders as a clickable terminal hyperlink (OSC 8) rather than a bare word, since users of roboticstoolbox have no reason to already know that package exists. Degrades to plain text on terminals that don't support OSC 8.

Test plan

  • Genuine-typo case (totally_fake_robot_xyz) — correct message
  • Real rename case (adam_liteadam_lite_mj_description, found via DESCRIPTIONS) — correct message
  • Successful load path (rtb.models.URDF.UR5()) unaffected

🤖 Generated with Claude Code

petercorke and others added 2 commits July 4, 2026 15:40
_load_rd_module raised the same generic ValueError whether a model
name was a genuine typo or had simply moved to a different name under
robot_descriptions. Now checks robot_descriptions' static DESCRIPTIONS
registry (no network needed) to tell the two cases apart and names the
correct current model name when one exists. Also renders
"robot_descriptions" as a clickable terminal hyperlink (OSC 8,
degrades to plain text on terminals that don't support it) rather than
a bare word, since users calling roboticstoolbox have no reason to
already know that package exists.

Rehearsed: genuine-typo case, a real rename case (adam_lite ->
adam_lite_mj_description, found via DESCRIPTIONS), and confirmed the
successful-load path (UR5) is unaffected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
If a requested model name contains "_mj_" it's asking for a MuJoCo
(MJCF) variant, which this URDF-loading path can't use. Raise a
specific error rather than either silently attempting an MJCF clone
or falling through to the generic not-found/renamed messages.

Rehearsed: "test_mj_robot" and "aloha_mj_description" both raise the
new message; genuine not-found, rename, and success paths unaffected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@petercorke petercorke merged commit 68da27f into main Jul 4, 2026
7 of 13 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 4, 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