File tree Expand file tree Collapse file tree 3 files changed +32
-24
lines changed Expand file tree Collapse file tree 3 files changed +32
-24
lines changed Original file line number Diff line number Diff line change @@ -638,27 +638,6 @@ def isrevolute(self):
638
638
639
639
return p
640
640
641
- def config (self ):
642
- """
643
- Return the joint configuration string
644
-
645
- :return: joint configuration string
646
- :rtype: str
647
-
648
- A string with one letter per joint: ``R`` for a revolute
649
- joint, and ``P`` for a prismatic joint.
650
-
651
- Example:
652
-
653
- .. runblock:: pycon
654
-
655
- >>> import roboticstoolbox as rtb
656
- >>> puma = rtb.models.DH.Puma560()
657
- >>> puma.config()
658
- >>> stanford = rtb.models.DH.Stanford()
659
- >>> stanford.config()
660
- """
661
- return '' .join (['R' if L .isrevolute else 'P' for L in self ])
662
641
663
642
def todegrees (self , q = None ):
664
643
"""
Original file line number Diff line number Diff line change @@ -322,9 +322,9 @@ def isconstant(self):
322
322
return self .axis [0 ] == 'C'
323
323
324
324
@property
325
- def config (self ):
325
+ def structure (self ):
326
326
"""
327
- Joint configuration string
327
+ Joint structure string
328
328
329
329
:return: A string indicating the joint types
330
330
:rtype: str
@@ -338,7 +338,7 @@ def config(self):
338
338
339
339
>>> from roboticstoolbox import ETS
340
340
>>> e = ETS.tz() * ETS.tx(1) * ETS.rz() * ETS.tx(1)
341
- >>> e.config
341
+ >>> e.structure
342
342
343
343
"""
344
344
return '' .join (
Original file line number Diff line number Diff line change @@ -248,6 +248,35 @@ def angle(theta, fmt=None):
248
248
else : # pragma nocover
249
249
return ""
250
250
251
+ @property
252
+ def structure (self ):
253
+ """
254
+ Return the joint structure string
255
+
256
+ :return: joint configuration string
257
+ :rtype: str
258
+
259
+ A string with one letter per joint: ``R`` for a revolute
260
+ joint, and ``P`` for a prismatic joint.
261
+
262
+ Example:
263
+
264
+ .. runblock:: pycon
265
+
266
+ >>> import roboticstoolbox as rtb
267
+ >>> puma = rtb.models.DH.Puma560()
268
+ >>> puma.structure
269
+ >>> stanford = rtb.models.DH.Stanford()
270
+ >>> stanford.structure
271
+ """
272
+ structure = []
273
+ for link in self :
274
+ if link .isrevolute :
275
+ structure .append ('R' )
276
+ elif link .isprismatic :
277
+ structure .append ('P' )
278
+
279
+ return '' .join (structure )
251
280
def linkcolormap (self , linkcolors = "viridis" ):
252
281
"""
253
282
Create a colormap for robot joints
You can’t perform that action at this time.
0 commit comments