10000 CHOMP parameters · hzyjerry/robotics-toolbox-python@f689b0c · GitHub
[go: up one dir, main page]

Skip to content

Commit f689b0c

Browse files
committed
CHOMP parameters
1 parent 30ec712 commit f689b0c

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

roboticstoolbox/examples/chomp.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868

6969
# import pdb; pdb.set_trace()
7070

71-
lmbda = 1
72-
eta = 1
71+
lmbda = 1000
72+
eta = 1000
7373
iters = 4
7474
# import pdb; pdb.set_trace()
7575

@@ -114,10 +114,9 @@
114114
# for link in robot.links:
115115
xyz = xx.data[0][:3, -1]
116116
cost = np.sum(xyz)
117-
# print(i, qt, qe)
118117
total_cost += cost
119-
# delta := gradient of obstacle cost in work space, (6, cdim)
120-
delta = np.concatenate([[1, 1, 0], np.zeros(3)])
118+
# delta := negative gradient of obstacle cost in work space, (6, cdim)
119+
delta = -1 * np.concatenate([[1, 1, 0], np.zeros(3)])
121120

122121
# if t == 0:
123122
# print(JJ.T.dot(vel).dot(prj.dot(delta) - cost * kappa))
@@ -126,8 +125,8 @@
126125
nabla_obs[cdim * i: cdim * i + k + 1] += JJ.T.dot(vel).dot(prj.dot(delta) - cost * kappa)
127126
except:
128127
import pdb; pdb.set_trace()
129-
dxi = Ainv.dot(lmbda * nabla_smooth)
130-
# dxi = Ainv.dot(nabla_obs + lmbda * nabla_smooth)
128+
# dxi = Ainv.dot(lmbda * nabla_smooth)
129+
dxi = Ainv.dot(nabla_obs + lmbda * nabla_smooth)
131130
xi -= dxi / eta
132131
print(f"Iteration {t} total cost {total_cost}")
133132

0 commit comments

Comments
 (0)
0