robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
switching_time_optimization.hpp
Go to the documentation of this file.
1#ifndef ROBOTOC_SWITCHING_TIME_OPTIMIZATION_HPP_
2#define ROBOTOC_SWITCHING_TIME_OPTIMIZATION_HPP_
3
4#include <memory>
5
6#include "Eigen/Core"
7
8#include "robotoc/ocp/ocp.hpp"
16
17
18namespace robotoc {
19
25public:
31
36
41
46
51
56
60 SwitchingTimeOptimization& operator=(SwitchingTimeOptimization&&) noexcept = default;
61
66 void setRegularization(const double sto_reg);
67
73 void initConstraints(const TimeDiscretization& time_discretization);
74
79 bool isFeasible(const TimeDiscretization& time_discretization);
80
85 void evalSTO(const TimeDiscretization& time_discretization);
86
93 void evalKKT(const TimeDiscretization& time_discretization,
94 KKTMatrix& kkt_matrix, KKTResidual& kkt_residual);
95
100 const PerformanceIndex& getEval() const;
101
107 void computeStepSizes(const TimeDiscretization& time_discretization,
108 const Direction& d);
109
114 double maxPrimalStepSize() const;
115
120 double maxDualStepSize() const;
121
129 void integrateSolution(const TimeDiscretization& time_discretization,
130 const double primal_step_size,
131 const double dual_step_size, const Direction& d);
132
133private:
134 std::shared_ptr<STOCostFunction> sto_cost_;
135 std::shared_ptr<STOConstraints> sto_constraints_;
136 std::shared_ptr<ContactSequence> contact_sequence_;
137 double sto_reg_;
138 bool is_sto_enabled_;
139 PerformanceIndex performance_index_;
140 Eigen::VectorXd lt_, h_, dts_;
141 Eigen::MatrixXd Qtt_;
142 ConstraintComponentData constraint_data_;
143};
144
145} // namespace robotoc
146
147#endif // ROBOTOC_SWITCHING_TIME_OPTIMIZATION_HPP_
Data used in constraint components. Composed by slack, dual (Lagrange multiplier),...
Definition: constraint_component_data.hpp:17
The sequence of contact status and discrete events (impact and lift).
Definition: contact_sequence.hpp:23
Constraints of the switching time optimization problems.
Definition: sto_constraints.hpp:23
Stack of the cost function of the switching time optimization (STO) problem. Composed by cost functio...
Definition: sto_cost_function.hpp:24
The switching time optimization (STO) problem.
Definition: switching_time_optimization.hpp:24
SwitchingTimeOptimization(SwitchingTimeOptimization &&) noexcept=default
Default move constructor.
double maxDualStepSize() const
Gets the maximum dual step size of the fraction-to-boundary-rule.
void evalKKT(const TimeDiscretization &time_discretization, KKTMatrix &kkt_matrix, KKTResidual &kkt_residual)
Computes the KKT residual and matrix.
double maxPrimalStepSize() const
Gets the maximum primal step size of the fraction-to-boundary-rule.
void setRegularization(const double sto_reg)
Sets the regularization paremeter on the STO problem.
const PerformanceIndex & getEval() const
Gets the performance index of the evaluation.
void computeStepSizes(const TimeDiscretization &time_discretization, const Direction &d)
Computes the step sizes via the fraction-to-boundary-rule.
~SwitchingTimeOptimization()=default
Default destructor.
void initConstraints(const TimeDiscretization &time_discretization)
Initializes the priaml-dual interior point method for inequality constraints.
void integrateSolution(const TimeDiscretization &time_discretization, const double primal_step_size, const double dual_step_size, const Direction &d)
Computes the initial state direction.
SwitchingTimeOptimization(const SwitchingTimeOptimization &)=default
Default copy constructor.
SwitchingTimeOptimization(const OCP &ocp)
Construct the STO problem.
SwitchingTimeOptimization()
Default constructor.
void evalSTO(const TimeDiscretization &time_discretization)
Computes the cost and constraint violations.
SwitchingTimeOptimization & operator=(const SwitchingTimeOptimization &)=default
Default copy assign operator.
bool isFeasible(const TimeDiscretization &time_discretization)
Checks whether the solution is feasible under inequality constraints.
Time discretization of the optimal control problem.
Definition: time_discretization.hpp:20
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< SplitDirection > Direction
Newton direction of the solution to the optimal control problem.
Definition: direction.hpp:16
aligned_vector< SplitKKTResidual > KKTResidual
The KKT residual of the optimal control problem.
Definition: kkt_residual.hpp:16
The optimal control problem.
Definition: ocp.hpp:22
Performance index of optimal control problems.
Definition: performance_index.hpp:13