|
12 | 12 | env.launch() |
13 | 13 |
|
14 | 14 |
|
15 | | -panda = rtb.models.Panda() |
16 | | -panda.q = panda.qr |
17 | | -env.add(panda, show_robot=True) |
| 15 | +# panda = rtb.models.Panda() |
| 16 | +# panda.q = panda.qr |
| 17 | +# env.add(panda, show_robot=True) |
18 | 18 |
|
19 | 19 |
|
20 | | -ev = [0.01, 0, 0, 0, 0, 0] |
21 | | -panda.qd = np.linalg.pinv(panda.jacobe(panda.q, fast=True)) @ ev |
22 | | -env.step(0.001) |
| 20 | +# ev = [0.01, 0, 0, 0, 0, 0] |
| 21 | +# panda.qd = np.linalg.pinv(panda.jacobe(panda.q, fast=True)) @ ev |
| 22 | +# env.step(0.001) |
23 | 23 |
|
24 | 24 |
|
25 | | -def stepper(): |
26 | | - for i in range(10000): |
27 | | - panda.qd = np.linalg.pinv(panda.jacob0(panda.q, fast=True)) @ ev |
28 | | - # panda.jacob0(panda.q, fast=True) |
| 25 | +# def stepper(): |
| 26 | +# for i in range(10000): |
| 27 | +# panda.qd = np.linalg.pinv(panda.jacob0(panda.q, fast=True)) @ ev |
| 28 | +# # panda.jacob0(panda.q, fast=True) |
| 29 | + |
| 30 | +# # panda.fkine_all_fast(panda.q) |
| 31 | +# env.step(0.001) |
| 32 | + |
29 | 33 |
|
30 | | - # panda.fkine_all_fast(panda.q) |
31 | | - env.step(0.001) |
| 34 | +import spatialgeometry as sg |
| 35 | +import spatialmath as sm |
32 | 36 |
|
| 37 | +b1 = sg.Box(scale=[0.2, 0.1, 0.2], base=sm.SE3(1.0, 1, 1)) |
| 38 | +b2 = sg.Cylinder(radius=0.2, length=0.8, base=sm.SE3(0.0, 1, 1)) |
| 39 | + |
| 40 | +env.add(b1) |
| 41 | +env.add(b2) |
| 42 | + |
| 43 | +def stepper(): |
| 44 | + for i in range(100000): |
| 45 | + a, b, c = b1.closest_point(b2, inf_dist=4.0, homogenous=False) |
33 | 46 |
|
| 47 | +a, b, c = b1.closest_point(b2, inf_dist=4.0, homogenous=False) |
34 | 48 | cProfile.run("stepper()") |
0 commit comments