robotoc
robotoc - efficient ROBOT Optimal Control solvers
|
Direct multiple shooting method of the optimal control problems. More...
#include <direct_multiple_shooting.hpp>
Public Member Functions | |
DirectMultipleShooting (const OCP &ocp, const int nthreads) | |
Construct the direct multiple shooting method. More... | |
DirectMultipleShooting () | |
Default constructor. More... | |
~DirectMultipleShooting ()=default | |
Default destructor. More... | |
DirectMultipleShooting (const DirectMultipleShooting &)=default | |
Default copy constructor. More... | |
DirectMultipleShooting & | operator= (const DirectMultipleShooting &)=default |
Default copy assign operator. More... | |
DirectMultipleShooting (DirectMultipleShooting &&) noexcept=default | |
Default move constructor. More... | |
DirectMultipleShooting & | operator= (DirectMultipleShooting &&) noexcept=default |
Default move assign operator. More... | |
void | setNumThreads (const int nthreads) |
Sets the number of threads of the parallel computations. More... | |
void | initConstraints (aligned_vector< Robot > &robots, const TimeDiscretization &time_discretization, const Solution &s) |
Initializes the priaml-dual interior point method for inequality constraints. More... | |
bool | isFeasible (aligned_vector< Robot > &robots, const TimeDiscretization &time_discretization, const Solution &s) |
Checks whether the solution is feasible under inequality constraints. More... | |
void | evalOCP (aligned_vector< Robot > &robots, const TimeDiscretization &time_discretization, const Eigen::VectorXd &q, const Eigen::VectorXd &v, const Solution &s, KKTResidual &kkt_residual) |
Computes the cost and constraint violations. More... | |
void | evalKKT (aligned_vector< Robot > &robots, const TimeDiscretization &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. More... | |
void | computeInitialStateDirection (const Robot &robot, const Eigen::VectorXd &q, const Eigen::VectorXd &v, const Solution &s, Direction &d) const |
Computes the initial state direction. More... | |
const PerformanceIndex & | getEval () const |
Gets the performance index of the evaluation. More... | |
void | computeStepSizes (const TimeDiscretization &time_discretization, Direction &d) |
Computes the step sizes via the fraction-to-boundary-rule. More... | |
double | maxPrimalStepSize () const |
Gets the maximum primal step size of the fraction-to-boundary-rule. More... | |
double | maxDualStepSize () const |
Gets the maximum dual step size of the fraction-to-boundary-rule. More... | |
void | integrateSolution (const aligned_vector< Robot > &robots, const TimeDiscretization &time_discretization, const double primal_step_size, const double dual_step_size, Direction &d, Solution &s) |
Integrates the solution. More... | |
void | integratePrimalSolution (const aligned_vector< Robot > &robots, const TimeDiscretization &time_discretization, const double primal_step_size, const Direction &d, Solution &s) |
Integrates the primal solution. More... | |
void | resizeData (const TimeDiscretization &time_discretization) |
Resizes the internal data. More... | |
Direct multiple shooting method of the optimal control problems.
robotoc::DirectMultipleShooting::DirectMultipleShooting | ( | const OCP & | ocp, |
const int | nthreads | ||
) |
Construct the direct multiple shooting method.
[in] | ocp | Optimal control problem. |
[in] | nthreads | Number of the threads of the parallel computations. Must be positive. |
robotoc::DirectMultipleShooting::DirectMultipleShooting | ( | ) |
Default constructor.
|
default |
Default destructor.
|
default |
Default copy constructor.
|
defaultnoexcept |
Default move constructor.
void robotoc::DirectMultipleShooting::computeInitialStateDirection | ( | const Robot & | robot, |
const Eigen::VectorXd & | q, | ||
const Eigen::VectorXd & | v, | ||
const Solution & | s, | ||
Direction & | d | ||
) | const |
Computes the initial state direction.
[in] | robot | Robot model. |
[in] | q | Initial configuration. |
[in] | v | Initial generalized velocity. |
[in] | s | Solution. |
[in,out] | d | Direction. |
void robotoc::DirectMultipleShooting::computeStepSizes | ( | const TimeDiscretization & | time_discretization, |
Direction & | d | ||
) |
Computes the step sizes via the fraction-to-boundary-rule.
[in] | time_discretization | Time discretization. |
[in,out] | d | Direction. |
void robotoc::DirectMultipleShooting::evalKKT | ( | aligned_vector< Robot > & | robots, |
const TimeDiscretization & | 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.
[in,out] | robots | aligned_vector of Robot for paralle computing. |
[in] | time_discretization | Time discretization. |
[in] | q | Initial configuration. |
[in] | v | Initial generalized velocity. |
[in] | s | Solution. |
[in,out] | kkt_matrix | KKT matrix. |
[in,out] | kkt_residual | KKT residual. |
void robotoc::DirectMultipleShooting::evalOCP | ( | aligned_vector< Robot > & | robots, |
const TimeDiscretization & | time_discretization, | ||
const Eigen::VectorXd & | q, | ||
const Eigen::VectorXd & | v, | ||
const Solution & | s, | ||
KKTResidual & | kkt_residual | ||
) |
Computes the cost and constraint violations.
[in,out] | robots | aligned_vector of Robot for paralle computing. |
[in] | time_discretization | Time discretization. |
[in] | q | Initial configuration. |
[in] | v | Initial generalized velocity. |
[in] | s | Solution. |
[in,out] | kkt_residual | KKT residual. |
const PerformanceIndex & robotoc::DirectMultipleShooting::getEval | ( | ) | const |
Gets the performance index of the evaluation.
void robotoc::DirectMultipleShooting::initConstraints | ( | aligned_vector< Robot > & | robots, |
const TimeDiscretization & | time_discretization, | ||
const Solution & | s | ||
) |
Initializes the priaml-dual interior point method for inequality constraints.
[in,out] | robots | aligned_vector of Robot for paralle computing. |
[in] | time_discretization | Time discretization. |
[in] | s | Solution. |
void robotoc::DirectMultipleShooting::integratePrimalSolution | ( | const aligned_vector< Robot > & | robots, |
const TimeDiscretization & | time_discretization, | ||
const double | primal_step_size, | ||
const Direction & | d, | ||
Solution & | s | ||
) |
Integrates the primal solution.
[in,out] | robots | aligned_vector of Robot for paralle computing. |
[in] | time_discretization | Time discretization. |
[in] | primal_step_size | Primal step size. |
[in] | d | Direction. |
[in,out] | s | Solution. |
void robotoc::DirectMultipleShooting::integrateSolution | ( | const aligned_vector< Robot > & | robots, |
const TimeDiscretization & | time_discretization, | ||
const double | primal_step_size, | ||
const double | dual_step_size, | ||
Direction & | d, | ||
Solution & | s | ||
) |
Integrates the solution.
[in,out] | robots | aligned_vector of Robot for paralle computing. |
[in] | time_discretization | Time discretization. |
[in] | primal_step_size | Primal step size. |
[in] | dual_step_size | Dual step size. |
[in,out] | d | Direction. |
[in,out] | s | Solution. |
bool robotoc::DirectMultipleShooting::isFeasible | ( | aligned_vector< Robot > & | robots, |
const TimeDiscretization & | time_discretization, | ||
const Solution & | s | ||
) |
Checks whether the solution is feasible under inequality constraints.
[in,out] | robots | aligned_vector of Robot for paralle computing. |
[in] | time_discretization | Time discretization. |
[in] | s | Solution. |
double robotoc::DirectMultipleShooting::maxDualStepSize | ( | ) | const |
Gets the maximum dual step size of the fraction-to-boundary-rule.
double robotoc::DirectMultipleShooting::maxPrimalStepSize | ( | ) | const |
Gets the maximum primal step size of the fraction-to-boundary-rule.
|
default |
Default copy assign operator.
|
defaultnoexcept |
Default move assign operator.
void robotoc::DirectMultipleShooting::resizeData | ( | const TimeDiscretization & | time_discretization | ) |
Resizes the internal data.
[in] | time_discretization | Time discretization. |
void robotoc::DirectMultipleShooting::setNumThreads | ( | const int | nthreads | ) |
Sets the number of threads of the parallel computations.
[in] | nthreads | Number of the threads of the parallel computations. Must be positive. |