aligator  0.16.0
A versatile and efficient C++ library for real-time constrained trajectory optimization.
Loading...
Searching...
No Matches
proximal-riccati.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include "riccati-base.hpp"
5#include "riccati-kernel.hpp"
6
7namespace aligator {
8namespace gar {
9
11template <typename _Scalar>
13public:
14 using Scalar = _Scalar;
18
21 using CostToGo = typename StageFactorType::CostToGo;
22 using kkt0_t = typename Kernel::kkt0_t;
24
26
28 bool backward(const Scalar mueq);
29
30 bool forward(std::vector<VectorXs> &xs, std::vector<VectorXs> &us,
31 std::vector<VectorXs> &vs, std::vector<VectorXs> &lbdas,
32 const std::optional<ConstVectorRef> &theta = std::nullopt) const;
33
34 void cycleAppend(const KnotType &knot);
35 VectorRef getFeedforward(size_t i) { return datas[i].ff.matrix(); }
36 RowMatrixRef getFeedback(size_t i) { return datas[i].fb.matrix(); }
37
38 allocator_type get_allocator() const { return problem_->get_allocator(); }
39
40 std::pmr::vector<StageFactor<Scalar>> datas;
41 kkt0_t kkt0; //< initial stage KKT system
42 ArenaMatrix<VectorXs> thGrad; //< optimal value gradient wrt parameter
43 ArenaMatrix<MatrixXs> thHess; //< optimal value Hessian wrt parameter
44
45protected:
47};
48
49template <typename Scalar>
52
53#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
54extern template class ProximalRiccatiSolver<context::Scalar>;
55#endif
56
57} // namespace gar
58} // namespace aligator
A Riccati-like solver for the proximal LQ subproblem in ProxDDP.
ProximalRiccatiKernel< Scalar > Kernel
typename StageFactorType::CostToGo CostToGo
void cycleAppend(const KnotType &knot)
Cycle the solver data, given the specs from a given new knot.
typename Kernel::StageFactorType StageFactorType
bool forward(std::vector< VectorXs > &xs, std::vector< VectorXs > &us, std::vector< VectorXs > &vs, std::vector< VectorXs > &lbdas, const std::optional< ConstVectorRef > &theta=std::nullopt) const
std::pmr::vector< StageFactor< Scalar > > datas
::aligator::polymorphic_allocator allocator_type
bool backward(const Scalar mueq)
Backward sweep.
ProximalRiccatiSolver(const LqrProblemTpl< Scalar > &problem)
A convenience subclass of std::pmr::polymorphic_allocator for bytes.
Definition allocator.hpp:16
ProximalRiccatiSolver(const LqrProblemTpl< Scalar > &) -> ProximalRiccatiSolver< Scalar >
Main package namespace.
Struct describing a stage of a constrained LQ problem.
Kernel for use in Riccati-like algorithms for the proximal LQ subproblem.