3
3
# import importlib
4
4
5
5
6
- def list (keywords = None , dof = None ):
6
+ def list (keywords = None , dof = None , mtype = None ):
7
7
"""
8
8
Display all robot models in summary form
9
9
@@ -15,6 +15,9 @@ def list(keywords=None, dof=None):
15
15
- ``list()`` displays a list of all models provided by the Toolbox. It
16
16
lists the name, manufacturer, model type, number of DoF, and keywords.
17
17
18
+ - ``list(mtype=MT)`` as above, but only displays models of type ``MT`` where
19
+ ``MT`` is one of "DH", "ETS" or "URDF".
20
+
18
21
- ``list(keywords=KW)`` as above, but only displays models that have a
19
22
keyword in the tuple ``KW``.
20
23
@@ -41,7 +44,12 @@ def list(keywords=None, dof=None):
41
44
Column ("keywords" , headalign = "^" , colalign = "<" ),
42
45
border = "thin"
43
46
)
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 :
45
53
group = m .__dict__ [category ]
46
54
for cls in group .__dict__ .values ():
47
55
if isinstance (cls , type ) and issubclass (cls , Robot ):
0 commit comments