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

Backward correction for optimal control problems of unconstrained rigid-body systems. More...

#include <unconstr_backward_correction.hpp>

Public Member Functions

 UnconstrBackwardCorrection (const OCP &ocp, const int nthreads)
 Construct a backward correction. More...
 
 UnconstrBackwardCorrection ()
 Default constructor. More...
 
 ~UnconstrBackwardCorrection ()=default
 Destructor. More...
 
 UnconstrBackwardCorrection (const UnconstrBackwardCorrection &)=default
 Default copy constructor. More...
 
UnconstrBackwardCorrectionoperator= (const UnconstrBackwardCorrection &)=default
 Default copy operator. More...
 
 UnconstrBackwardCorrection (UnconstrBackwardCorrection &&) noexcept=default
 Default move constructor. More...
 
UnconstrBackwardCorrectionoperator= (UnconstrBackwardCorrection &&) noexcept=default
 Default move assign operator. More...
 
void setNumThreads (const int nthreads)
 Sets the number of threads of the parallel computations. More...
 
void initAuxMat (aligned_vector< Robot > &robots, const std::vector< GridInfo > &time_discretization, const Solution &s, KKTMatrix &kkt_matrix, KKTResidual &kkt_residual)
 Initializes the auxiliary matrices by the terminal cost Hessian computed by the current solution. More...
 
void initConstraints (aligned_vector< Robot > &robots, const std::vector< GridInfo > &time_discretization, const Solution &s)
 Computes the cost and constraint violations. 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...
 
void coarseUpdate (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)
 Eval KKT and coarse updates the solution leveraging the parallel computation. More...
 
void backwardCorrection (const std::vector< GridInfo > &time_discretization, const Solution &s, const KKTMatrix &kkt_matrix, const KKTResidual &kkt_residual, Direction &d)
 Performs the backward correction for coarse updated solution and computes the Newton direction. More...
 
double primalStepSize () const
 Gets the maximum primal step size of the fraction-to-boundary-rule. More...
 
double dualStepSize () const
 Gets the maximum dual step size of the fraction-to-boundary-rule. More...
 
const PerformanceIndexgetEval () const
 Gets the performance index of the evaluation. 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 solution. More...
 

Detailed Description

Backward correction for optimal control problems of unconstrained rigid-body systems.

Constructor & Destructor Documentation

◆ UnconstrBackwardCorrection() [1/4]

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

Construct a backward correction.

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

◆ UnconstrBackwardCorrection() [2/4]

robotoc::UnconstrBackwardCorrection::UnconstrBackwardCorrection ( )

Default constructor.

◆ ~UnconstrBackwardCorrection()

robotoc::UnconstrBackwardCorrection::~UnconstrBackwardCorrection ( )
default

Destructor.

◆ UnconstrBackwardCorrection() [3/4]

robotoc::UnconstrBackwardCorrection::UnconstrBackwardCorrection ( const UnconstrBackwardCorrection )
default

Default copy constructor.

◆ UnconstrBackwardCorrection() [4/4]

robotoc::UnconstrBackwardCorrection::UnconstrBackwardCorrection ( UnconstrBackwardCorrection &&  )
defaultnoexcept

Default move constructor.

Member Function Documentation

◆ backwardCorrection()

void robotoc::UnconstrBackwardCorrection::backwardCorrection ( const std::vector< GridInfo > &  time_discretization,
const Solution s,
const KKTMatrix kkt_matrix,
const KKTResidual kkt_residual,
Direction d 
)

Performs the backward correction for coarse updated solution and computes the Newton direction.

Parameters
[in]time_discretizationTime discretization.
[in]sSolution.
[in,out]kkt_matrixKKT matrix.
[in,out]kkt_residualKKT residual.
[in,out]dDirection.

◆ coarseUpdate()

void robotoc::UnconstrBackwardCorrection::coarseUpdate ( 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 
)

Eval KKT and coarse updates the solution leveraging the parallel computation.

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

◆ dualStepSize()

double robotoc::UnconstrBackwardCorrection::dualStepSize ( ) const

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

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

◆ evalKKT()

void robotoc::UnconstrBackwardCorrection::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.

Parameters
[in,out]robotsaligned_vector of Robot.
[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::UnconstrBackwardCorrection::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.

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

◆ getEval()

const PerformanceIndex & robotoc::UnconstrBackwardCorrection::getEval ( ) const
inline

Gets the performance index of the evaluation.

Returns
const reference to the performance index.

◆ initAuxMat()

void robotoc::UnconstrBackwardCorrection::initAuxMat ( aligned_vector< Robot > &  robots,
const std::vector< GridInfo > &  time_discretization,
const Solution s,
KKTMatrix kkt_matrix,
KKTResidual kkt_residual 
)

Initializes the auxiliary matrices by the terminal cost Hessian computed by the current solution.

Parameters
[in]robotsaligned_vector of Robot.
[in]time_discretizationTime discretization.
[in]sSolution.
[in,out]kkt_matrixKKT matrix.
[in,out]kkt_residualKKT residual.

◆ initConstraints()

void robotoc::UnconstrBackwardCorrection::initConstraints ( aligned_vector< Robot > &  robots,
const std::vector< GridInfo > &  time_discretization,
const Solution s 
)

Computes the cost and constraint violations.

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

◆ integratePrimalSolution()

void robotoc::UnconstrBackwardCorrection::integratePrimalSolution ( const aligned_vector< Robot > &  robots,
const std::vector< GridInfo > &  time_discretization,
const double  primal_step_size,
const 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]dDirection.
[in,out]sSolution.

◆ integrateSolution()

void robotoc::UnconstrBackwardCorrection::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.

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.

◆ operator=() [1/2]

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

Default copy operator.

◆ operator=() [2/2]

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

Default move assign operator.

◆ primalStepSize()

double robotoc::UnconstrBackwardCorrection::primalStepSize ( ) const

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

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

◆ setNumThreads()

void robotoc::UnconstrBackwardCorrection::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: