robotoc
robotoc - efficient ROBOT Optimal Control solvers
|
Direct multiple shooting method of optimal control problems of unconstrained rigid-body systems. More...
#include <unconstr_direct_multiple_shooting.hpp>
Public Member Functions | |
UnconstrDirectMultipleShooting (const OCP &ocp, const int nthreads=1) | |
Construct the direct multiple shooting method. More... | |
UnconstrDirectMultipleShooting () | |
Default constructor. More... | |
~UnconstrDirectMultipleShooting ()=default | |
Destructor. More... | |
UnconstrDirectMultipleShooting (const UnconstrDirectMultipleShooting &)=default | |
Default copy constructor. More... | |
UnconstrDirectMultipleShooting & | operator= (const UnconstrDirectMultipleShooting &)=default |
Default copy assign operator. More... | |
UnconstrDirectMultipleShooting (UnconstrDirectMultipleShooting &&) noexcept=default | |
Default move constructor. More... | |
UnconstrDirectMultipleShooting & | operator= (UnconstrDirectMultipleShooting &&) 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 std::vector< GridInfo > &time_discretization, const Solution &s) |
Initializes the priaml-dual interior point method for inequality constraints. More... | |
bool | isFeasible (aligned_vector< Robot > &robots, const std::vector< GridInfo > &time_discretization, const Solution &s) |
Checks whether the solution is feasible under inequality constraints. More... | |
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. More... | |
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. More... | |
const PerformanceIndex & | getEval () const |
Gets the performance index of the evaluation. More... | |
void | computeStepSizes (const std::vector< GridInfo > &time_discretization, KKTMatrix &kkt_matrix, KKTResidual &kkt_residual, 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 std::vector< GridInfo > &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 std::vector< GridInfo > &time_discretization, const double primal_step_size, const Direction &d, Solution &s) |
Integrates the primal solution. More... | |
Static Public Member Functions | |
static void | computeInitialStateDirection (const Eigen::VectorXd &q, const Eigen::VectorXd &v, const Solution &s, Direction &d) |
Computes the initial state direction. More... | |
Direct multiple shooting method of optimal control problems of unconstrained rigid-body systems.
robotoc::UnconstrDirectMultipleShooting::UnconstrDirectMultipleShooting | ( | const OCP & | ocp, |
const int | nthreads = 1 |
||
) |
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::UnconstrDirectMultipleShooting::UnconstrDirectMultipleShooting | ( | ) |
Default constructor.
|
default |
Destructor.
|
default |
Default copy constructor.
|
defaultnoexcept |
Default move constructor.
|
static |
Computes the initial state direction.
[in] | q | Initial configuration. |
[in] | v | Initial generalized velocity. |
[in] | s | Solution. |
[in,out] | d | Direction. |
void robotoc::UnconstrDirectMultipleShooting::computeStepSizes | ( | const std::vector< GridInfo > & | time_discretization, |
KKTMatrix & | kkt_matrix, | ||
KKTResidual & | kkt_residual, | ||
Direction & | d | ||
) |
Computes the step sizes via the fraction-to-boundary-rule.
[in] | time_discretization | Time discretization. |
[in,out] | kkt_matrix | KKT matrix. |
[in,out] | kkt_residual | KKT residual. |
[in,out] | d | Direction. |
void robotoc::UnconstrDirectMultipleShooting::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.
[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::UnconstrDirectMultipleShooting::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.
[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::UnconstrDirectMultipleShooting::getEval | ( | ) | const |
Gets the performance index of the evaluation.
void robotoc::UnconstrDirectMultipleShooting::initConstraints | ( | aligned_vector< Robot > & | robots, |
const std::vector< GridInfo > & | 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::UnconstrDirectMultipleShooting::integratePrimalSolution | ( | const aligned_vector< Robot > & | robots, |
const std::vector< GridInfo > & | 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::UnconstrDirectMultipleShooting::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.
[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::UnconstrDirectMultipleShooting::isFeasible | ( | aligned_vector< Robot > & | robots, |
const std::vector< GridInfo > & | 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::UnconstrDirectMultipleShooting::maxDualStepSize | ( | ) | const |
Gets the maximum dual step size of the fraction-to-boundary-rule.
double robotoc::UnconstrDirectMultipleShooting::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::UnconstrDirectMultipleShooting::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. |