Skip to content

Commit 6bf960c

Browse files
committed
add another filter
to filter by model type/category
1 parent 7c1ae24 commit 6bf960c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

roboticstoolbox/models/list.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# import importlib
44

55

6-
def list(keywords=None, dof=None):
6+
def list(keywords=None, dof=None, mtype=None):
77
"""
88
Display all robot models in summary form
99
@@ -15,6 +15,9 @@ def list(keywords=None, dof=None):
1515
- ``list()`` displays a list of all models provided by the Toolbox. It
1616
lists the name, manufacturer, model type, number of DoF, and keywords.
1717
18+
- ``list(mtype=MT)`` as above, but only displays models of type ``MT`` where
19+
``MT`` is one of "DH", "ETS" or "URDF".
20+
1821
- ``list(keywords=KW)`` as above, but only displays models that have a
1922
keyword in the tuple ``KW``.
2023
@@ -41,7 +44,12 @@ def list(keywords=None, dof=None):
4144
Column("keywords", headalign="^", colalign="<"),
4245
border="thin"
4346
)
44-
for category in ['DH', 'URDF', 'ETS']:
47+
48+
if mtype is not None:
49+
categories = [mtype]
50+
else:
51+
categories = ['DH', 'URDF', 'ETS']
52+
for category in categories:
4553
group = m.__dict__[category]
4654
for cls in group.__dict__.values():
4755
if isinstance(cls, type) and issubclass(cls, Robot):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy