8000 progress · navrobot/robotics-toolbox-python@899a766 · GitHub
[go: up one dir, main page]

Skip to content

Commit 899a766

Browse files
committed
progress
1 parent 99517fe commit 899a766

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

examples/neo.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,28 @@
100100
# Form the joint limit velocity damper
101101
Ain[:n, :n], bin[:n] = panda.joint_velocity_damper(ps, pi, n)
102102

103+
for link in links:
104+
if link.jtype == link.VARIABLE:
105+
j += 1
106+
for col in link.collision:
107+
obj = s0
108+
l_Ain, l_bin, ret, wTcp = link_calc(link, col, obj, q[:j])
109+
if ret < closest:
110+
closest = ret
111+
closest_obj = obj
112+
closest_p = wTcp
113+
114+
if l_Ain is not None and l_bin is not None:
115+
if Ain is None:
116+
Ain = l_Ain
117+
else:
118+
Ain = np.r_[Ain, l_Ain]
119+
120+
if bin is None:
121+
bin = np.array(l_bin)
122+
else:
123+
bin = np.r_[bin, l_bin]
124+
103125
# Linear component of objective function: the manipulability Jacobian
104126
c = np.r_[-panda.jacobm().reshape((n,)), np.zeros(6)]
105127

roboticstoolbox/robot/ERobot.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,11 +1120,14 @@ def joint_velocity_damper(self, ps=0.05, pi=0.1, n=None, gain=1.0):
11201120

11211121
return Ain, bin
11221122

1123-
# def link_collision_damper(self, link, col, ob, q):
1123+
# def link_collision_damper(self, links=None, col, ob, q):
11241124
# dii = 5
11251125
# di = 0.3
11261126
# ds = 0.05
11271127

1128+
# if links is None:
1129+
# links = self.links[1:]
1130+
11281131
# ret = p.getClosestPoints(col.co, ob.co, dii)
11291132

11301133
# if len(ret) > 0:

0 commit comments

Comments
 (0)
0