Skip to content

Commit 189186c

Browse files
committed
Fixes petercorke#248, base included with defined start frame
1 parent 7dd62fc commit 189186c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

roboticstoolbox/robot/ERobot.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,6 +1275,9 @@ def fkine(
12751275
Sequence, J. Haviland and P. Corke
12761276
"""
12771277

1278+
if start is not None:
1279+
include_base = False
1280+
12781281
# Use c extension to calculate fkine
12791282
if fast:
12801283
path, _, etool = self.get_path(end, start, _fknm=True)
@@ -1286,10 +1289,10 @@ def fkine(
12861289
T = np.empty((4, 4))
12871290
fknm.fkine(m, path, q, etool, tool, T)
12881291

1289-
if not include_base:
1290-
return T
1291-
else:
1292+
if self._base is not None and start is None and include_base == True:
12921293
return self.base.A @ T
1294+
else:
1295+
return T
12931296

12941297
# Otherwise use Python method
12951298
# we work with NumPy arrays not SE2/3 classes for speed
@@ -1340,7 +1343,11 @@ def fkine(
13401343
break
13411344

13421345
# add base transform if it is set
1343-
if self._base is not None and start == self.base_link:
1346+
if (
1347+
self._base is not None
1348+
and start == self.base_link
1349+
and include_base == True
1350+
):
13441351
Tk = self.base.A @ Tk
13451352

13461353
# cast to pose class and append

0 commit comments

Comments
 (0)