fix(models): rename list() to catalog(), fix LBR, add robot_descriptions listing#558
Open
petercorke wants to merge 2 commits into
Open
fix(models): rename list() to catalog(), fix LBR, add robot_descriptions listing#558petercorke wants to merge 2 commits into
petercorke wants to merge 2 commits into
Conversation
…ons listing models.list() shadowed the builtin list, flagged as tech debt last session. Renamed src/roboticstoolbox/models/list.py -> catalog.py, function list() -> catalog(). list() is kept as a deprecated FutureWarning-emitting shim forwarding to catalog(), to be dropped in a future major version. Docs (arm_dh.rst/arm_erobot.rst) and tests/test_models.py updated to call catalog() directly. While testing catalog(), found LBR (Kuka) was the one model that fails to load: its bundled xacro file does $(find kuka_lbr_iiwa_support) but rtb-data ships that content under the directory name "kuka_lbr_iiwa" (no "_support" suffix). The tech-debt.md entry for this proposed renaming the bundled directory (requiring an rtb-data release), but that doesn't actually work -- verified empirically against a throwaway copy -- since xacrodoc's package auto-discovery doesn't register a directory as a package purely by name-matching. Fixed instead with a new extra_packages kwarg on URDFRobot.__init__/URDF_file (mirroring the existing patch= convention) that registers an explicit package-name alias. No rtb-data release needed. Also adds a second table to catalog(), listing models importable by bare name via robot_descriptions but not wrapped by a dedicated RTB class -- 123 URDF-loadable entries with static metadata (name/manufacturer/dof/tags), sourced directly from robot_descriptions.DESCRIPTIONS with no download or instantiation required. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #558 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 142 142
Lines 13694 13729 +35
=====================================
- Misses 13694 13729 +35 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…URDF Adds sorton="name"/"manufacturer"/"dof" to catalog(), case insensitive, sorting both tables via ANSITable.sort() before printing. DoF sorts numerically with blank values (common in the robot_descriptions table) first. Renames columns for consistency across both tables: the toolbox table's "name" and the robot_descriptions table's "robot" both become "robot name"; the robot_descriptions table's identifying column becomes "robot_descriptions name" (matching robot_descriptions' own CLI/module naming) to disambiguate from "robot name". Both tables gain a "model type" column, hardcoded to "URDF" in the robot_descriptions table since only URDF-format entries are listed. catalog(mtype="URDF") now also shows the robot_descriptions table, since every entry in it is a URDF model -- previously the table was shown only when mtype was left unfiltered. 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
models.list()shadowed the builtinlist(flagged as tech debt last session). Renamedmodels/list.py→catalog.py,list()→catalog().list()stays as a deprecatedFutureWarning-emitting shim forwarding tocatalog()— public API, not removed outright. Docs andtests/test_models.pyupdated to callcatalog()directly.LBR(Kuka), the one modelcatalog()was silently failing to load: its bundled xacro does$(find kuka_lbr_iiwa_support)butrtb-dataships that content underkuka_lbr_iiwa(no_supportsuffix). The tech-debt entry proposed renaming the bundled directory (needing anrtb-datarelease) — verified empirically that doesn't actually work, sincexacrodoc's package auto-discovery doesn't register a directory as a package purely by name-matching. Fixed instead with a newextra_packageskwarg onURDFRobot.__init__/URDF_file(mirrors the existingpatch=convention) that registers an explicit package-name alias. Nortb-datarelease needed.catalog(): models importable by bare name viarobot_descriptionsbut not wrapped by a dedicated RTB class — 123 URDF-loadable entries with static metadata, read directly fromrobot_descriptions.DESCRIPTIONSwith no download or instantiation.Test plan
pytest tests/test_models.py -v— 30/30 passing, including the previously-exempted LBR (removed fromEXPECTED_FAILURES)pytest tests/— same 13 pre-existing failures asmain(verified viagit stashdiff), zero regressionscatalog()output (main table + robot_descriptions table with clickable OSC-8 link),mtype=filter correctly skips the robot_descriptions table, deprecatedlist()shim warns and still worksruff check/ruff formatclean on changed files🤖 Generated with Claude Code