Skip to content

Commit 3455429

Browse files
committed
collision damper to points
1 parent a33b1af commit 3455429

File tree

3 files changed

+19
-22
lines changed

3 files changed

+19
-22
lines changed

roboticstoolbox/examples/neo.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import spatialmath as sm
1010
import numpy as np
1111
import qpsolvers as qp
12+
import cProfile
1213

1314
# Launch the simulator Swift
1415
env = swift.Swift()
@@ -55,10 +56,8 @@
5556
Tep.A[:3, 3] = target.base.t
5657
Tep.A[2, 3] += 0.1
5758

58-
arrived = False
59-
60-
while not arrived:
6159

60+
def step():
6261
# The pose of the Panda's end-effector
6362
Te = panda.fkine(panda.q)
6463

@@ -136,4 +135,17 @@
136135
panda.qd[:n] = qd[:n]
137136

138137
# Step the simulator by 50 ms
139-
env.step(0.05)
138+
env.step(0.01)
139+
140+
return arrived
141+
142+
143+
def run():
144+
arrived = False
145+
while not arrived:
146+
arrived = step()
147+
148+
149+
step()
150+
151+
cProfile.run('run()')

roboticstoolbox/examples/swift_benchmark.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,3 @@ def stepper():
3232

3333

3434
cProfile.run('stepper()')
35-
36-
# r = rtb.models.Frankie()
37-
# r.q = r.qr
38-
39-
# for i in range(1000):
40-
# q = np.round(np.random.random(9), 2)
41-
# j1 = r.jacobe(q)
42-
# # j2 = r.jacobe_new(q)
43-
# j2 = r.jacobe(q, fast=True)
44-
45-
# print(np.round(j1, 2))
46-
# print(np.round(j2, 2))
47-
# print(q)
48-
# print()
49-
50-
# nt.assert_almost_equal(j1, j2)

roboticstoolbox/robot/ERobot.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,8 +2018,9 @@ def indiv_calculation(link, link_col, q):
20182018
d, wTlp, wTcp = link_col.closest_point(shape, di)
20192019

20202020
if d is not None:
2021-
lpTcp = wTlp.inv() * wTcp
2022-
norm = lpTcp.t / d
2021+
lpTcp = -wTlp[:3] + wTcp[:3]
2022+
2023+
norm = lpTcp / d
20232024
norm_h = np.expand_dims(np.r_[norm, 0, 0, 0], axis=0)
20242025

20252026
Je = self.jacobe(

0 commit comments

Comments
 (0)