1#ifndef ROBOTOC_UNCONSTR_BACKWARD_CORRECTION_HPP_
2#define ROBOTOC_UNCONSTR_BACKWARD_CORRECTION_HPP_
90 const std::vector<
GridInfo>& time_discretization,
101 const std::vector<
GridInfo>& time_discretization,
114 const std::vector<
GridInfo>& time_discretization,
115 const Eigen::VectorXd& q, const Eigen::VectorXd& v,
129 const std::vector<
GridInfo>& time_discretization,
130 const Eigen::VectorXd& q, const Eigen::VectorXd& v,
146 const std::vector<
GridInfo>& time_discretization,
147 const Eigen::VectorXd& q, const Eigen::VectorXd& v,
181 return performance_index_;
194 const std::vector<GridInfo>& time_discretization,
195 const double primal_step_size,
207 const std::vector<GridInfo>& time_discretization,
208 const double primal_step_size,
220 std::vector<Eigen::MatrixXd> aux_mat_;
221 Eigen::VectorXd primal_step_sizes_, dual_step_sizes_;
The terminal stage of ParNMPC for unconstrained rigid-body systems.
Definition: parnmpc_terminal_stage.hpp:28
Dynamics and kinematics model of robots. Wraps pinocchio::Model and pinocchio::Data....
Definition: robot.hpp:32
Backward correction for optimal control problems of unconstrained rigid-body systems.
Definition: unconstr_backward_correction.hpp:33
double dualStepSize() const
Gets the maximum dual step size of the fraction-to-boundary-rule.
void initConstraints(aligned_vector< Robot > &robots, const std::vector< GridInfo > &time_discretization, const Solution &s)
Computes the cost and constraint violations.
UnconstrBackwardCorrection(const OCP &ocp, const int nthreads)
Construct a backward correction.
UnconstrBackwardCorrection()
Default constructor.
void setNumThreads(const int nthreads)
Sets the number of threads of the parallel computations.
UnconstrBackwardCorrection & operator=(const UnconstrBackwardCorrection &)=default
Default copy operator.
double primalStepSize() const
Gets the maximum primal step size of the fraction-to-boundary-rule.
void coarseUpdate(aligned_vector< Robot > &robots, const std::vector< GridInfo > &time_discretization, const Eigen::VectorXd &q, const Eigen::VectorXd &v, const Solution &s, KKTMatrix &kkt_matrix, KKTResidual &kkt_residual)
Eval KKT and coarse updates the solution leveraging the parallel computation.
UnconstrBackwardCorrection(UnconstrBackwardCorrection &&) noexcept=default
Default move constructor.
UnconstrBackwardCorrection(const UnconstrBackwardCorrection &)=default
Default copy constructor.
~UnconstrBackwardCorrection()=default
Destructor.
void integratePrimalSolution(const aligned_vector< Robot > &robots, const std::vector< GridInfo > &time_discretization, const double primal_step_size, const Direction &d, Solution &s)
Integrates the solution.
const PerformanceIndex & getEval() const
Gets the performance index of the evaluation.
Definition: unconstr_backward_correction.hpp:180
void integrateSolution(const aligned_vector< Robot > &robots, const std::vector< GridInfo > &time_discretization, const double primal_step_size, const double dual_step_size, Direction &d, Solution &s)
Integrates the solution.
void initAuxMat(aligned_vector< Robot > &robots, const std::vector< GridInfo > &time_discretization, const Solution &s, KKTMatrix &kkt_matrix, KKTResidual &kkt_residual)
Initializes the auxiliary matrices by the terminal cost Hessian computed by the current solution.
void evalKKT(aligned_vector< Robot > &robots, const std::vector< GridInfo > &time_discretization, const Eigen::VectorXd &q, const Eigen::VectorXd &v, const Solution &s, KKTMatrix &kkt_matrix, KKTResidual &kkt_residual)
Computes the KKT residual and matrix.
void backwardCorrection(const std::vector< GridInfo > &time_discretization, const Solution &s, const KKTMatrix &kkt_matrix, const KKTResidual &kkt_residual, Direction &d)
Performs the backward correction for coarse updated solution and computes the Newton direction.
void evalOCP(aligned_vector< Robot > &robots, const std::vector< GridInfo > &time_discretization, const Eigen::VectorXd &q, const Eigen::VectorXd &v, const Solution &s, KKTResidual &kkt_residual)
Computes the cost and constraint violations.
Definition: constraint_component_base.hpp:17
aligned_vector< SplitKKTMatrix > KKTMatrix
The KKT matrix of the optimal control problem.
Definition: kkt_matrix.hpp:16
aligned_vector< SplitSolution > Solution
Solution to the optimal control problem.
Definition: solution.hpp:16
aligned_vector< SplitDirection > Direction
Newton direction of the solution to the optimal control problem.
Definition: direction.hpp:16
std::vector< T, Eigen::aligned_allocator< T > > aligned_vector
std vector with Eigen::aligned_allocator.
Definition: aligned_vector.hpp:14
aligned_vector< SplitKKTResidual > KKTResidual
The KKT residual of the optimal control problem.
Definition: kkt_residual.hpp:16
Grid information.
Definition: grid_info.hpp:24
The optimal control problem.
Definition: ocp.hpp:22