robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
unconstr_intermediate_stage.hpp
Go to the documentation of this file.
1#ifndef ROBOTOC_UNCONSTR_INTERMEDIATE_STAGE_HPP_
2#define ROBOTOC_UNCONSTR_INTERMEDIATE_STAGE_HPP_
3
4#include <memory>
5
6#include "Eigen/Core"
7
23
24
25namespace robotoc {
26
32public:
40 const std::shared_ptr<CostFunction>& cost,
41 const std::shared_ptr<Constraints>& constraints);
42
47
52
57
62
67
71 UnconstrIntermediateStage& operator=(UnconstrIntermediateStage&&) noexcept = default;
72
77 UnconstrOCPData createData(const Robot& robot) const;
78
86 bool isFeasible(Robot& robot, const GridInfo& grid_info,
87 const SplitSolution& s, UnconstrOCPData& data) const;
88
96 void initConstraints(Robot& robot, const GridInfo& grid_info,
97 const SplitSolution& s, UnconstrOCPData& data) const;
98
108 void evalOCP(Robot& robot, const GridInfo& grid_info, const SplitSolution& s,
109 const SplitSolution& s_next, UnconstrOCPData& data,
110 SplitKKTResidual& kkt_residual) const;
111
122 void evalKKT(Robot& robot, const GridInfo& grid_info,
123 const SplitSolution& s, const SplitSolution& s_next,
124 UnconstrOCPData& data, SplitKKTMatrix& kkt_matrix,
125 SplitKKTResidual& kkt_residual) const;
126
136 void expandPrimalAndDual(const double dt, const SplitKKTMatrix& kkt_matrix,
137 const SplitKKTResidual& kkt_residual,
138 UnconstrOCPData& data, SplitDirection& d) const;
139
145 double maxPrimalStepSize(const UnconstrOCPData& data) const;
146
152 double maxDualStepSize(const UnconstrOCPData& data) const;
153
162 void updatePrimal(const Robot& robot, const double primal_step_size,
163 const SplitDirection& d, SplitSolution& s,
164 UnconstrOCPData& data) const;
165
171 void updateDual(const double dual_step_size, UnconstrOCPData& data) const;
172
173private:
174 std::shared_ptr<CostFunction> cost_;
175 std::shared_ptr<Constraints> constraints_;
176 ContactStatus contact_status_;
177};
178
179} // namespace robotoc
180
181#endif // ROBOTOC_UNCONSTR_INTERMEDIATE_STAGE_HPP_
Stack of the inequality constraints. Composed by constraint components that inherits ConstraintCompon...
Definition: constraints.hpp:30
Contact status of robot model.
Definition: contact_status.hpp:32
Stack of the cost function. Composed by cost function components that inherits CostFunctionComponentB...
Definition: cost_function.hpp:30
Dynamics and kinematics model of robots. Wraps pinocchio::Model and pinocchio::Data....
Definition: robot.hpp:32
Newton direction of the solution to the optimal control problem split into a time stage.
Definition: split_direction.hpp:20
The KKT matrix split into a time stage.
Definition: split_kkt_matrix.hpp:18
KKT residual split into each time stage.
Definition: split_kkt_residual.hpp:18
Solution to the optimal control problem split into a time stage.
Definition: split_solution.hpp:20
The intermediate stage of OCP computation for unconstrained rigid-body systems.
Definition: unconstr_intermediate_stage.hpp:31
void updateDual(const double dual_step_size, UnconstrOCPData &data) const
Updates dual variables of the inequality constraints.
UnconstrIntermediateStage()
Default constructor.
void expandPrimalAndDual(const double dt, const SplitKKTMatrix &kkt_matrix, const SplitKKTResidual &kkt_residual, UnconstrOCPData &data, SplitDirection &d) const
Expands the primal and dual variables, i.e., computes the Newton direction of the condensed variables...
void updatePrimal(const Robot &robot, const double primal_step_size, const SplitDirection &d, SplitSolution &s, UnconstrOCPData &data) const
Updates primal variables of this stage.
double maxDualStepSize(const UnconstrOCPData &data) const
Computes the maximum dual size.
UnconstrIntermediateStage & operator=(const UnconstrIntermediateStage &)=default
Default copy assign operator.
UnconstrIntermediateStage(const UnconstrIntermediateStage &)=default
Default copy constructor.
~UnconstrIntermediateStage()=default
Default destructor.
UnconstrIntermediateStage(UnconstrIntermediateStage &&) noexcept=default
Default move constructor.
void evalOCP(Robot &robot, const GridInfo &grid_info, const SplitSolution &s, const SplitSolution &s_next, UnconstrOCPData &data, SplitKKTResidual &kkt_residual) const
Computes the stage cost and constraint violation of this stage.
void initConstraints(Robot &robot, const GridInfo &grid_info, const SplitSolution &s, UnconstrOCPData &data) const
Initializes the constraints, i.e., set slack and dual variables.
double maxPrimalStepSize(const UnconstrOCPData &data) const
Computes the maximum primal step size.
UnconstrIntermediateStage(const Robot &robot, const std::shared_ptr< CostFunction > &cost, const std::shared_ptr< Constraints > &constraints)
Constructs a split optimal control problem.
UnconstrOCPData createData(const Robot &robot) const
Creates the data.
bool isFeasible(Robot &robot, const GridInfo &grid_info, const SplitSolution &s, UnconstrOCPData &data) const
Checks whether the solution is feasible under inequality constraints.
void evalKKT(Robot &robot, const GridInfo &grid_info, const SplitSolution &s, const SplitSolution &s_next, UnconstrOCPData &data, SplitKKTMatrix &kkt_matrix, SplitKKTResidual &kkt_residual) const
Computes the KKT matrix and residual of this stage.
Definition: constraint_component_base.hpp:17
Grid information.
Definition: grid_info.hpp:24
Data structure for the optimal control problem of unconstrained rigid-body systems.
Definition: unconstr_ocp_data.hpp:17