robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
robotoc::DirectMultipleShooting Class Reference

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...
 
DirectMultipleShootingoperator= (const DirectMultipleShooting &)=default
 Default copy assign operator. More...
 
 DirectMultipleShooting (DirectMultipleShooting &&) noexcept=default
 Default move constructor. More...
 
DirectMultipleShootingoperator= (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 PerformanceIndexgetEval () 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...
 

Detailed Description

Direct multiple shooting method of the optimal control problems.

Constructor & Destructor Documentation

◆ DirectMultipleShooting() [1/4]

robotoc::DirectMultipleShooting::DirectMultipleShooting ( const OCP ocp,
const int  nthreads 
)

Construct the direct multiple shooting method.

Parameters
[in]ocpOptimal control problem.
[in]nthreadsNumber of the threads of the parallel computations. Must be positive.

◆ DirectMultipleShooting() [2/4]

robotoc::DirectMultipleShooting::DirectMultipleShooting ( )

Default constructor.

◆ ~DirectMultipleShooting()

robotoc::DirectMultipleShooting::~DirectMultipleShooting ( )
default

Default destructor.

◆ DirectMultipleShooting() [3/4]

robotoc::DirectMultipleShooting::DirectMultipleShooting ( const DirectMultipleShooting )
default

Default copy constructor.

◆ DirectMultipleShooting() [4/4]

robotoc::DirectMultipleShooting::DirectMultipleShooting ( DirectMultipleShooting &&  )
defaultnoexcept

Default move constructor.

Member Function Documentation

◆ computeInitialStateDirection()

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.

Parameters
[in]robotRobot model.
[in]qInitial configuration.
[in]vInitial generalized velocity.
[in]sSolution.
[in,out]dDirection.

◆ computeStepSizes()

void robotoc::DirectMultipleShooting::computeStepSizes ( const TimeDiscretization time_discretization,
Direction d 
)

Computes the step sizes via the fraction-to-boundary-rule.

Parameters
[in]time_discretizationTime discretization.
[in,out]dDirection.

◆ evalKKT()

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.

Parameters
[in,out]robotsaligned_vector of Robot for paralle computing.
[in]time_discretizationTime discretization.
[in]qInitial configuration.
[in]vInitial generalized velocity.
[in]sSolution.
[in,out]kkt_matrixKKT matrix.
[in,out]kkt_residualKKT residual.

◆ evalOCP()

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.

Parameters
[in,out]robotsaligned_vector of Robot for paralle computing.
[in]time_discretizationTime discretization.
[in]qInitial configuration.
[in]vInitial generalized velocity.
[in]sSolution.
[in,out]kkt_residualKKT residual.

◆ getEval()

const PerformanceIndex & robotoc::DirectMultipleShooting::getEval ( ) const

Gets the performance index of the evaluation.

Returns
const reference to the performance index.

◆ initConstraints()

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.

Parameters
[in,out]robotsaligned_vector of Robot for paralle computing.
[in]time_discretizationTime discretization.
[in]sSolution.

◆ integratePrimalSolution()

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.

Parameters
[in,out]robotsaligned_vector of Robot for paralle computing.
[in]time_discretizationTime discretization.
[in]primal_step_sizePrimal step size.
[in]dDirection.
[in,out]sSolution.

◆ integrateSolution()

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.

Parameters
[in,out]robotsaligned_vector of Robot for paralle computing.
[in]time_discretizationTime discretization.
[in]primal_step_sizePrimal step size.
[in]dual_step_sizeDual step size.
[in,out]dDirection.
[in,out]sSolution.

◆ isFeasible()

bool robotoc::DirectMultipleShooting::isFeasible ( aligned_vector< Robot > &  robots,
const TimeDiscretization time_discretization,
const Solution s 
)

Checks whether the solution is feasible under inequality constraints.

Parameters
[in,out]robotsaligned_vector of Robot for paralle computing.
[in]time_discretizationTime discretization.
[in]sSolution.

◆ maxDualStepSize()

double robotoc::DirectMultipleShooting::maxDualStepSize ( ) const

Gets the maximum dual step size of the fraction-to-boundary-rule.

Returns
The dual step size of the fraction-to-boundary-rule.

◆ maxPrimalStepSize()

double robotoc::DirectMultipleShooting::maxPrimalStepSize ( ) const

Gets the maximum primal step size of the fraction-to-boundary-rule.

Returns
The primal step size of the fraction-to-boundary-rule.

◆ operator=() [1/2]

DirectMultipleShooting & robotoc::DirectMultipleShooting::operator= ( const DirectMultipleShooting )
default

Default copy assign operator.

◆ operator=() [2/2]

DirectMultipleShooting & robotoc::DirectMultipleShooting::operator= ( DirectMultipleShooting &&  )
defaultnoexcept

Default move assign operator.

◆ resizeData()

void robotoc::DirectMultipleShooting::resizeData ( const TimeDiscretization time_discretization)

Resizes the internal data.

Parameters
[in]time_discretizationTime discretization.

◆ setNumThreads()

void robotoc::DirectMultipleShooting::setNumThreads ( const int  nthreads)

Sets the number of threads of the parallel computations.

Parameters
[in]nthreadsNumber of the threads of the parallel computations. Must be positive.

The documentation for this class was generated from the following file: