fix(models): distinguish not-found vs renamed robot_descriptions models#537
Merged
Conversation
_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>
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
_load_rd_modulepreviously raised the same generic "Robot model 'X' is not available..."ValueErrorwhether the name was a genuine typo or had simply moved to a different name inrobot_descriptions.robot_descriptions.DESCRIPTIONS(a static registry, no network call) to distinguish the two cases:Toolbox uses robot_descriptions to provide URDF robot models. The requested model named "X" can not be found....The requested model named "X" is now named "Y".robot_descriptionsrenders as a clickable terminal hyperlink (OSC 8) rather than a bare word, since users ofroboticstoolboxhave no reason to already know that package exists. Degrades to plain text on terminals that don't support OSC 8.Test plan
totally_fake_robot_xyz) — correct messageadam_lite→adam_lite_mj_description, found viaDESCRIPTIONS) — correct messagertb.models.URDF.UR5()) unaffected🤖 Generated with Claude Code