Skip to content

Fix HistoryCallback initialization in examples #277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Use Pinocchio instantiated functions ([#261](https://github.com/Simple-Robotics/aligator/pull/261))
- Link to pinocchio collision
- Some internal code now uses `TrajOptProblemTpl::initializeSolution()` to initialize state-control trajectories ([#274](https://github.com/Simple-Robotics/aligator/pull/274))
- Fix `HistoryCallback` init in examples ([#277](https://github.com/Simple-Robotics/aligator/pull/277))

### Fixed

Expand Down
4 changes: 2 additions & 2 deletions examples/pendulum.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def create_pendulum(N, sincos=False):
TOL = 1e-6
MAX_ITER = 200
solver = aligator.SolverProxDDP(TOL, mu_init, max_iters=MAX_ITER, verbose=verbose)
callback = aligator.HistoryCallback()
callback = aligator.HistoryCallback(solver)
solver.registerCallback("his", callback)

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

ax: plt.Axes = plt.subplot(111)
plot_pd_errs(ax, prim_errs, dual_errs)
Expand Down
2 changes: 1 addition & 1 deletion examples/ur5_table_halfspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def make_ee_residual():
solver = aligator.SolverProxDDP(tol, mu_init, max_iters=max_iters, verbose=verbose)
solver.rollout_type = aligator.ROLLOUT_NONLINEAR
solver.setNumThreads(4)
cb = aligator.HistoryCallback()
cb = aligator.HistoryCallback(solver)
solver.registerCallback("his", cb)

solver.setup(problem)
Expand Down
Loading