Skip to content

Commit 78dd768

Browse files
committed
change name of properties for ETS to avoid confusion.
isrevolute/isprismatic is not isrotation/istranslation tx constant is properly a translation but not a prismatic
1 parent 31d8918 commit 78dd768

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

roboticstoolbox/robot/ETS.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def jindex(self, j):
315315
self.data[0].jindex = j
316316

317317
@property
318-
def isrevolute(self):
318+
def isrotation(self):
319319
"""
320320
Test if ET is a rotation
321321
@@ -328,14 +328,14 @@ def isrevolute(self):
328328
329329
>>> from roboticstoolbox import ETS
330330
>>> e = ETS.tx(1)
331-
>>> e.isrevolute
331+
>>> e.isrotation
332332
>>> e = ETS.rx()
333-
>>> e.isrevolute
333+
>>> e.isrotation
334334
"""
335335
return self.axis[0] == 'R'
336336

337337
@property
338-
def isprismatic(self):
338+
def istranslation(self):
339339
"""
340340
Test if ET is a translation
341341
@@ -348,9 +348,9 @@ def isprismatic(self):
348348
349349
>>> from roboticstoolbox import ETS
350350
>>> e = ETS.tx(1)
351-
>>> e.isprismatic
351+
>>> e.istranslation
352352
>>> e = ETS.rx()
353-
>>> e.isprismatic
353+
>>> e.istranslation
354354
"""
355355
return self.axis[0] == 't'
356356

@@ -394,7 +394,7 @@ def structure(self):
394394
395395
"""
396396
return ''.join(
397-
['R' if self.isrevolute else 'P' for i in self.joints()])
397+
['R' if self.isrotation else 'P' for i in self.joints()])
398398

399399
@property
400400
def qlim(self):
@@ -505,7 +505,7 @@ def eval(self, q=None, unit='rad'):
505505
qj = q.pop(0)
506506
else:
507507
qj = q[et.jindex]
508-
if et.isrevolute and unit == 'deg':
508+
if et.isrotation and unit == 'deg':
509509
qj *= np.pi / 180.0
510510

511511
Tk = et.T(qj)
@@ -680,13 +680,13 @@ def __str__(self, q=None):
680680
s = f"{et.axis}({qvar})"
681681
j += 1
682682

683-
elif et.isrevolute:
683+
elif et.isrotation:
684684
if issymbol(et.eta):
685685
s = f"{et.axis}({et.eta:.4g})"
686686
else:
687687
s = f"{et.axis}({et.eta * 180 / np.pi:.4g}°)"
688688

689-
elif et.isprismatic:
689+
elif et.istranslation:
690690
s = f"{et.axis}({et.eta:.4g})"
691691

692692
elif et.isconstant:
@@ -944,7 +944,7 @@ def teach(self, *args, **kwargs):
944944

945945
if isinstance(self, ETS):
946946
robot = ERobot(self)
947-
else:
947+
elif isinstance(self, ETS2):
948948
robot = ERobot2(self)
949949

950950
robot.teach(*args, **kwargs)
@@ -1047,7 +1047,7 @@ def rx(cls, eta=None, unit='rad', **kwargs):
10471047
angle, i.e. a revolute robot joint. ``j`` or ``flip`` can be set in
10481048
this case.
10491049
1050-
:seealso: :func:`ETS`, :func:`isrevolute`
1050+
:seealso: :func:`ETS`, :func:`isrotation`
10511051
:SymPy: supported
10521052
"""
10531053
return cls(axis='Rx', eta=eta, axis_func=trotx, unit=unit, **kwargs)
@@ -1074,7 +1074,7 @@ def ry(cls, eta=None, unit='rad', **kwargs):
10741074
angle, i.e. a revolute robot joint. ``j`` or ``flip`` can be set in
10751075
this case.
10761076
1077-
:seealso: :func:`ETS`, :func:`isrevolute`
1077+
:seealso: :func:`ETS`, :func:`isrotation`
10781078
:SymPy: supported
10791079
"""
10801080
return cls(axis='Ry', eta=eta, axis_func=troty, unit=unit, **kwargs)
@@ -1101,7 +1101,7 @@ def rz(cls, eta=None, unit='rad', **kwargs):
11011101
angle, i.e. a revolute robot joint. ``j`` or ``flip`` can be set in
11021102
this case.
11031103
1104-
:seealso: :func:`ETS`, :func:`isrevolute`
1104+
:seealso: :func:`ETS`, :func:`isrotation`
11051105
:SymPy: supported
11061106
"""
11071107
return cls(axis='Rz', eta=eta, axis_func=trotz, unit=unit, **kwargs)
@@ -1126,7 +1126,7 @@ def tx(cls, eta=None, **kwargs):
11261126
variable distance, i.e. a prismatic robot joint. ``j`` or ``flip``
11271127
can be set in this case.
11281128
1129-
:seealso: :func:`ETS`, :func:`isprismatic`
1129+
:seealso: :func:`ETS`, :func:`istranslation`
11301130
:SymPy: supported
11311131
"""
11321132

@@ -1161,7 +1161,7 @@ def ty(cls, eta=None, **kwargs):
11611161
variable distance, i.e. a prismatic robot joint. ``j`` or ``flip``
11621162
can be set in this case.
11631163
1164-
:seealso: :func:`ETS`, :func:`isprismatic`
1164+
:seealso: :func:`ETS`, :func:`istranslation`
11651165
:SymPy: supported
11661166
"""
11671167
def axis_func(eta):
@@ -1196,7 +1196,7 @@ def tz(cls, eta=None, **kwargs):
11961196
variable distance, i.e. a prismatic robot joint. ``j`` or ``flip``
11971197
can be set in this case.
11981198
1199-
:seealso: :func:`ETS`, :func:`isprismatic`
1199+
:seealso: :func:`ETS`, :func:`istranslation`
12001200
:SymPy: supported
12011201
"""
12021202
def axis_func(eta):
@@ -1511,7 +1511,7 @@ def r(cls, eta=None, unit='rad', **kwargs):
15111511
.. note:: In the 2D case this is rotation around the normal to the
15121512
xy-plane.
15131513
1514-
:seealso: :func:`ETS`, :func:`isrevolute`
1514+
:seealso: :func:`ETS`, :func:`isrotation`
15151515
"""
15161516
return cls(
15171517
axis='R', eta=eta,
@@ -1537,7 +1537,7 @@ def tx(cls, eta=None, **kwargs):
15371537
variable distance, i.e. a prismatic robot joint. ``j`` or ``flip``
15381538
can be set in this case.
15391539
1540-
:seealso: :func:`ETS`, :func:`isprismatic`
1540+
:seealso: :func:`ETS`, :func:`istranslation`
15411541
"""
15421542
return cls(
15431543
axis='tx', eta=eta,

0 commit comments

Comments
 (0)