Skip to content

Commit 900b4ee

Browse files
committed
Merge pull request #277 from fabinsch/fix-examples
Fix `HistoryCallback` initialization in examples
2 parents df94254 + 614bdf4 commit 900b4ee

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
- Use Pinocchio instantiated functions ([#261](https://github.com/Simple-Robotics/aligator/pull/261))
1616
- Link to pinocchio collision
1717
- Some internal code now uses `TrajOptProblemTpl::initializeSolution()` to initialize state-control trajectories ([#274](https://github.com/Simple-Robotics/aligator/pull/274))
18+
- Fix `HistoryCallback` init in examples ([#277](https://github.com/Simple-Robotics/aligator/pull/277))
1819

1920
### Fixed
2021

examples/pendulum.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def create_pendulum(N, sincos=False):
177177
TOL = 1e-6
178178
MAX_ITER = 200
179179
solver = aligator.SolverProxDDP(TOL, mu_init, max_iters=MAX_ITER, verbose=verbose)
180-
callback = aligator.HistoryCallback()
180+
callback = aligator.HistoryCallback(solver)
181181
solver.registerCallback("his", callback)
182182

183183
u0 = pin.rnea(model, data, x0[:1], x0[1:], np.zeros(nv))
@@ -239,7 +239,7 @@ def create_pendulum(N, sincos=False):
239239
if len(prim_errs) != 0:
240240
plt.figure(figsize=(6.4, 4.8))
241241
prim_tols = np.array(callback.prim_tols.tolist())
242-
al_iters = np.array(callback.al_iters.tolist())
242+
al_iters = np.array(callback.al_index.tolist())
243243

244244
ax: plt.Axes = plt.subplot(111)
245245
plot_pd_errs(ax, prim_errs, dual_errs)

examples/ur5_table_halfspace.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def make_ee_residual():
107107
solver = aligator.SolverProxDDP(tol, mu_init, max_iters=max_iters, verbose=verbose)
108108
solver.rollout_type = aligator.ROLLOUT_NONLINEAR
109109
solver.setNumThreads(4)
110-
cb = aligator.HistoryCallback()
110+
cb = aligator.HistoryCallback(solver)
111111
solver.registerCallback("his", cb)
112112

113113
solver.setup(problem)

0 commit comments

Comments
 (0)