Skip to content

Commit 08b47ed

Browse files
committed
property config is now called structure, and consistent between Robot classes and ETS
moved to Robot class fix bug with fixed links
1 parent 6d658ec commit 08b47ed

File tree

3 files changed

+32
-24
lines changed

3 files changed

+32
-24
lines changed

roboticstoolbox/robot/DHRobot.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -638,27 +638,6 @@ def isrevolute(self):
638638

639639
return p
640640

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])
662641

663642
def todegrees(self, q=None):
664643
"""

roboticstoolbox/robot/ETS.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,9 @@ def isconstant(self):
322322
return self.axis[0] == 'C'
323323

324324
@property
325-
def config(self):
325+
def structure(self):
326326
"""
327-
Joint configuration string
327+
Joint structure string
328328
329329
:return: A string indicating the joint types
330330
:rtype: str
@@ -338,7 +338,7 @@ def config(self):
338338
339339
>>> from roboticstoolbox import ETS
340340
>>> e = ETS.tz() * ETS.tx(1) * ETS.rz() * ETS.tx(1)
341-
>>> e.config
341+
>>> e.structure
342342
343343
"""
344344
return ''.join(

roboticstoolbox/robot/Robot.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,35 @@ def angle(theta, fmt=None):
248248
else: # pragma nocover
249249
return ""
250250

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)
251280
def linkcolormap(self, linkcolors="viridis"):
252281
"""
253282
Create a colormap for robot joints

0 commit comments

Comments
 (0)