aligator  0.9.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
expose-solvers-base.cpp
Go to the documentation of this file.
3
6
7namespace aligator {
8namespace python {
9
10/* fwd declarations */
11
12void exposeFDDP();
13void exposeProxDDP();
14
17 using context::Scalar;
18
19 using WorkspaceBase = WorkspaceBaseTpl<Scalar>;
20 bp::class_<WorkspaceBase, boost::noncopyable>(
21 "WorkspaceBase", "Base workspace struct.", bp::no_init)
22 .def_readonly("nsteps", &WorkspaceBase::nsteps)
23 .def_readonly("problem_data", &WorkspaceBase::problem_data)
24 .def_readonly("trial_xs", &WorkspaceBase::trial_xs)
25 .def_readonly("trial_us", &WorkspaceBase::trial_us)
26 .def_readonly("dyn_slacks", &WorkspaceBase::dyn_slacks,
27 "Expose dynamics' slack variables (e.g. feasibility gaps).")
28 .def("cycleLeft", &WorkspaceBase::cycleLeft, "self"_a,
29 "Cycle the workspace to the left: this will rotate all the data "
30 "(states, controls, multipliers) forward by one rank.")
31 .def("cycleAppend", &WorkspaceBase::cycleAppend, ("self"_a, "data"),
32 "Insert a StageData object and cycle the workspace left (using "
33 "`cycleLeft()`) and insert the allocated data (useful for MPC).");
34
35 using ResultsBase = ResultsBaseTpl<Scalar>;
36 bp::class_<ResultsBase>("ResultsBase", "Base results struct.", bp::no_init)
37 .def_readonly("num_iters", &ResultsBase::num_iters,
38 "Number of solver iterations.")
39 .def_readonly("conv", &ResultsBase::conv)
40 .def_readonly("gains", &ResultsBase::gains_)
41 .def_readonly("xs", &ResultsBase::xs)
42 .def_readonly("us", &ResultsBase::us)
43 .def_readonly("primal_infeas", &ResultsBase::prim_infeas)
44 .def_readonly("dual_infeas", &ResultsBase::dual_infeas)
45 .def_readonly("traj_cost", &ResultsBase::traj_cost_, "Trajectory cost.")
46 .def_readonly("merit_value", &ResultsBase::merit_value_,
47 "Merit function value.")
48 .def("controlFeedbacks", &ResultsBase::getCtrlFeedbacks, "self"_a,
49 "Get the control feedback matrices.")
50 .def("controlFeedforwards", &ResultsBase::getCtrlFeedforwards, "self"_a,
51 "Get the control feedforward gains.")
53}
54
60
61} // namespace python
62} // namespace aligator
void exposeSolverCommon()
Expose base solver elements.
void exposeSolvers()
Expose solvers.
Main package namespace.
Base workspace struct for the algorithms.
Definition fwd.hpp:119