Skip to content

Commit 92489f8

Browse files
committed
fix neo example
1 parent d0890eb commit 92489f8

File tree

2 files changed

+14
-22
lines changed

2 files changed

+14
-22
lines changed

roboticstoolbox/examples/neo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@
2525
n = 7
2626

2727
# Make two obstacles with velocities
28-
s0 = sg.Sphere(radius=0.05, base=sm.SE3(0.52, 0.4, 0.3))
28+
s0 = sg.Sphere(radius=0.05, pose=sm.SE3(0.52, 0.4, 0.3))
2929
s0.v = [0, -0.2, 0, 0, 0, 0]
3030

31-
s1 = sg.Sphere(radius=0.05, base=sm.SE3(0.1, 0.35, 0.65))
31+
s1 = sg.Sphere(radius=0.05, pose=sm.SE3(0.1, 0.35, 0.65))
3232
s1.v = [0, -0.2, 0, 0, 0, 0]
3333

3434
collisions = [s0, s1]
3535

3636
# Make a target
37-
target = sg.Sphere(radius=0.02, base=sm.SE3(0.6, -0.2, 0.0))
37+
target = sg.Sphere(radius=0.02, pose=sm.SE3(0.6, -0.2, 0.0))
3838

3939
# Add the Panda and shapes to the simulator
4040
env.add(panda)
@@ -44,7 +44,7 @@
4444

4545
# Set the desired end-effector pose to the location of target
4646
Tep = panda.fkine(panda.q)
47-
Tep.A[:3, 3] = target.base.t
47+
Tep.A[:3, 3] = target.T[:3, -1]
4848
# Tep.A[2, 3] += 0.1
4949

5050

roboticstoolbox/robot/ERobot.py

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,7 +1447,7 @@ def URDF_read(file_path, tld=None, xacro_tld=None):
14471447

14481448
# --------------------------------------------------------------------- #
14491449

1450-
def get_path(self, end=None, start=None, _fknm=False):
1450+
def get_path(self, end=None, start=None):
14511451
"""
14521452
Find a path from start to end. The end must come after
14531453
the start (ie end must be further away from the base link
@@ -1466,20 +1466,17 @@ def get_path(self, end=None, start=None, _fknm=False):
14661466
path = []
14671467
n = 0
14681468

1469-
end, start, tool = self._get_limit_links(end, start)
1469+
end, start, tool = self._get_limit_links(end=end, start=start)
14701470

14711471
# This is way faster than doing if x in y method
14721472
try:
1473-
if _fknm:
1474-
return self._path_cache_fknm[start.name][end.name]
1475-
else:
1476-
return self._path_cache[start.name][end.name]
1473+
return self._path_cache[start.name][end.name]
14771474
except KeyError:
14781475
pass
14791476

14801477
if start.name not in self._path_cache:
14811478
self._path_cache[start.name] = {}
1482-
self._path_cache_fknm[start.name] = {}
1479+
# self._path_cache_fknm[start.name] = {}
14831480

14841481
link = end
14851482

@@ -1498,18 +1495,15 @@ def get_path(self, end=None, start=None, _fknm=False):
14981495
n += 1
14991496

15001497
path.reverse()
1501-
path_fknm = [x._fknm for x in path]
1498+
# path_fknm = [x._fknm for x in path]
15021499

15031500
if tool is None:
15041501
tool = SE3()
15051502

15061503
self._path_cache[start.name][end.name] = (path, n, tool)
1507-
self._path_cache_fknm[start.name][end.name] = (path_fknm, n, tool.A)
1504+
# self._path_cache_fknm[start.name][end.name] = (path_fknm, n, tool.A)
15081505

1509-
if _fknm:
1510-
return path_fknm, n, tool.A
1511-
else:
1512-
return path, n, tool
1506+
return path, n, tool
15131507

15141508
def fkine(
15151509
self,
@@ -1915,7 +1909,7 @@ def link_collision_damper(
19151909
:rtype: ndarray(6), ndarray(6)
19161910
"""
19171911

1918-
start, end, _ = self._get_limit_links()
1912+
end, start, _ = self._get_limit_links(start=start, end=end)
19191913

19201914
links, n, _ = self.get_path(start=start, end=end)
19211915

@@ -1935,11 +1929,9 @@ def indiv_calculation(link, link_col, q):
19351929
lpTcp = -wTlp + wTcp
19361930

19371931
norm = lpTcp / d
1938-
norm_h = expand_dims(concatenate((norm, 0, 0, 0)), axis=0)
1932+
norm_h = expand_dims(concatenate((norm, [0, 0, 0])), axis=0)
19391933

1940-
Je = self.jacobe(
1941-
q, start=self.base_link, end=link, tool=link_col.base.A
1942-
)
1934+
Je = self.jacobe(q, start=self.base_link, end=link, tool=link_col.T)
19431935
n_dim = Je.shape[1]
19441936
dp = norm_h @ shape.v
19451937
l_Ain = zeros((1, n))

0 commit comments

Comments
 (0)