8000 fixed neo · A905275/robotics-toolbox-python@c53bba9 · GitHub
[go: up one dir, main page]

Skip to content

Commit c53bba9

Browse files
committed
fixed neo
1 parent d2461c6 commit c53bba9

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

examples/neo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,4 @@
133133
panda.qd[:n] = qd[:n]
134134

135135
# Step the simulator by 50 ms
136-
env.step(50)
136+
env.step(0.05)

roboticstoolbox/robot/ERobot.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -648,19 +648,31 @@ def fkine(self, q=None, from_link=None, to_link=None):
648648
if q is None:
649649
q = self.q
650650

651+
path, n = self.get_path(from_link, to_link)
652+
653+
use_jindex = True
654+
651655
try:
652656
q = getvector(q, self.n, 'col')
653-
except ValueError:
654-
trajn = q.shape[1]
655-
verifymatrix(q, (self.n, trajn))
656657

657-
path, _ = self.get_path(from_link, to_link)
658+
except ValueError:
659+
try:
660+
q = getvector(q, n, 'col')
661+
use_jindex = False
662+
j = 0
663+
except ValueError:
664+
trajn = q.shape[1]
665+
verifymatrix(q, (self.n, trajn))
658666

659667
for i in range(trajn):
660668
tr = self.base.A
661669
for link in path:
662670
if link.isjoint:
663-
T = link.A(q[link.jindex, i], fast=True)
671+
if use_jindex:
672+
T = link.A(q[link.jindex, i], fast=True)
673+
else:
674+
T = link.A(q[j, i], fast=True)
675+
j += 1
664676
else:
665677
T = link.A(fast=True)
666678

@@ -1317,7 +1329,7 @@ def indiv_calculation(link, link_col, q):
13171329
return l_Ain, l_bin, d, wTcp
13181330

13191331
for link in links:
1320-
if link.jtype == link.VARIABLE:
1332+
if link.isjoint:
13211333
j += 1
13221334

13231335
for link_col in link.collision:

0 commit comments

Comments
 (0)
0