9#ifndef CROCODDYL_CORE_SOLVERS_INTRO_HPP_ 10#define CROCODDYL_CORE_SOLVERS_INTRO_HPP_ 12#include "crocoddyl/core/solvers/fddp.hpp" 16template <
typename _Scalar>
19 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
22 typedef _Scalar Scalar;
26 typedef typename ShootingProblem::ActionModelAbstract ActionModelAbstract;
27 typedef typename ShootingProblem::ActionDataAbstract ActionDataAbstract;
29 typedef typename MathBase::VectorXs VectorXs;
30 typedef typename MathBase::MatrixXs MatrixXs;
31 typedef typename MathBase::MatrixXsRowMajor MatrixXsRowMajor;
41 const DynamicsSolverType dyn_solver = FeasShoot,
42 const EqualitySolverType eq_solver = LuNull,
43 const EqualitySolverType term_solver = LuNull);
77 const std::shared_ptr<ActionModelAbstract>& model)
override;
92 template <
typename NewScalar>
103 const std::vector<std::size_t>& get_Hu_rank()
const;
109 const std::vector<MatrixXs>& get_YZ()
const;
114 const std::vector<MatrixXs>& get_Qzz()
const;
119 const std::vector<MatrixXs>& get_Qxz()
const;
124 const std::vector<MatrixXs>& get_Quz()
const;
129 const std::vector<VectorXs>& get_Qz()
const;
135 const std::vector<MatrixXs>& get_Hy()
const;
141 const std::vector<VectorXs>& get_kz()
const;
146 const std::vector<MatrixXs>& get_Kz()
const;
151 const std::vector<VectorXs>& get_ks()
const;
156 const std::vector<MatrixXs>& get_Ks()
const;
161 const std::vector<MatrixXs>& get_Qzc()
const;
170 void set_equality_solver(
const EqualitySolverType
type);
185 using SolverAbstract::feasnorm_;
187 using SolverAbstract::th_gaptol_;
196 using SolverFDDP::Kc_;
199 using SolverFDDP::Quc_;
202 using SolverFDDP::Quuk_;
225 using SolverFDDP::Vxc_;
231 void calcLuNullDir();
232 void calcQrNullDir();
233 void computeNullPolicy(
const std::size_t t);
234 void computeNullBatchPolicy(
const std::size_t t);
235 void computeSchurPolicy(
const std::size_t t);
236 void computeSchurBatchPolicy(
const std::size_t t);
238 enum EqualitySolverType
241 std::vector<std::size_t>
243 std::vector<MatrixXsRowMajor> KQuu_2Qxu_;
244 std::vector<MatrixXs>
248 std::vector<MatrixXs>
251 std::vector<VectorXs>
253 std::vector<MatrixXs>
255 std::vector<MatrixXs>
257 std::vector<MatrixXs>
259 std::vector<VectorXs>
261 std::vector<MatrixXs>
263 std::vector<VectorXs>
265 std::vector<MatrixXs>
267 std::vector<MatrixXs> QuuinvHuT_;
268 std::vector<Eigen::LLT<MatrixXs> > Qzz_llt_;
269 std::vector<Eigen::FullPivLU<MatrixXs> >
272 std::vector<Eigen::ColPivHouseholderQR<MatrixXs> >
275 std::vector<Eigen::PartialPivLU<MatrixXs> >
279 std::vector<MatrixXs> Kcs_;
280 std::vector<MatrixXs> QuuKc_Quc_;
281 std::vector<MatrixXs>
290#include "crocoddyl/core/solvers/intro.hxx" This class encapsulates a shooting problem.
Abstract class for optimal control solvers.
std::vector< VectorXs > fs_
std::shared_ptr< ShootingProblem > problem_
std::vector< std::shared_ptr< CallbackAbstract > > callbacks_
std::vector< VectorXs > xs_
std::vector< VectorXs > us_
std::vector< Scalar > alphas_
virtual void resizeRunningData() override
Resize data associated with the running models of the shooting problem.
std::vector< MatrixXs > Vxx_
Scalar upsilon_decfactor_
DynamicsSolverType dyn_solver_
std::vector< VectorXs > Qx_
void allocateData()
Allocate all the internal data needed for the solver.
std::vector< MatrixXs > Qxx_
SolverFDDPTpl(std::shared_ptr< ShootingProblem > problem, const DynamicsSolverType dyn_solver=FeasShoot, const EqualitySolverType term_solver=LuNull)
Initialize the FDDP solver.
std::vector< MatrixXs > Qxu_
std::vector< MatrixXs > Quu_
std::vector< std::size_t > Ts_
std::vector< VectorXs > Vx_
std::vector< VectorXs > Qu_
virtual void resizeTerminalData() override
Resize data associated with the terminal model of the shooting problem.
std::vector< MatrixXsRowMajor > K_
EqualitySolverType term_solver_
std::vector< Eigen::LLT< MatrixXs > > Quu_llt_
std::vector< VectorXs > Vxx_f_
std::vector< VectorXs > k_
virtual void calcDir() override
Refresh the Intro linearization and constraint factorizations.
virtual void computeDirection(const bool recalc=true) override
Compute the search direction for the current guess .
SolverIntroTpl(std::shared_ptr< ShootingProblem > problem, const DynamicsSolverType dyn_solver=FeasShoot, const EqualitySolverType eq_solver=LuNull, const EqualitySolverType term_solver=LuNull)
Initialize the INTRO solver.
EqualitySolverType get_equality_solver() const
Return the type of solver used for handling the equality constraints.
virtual void computeBatchValueFunction(const std::size_t t) override
Compute the linear-quadratic approximation of the value function associated to the batch's constraint...
virtual void computePolicy(const std::size_t t) override
Compute the feedforward and feedback terms (control policy) computed via a Cholesky decomposition.
virtual void computeValueFunction(const std::size_t t, const std::shared_ptr< ActionModelAbstract > &model) override
Compute the linear-quadratic approximation of the value function.
SolverIntroTpl< NewScalar > cast() const
Cast the Intro solver to a different scalar type.
virtual void computeBatchPolicy(const std::size_t t) override
Compute the feedforward and feedback terms (control policy) associated to the batch's constraints.