Skip to content

fix(models): rename list() to catalog(), fix LBR, add robot_descriptions listing#558

Open
petercorke wants to merge 2 commits into
mainfrom
fix/lbr-catalog-rename
Open

fix(models): rename list() to catalog(), fix LBR, add robot_descriptions listing#558
petercorke wants to merge 2 commits into
mainfrom
fix/lbr-catalog-rename

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Summary

  • models.list() shadowed the builtin list (flagged as tech debt last session). Renamed models/list.pycatalog.py, list()catalog(). list() stays as a deprecated FutureWarning-emitting shim forwarding to catalog() — public API, not removed outright. Docs and tests/test_models.py updated to call catalog() directly.
  • Fixes LBR (Kuka), the one model catalog() was silently failing to load: its bundled xacro does $(find kuka_lbr_iiwa_support) but rtb-data ships that content under kuka_lbr_iiwa (no _support suffix). The tech-debt entry proposed renaming the bundled directory (needing an rtb-data release) — verified empirically that doesn't actually work, 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 (mirrors the existing patch= convention) that registers an explicit package-name alias. No rtb-data release needed.
  • Adds a second table to catalog(): models importable by bare name via robot_descriptions but not wrapped by a dedicated RTB class — 123 URDF-loadable entries with static metadata, read directly from robot_descriptions.DESCRIPTIONS with no download or instantiation.

Test plan

  • pytest tests/test_models.py -v — 30/30 passing, including the previously-exempted LBR (removed from EXPECTED_FAILURES)
  • pytest tests/ — same 13 pre-existing failures as main (verified via git stash diff), zero regressions
  • Manually verified catalog() output (main table + robot_descriptions table with clickable OSC-8 link), mtype= filter correctly skips the robot_descriptions table, deprecated list() shim warns and still works
  • ruff check/ruff format clean on changed files

🤖 Generated with Claude Code

…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

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 76 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (b111856) to head (44915c4).

Files with missing lines Patch % Lines
src/roboticstoolbox/models/catalog.py 0.00% 71 Missing ⚠️
src/roboticstoolbox/models/URDF/URDFRobot.py 0.00% 3 Missing ⚠️
src/roboticstoolbox/models/__init__.py 0.00% 2 Missing ⚠️
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.
📢 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.

…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>
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