DirectTrajectoryOptimization  v0.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS > Class Template Referenceabstract

This class serves as a base interface for inheriting classes. More...

#include <base_solver_interface.hpp>

Inheritance diagram for DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >:
DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS > DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >

Public Member Functions

virtual void InitializeSolver (const std::string &problemName, const std::string &outputFile, const std::string &paramFile, const bool &computeJacobian)=0
 DTO initializes the solver using this method. More...
 
virtual void Solve (bool warminit=false)=0
 DTO request the solver to proceed with the NLP. More...
 
virtual void GetDTOSolution (state_vector_array_t &yTraj, control_vector_array_t &uTraj, Eigen::VectorXd &hTraj)=0
 Method to get the current values of the solution. More...
 
virtual void GetDTOSolution (state_vector_array_t &yTraj, control_vector_array_t &uTraj, Eigen::VectorXd &hTraj, std::vector< int > &phaseId)=0
 Method to get the current values of the solution. More...
 
virtual void GetDTOSolution (state_vector_array_t &yTraj, state_vector_array_t &ydotTraj, control_vector_array_t &uTraj, Eigen::VectorXd &hTraj, std::vector< int > &phaseId)
 Method to get the current values of the solution. More...
 
virtual void GetSolverSolutionVariables (Eigen::VectorXi &_x_state, Eigen::VectorXd &_x_mul, Eigen::VectorXi &_f_state, Eigen::VectorXd &_f_mul)
 Method to get final values of internal solver variables. More...
 
virtual void InitializeDecisionVariablesFromTrajectory (const state_vector_array_t &y_sol, const control_vector_array_t &u_sol, const Eigen::VectorXd &h_sol)=0
 Initial solution point for the solver. More...
 
virtual void WarmSolverInitialization (const Eigen::VectorXi &x_state, const Eigen::VectorXd &x_mul, const Eigen::VectorXi &f_state, const Eigen::VectorXd &f_mul)
 Warm Initialization of NLP Solver. More...
 
virtual void SetupSolverParameters ()=0
 Setting up solver parameters. More...
 
virtual void GetFVector (Eigen::VectorXd &fVec)=0
 Returns the vector of NLP-constraints. More...
 
void SetVerbosity (bool verb)
 Set verbosity of the solver. More...
 

Protected Member Functions

 DTOSolverInterface ()
 Construct an instance of the DTOSolverInterface class. More...
 

Detailed Description

template<typename DIMENSIONS>
class DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >

This class serves as a base interface for inheriting classes.

Inheriting classes are responsible for implementing interfaces for NLP solvers (eg. IPOPT/SNOPT).

Note
An instance of this class should never be created.

Constructor & Destructor Documentation

template<typename DIMENSIONS >
DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >::DTOSolverInterface ( )
inlineprotected

Construct an instance of the DTOSolverInterface class.

This constructor is not public in order to prevent users from creating this class. This constructor is not private in order to allow derived classes to use the constructor.

Member Function Documentation

template<typename DIMENSIONS >
virtual void DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >::GetDTOSolution ( state_vector_array_t &  yTraj,
control_vector_array_t &  uTraj,
Eigen::VectorXd &  hTraj 
)
pure virtual

Method to get the current values of the solution.

this point is not necessarily feasible or optimal

Parameters
[out]yTrajThe state space trajectory
[out]uTrajThe control trajectory
[out]hTrajThe time increments between the discretization points

Implemented in DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >, and DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS >.

template<typename DIMENSIONS >
virtual void DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >::GetDTOSolution ( state_vector_array_t &  yTraj,
control_vector_array_t &  uTraj,
Eigen::VectorXd &  hTraj,
std::vector< int > &  phaseId 
)
pure virtual

Method to get the current values of the solution.

overloaded to also return the phase ID for each node

Parameters
[out]yTrajThe state space trajectory
[out]uTrajThe control trajectory
[out]hTrajThe time increments between the discretization points
[out]phaseIdThe vector of phases ID's of the corresponding nodes

Implemented in DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >, and DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS >.

template<typename DIMENSIONS >
virtual void DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >::GetDTOSolution ( state_vector_array_t &  yTraj,
state_vector_array_t &  ydotTraj,
control_vector_array_t &  uTraj,
Eigen::VectorXd &  hTraj,
std::vector< int > &  phaseId 
)
inlinevirtual

Method to get the current values of the solution.

overloaded to also return the state derivatives

Parameters
[out]yTrajThe state space trajectory
[out]ydotTrajThe state derivative trajectory
[out]uTrajThe control trajectory
[out]hTrajThe time increments between the discretization points
[out]phaseIdThe vector of phases ID's of the corresponding nodes

Reimplemented in DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >.

template<typename DIMENSIONS >
virtual void DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >::GetFVector ( Eigen::VectorXd &  fVec)
pure virtual

Returns the vector of NLP-constraints.

Parameters
[out]fVecThe vector of NLP-constraints

Implemented in DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >, and DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS >.

template<typename DIMENSIONS >
virtual void DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >::GetSolverSolutionVariables ( Eigen::VectorXi &  _x_state,
Eigen::VectorXd &  _x_mul,
Eigen::VectorXi &  _f_state,
Eigen::VectorXd &  _f_mul 
)
inlinevirtual

Method to get final values of internal solver variables.

the meaning of the state variables is solver dependent

Parameters
[out]_x_stateThe vector of integers indicating the final state of all decision variables
[out]_x_mulThe vector of Lagrange multipliers corresponding to all decision variables
[out]_f_stateThe vector of integers indicating the final state of the vector of NLP-constraints
[out]_f_mulThe vector of Lagrange multipliers corresponding to the vector of NLP-constraints

Reimplemented in DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >.

template<typename DIMENSIONS >
virtual void DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >::InitializeDecisionVariablesFromTrajectory ( const state_vector_array_t &  y_sol,
const control_vector_array_t &  u_sol,
const Eigen::VectorXd &  h_sol 
)
pure virtual

Initial solution point for the solver.

Set the decision variables to the values given by a trajectory

Parameters
[in]y_solvector of states describing the trajectory
[in]u_solvector of controls describing the trajectory
[in]h_solvector of time increments between discretization points

Implemented in DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >, and DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS >.

template<typename DIMENSIONS >
virtual void DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >::InitializeSolver ( const std::string &  problemName,
const std::string &  outputFile,
const std::string &  paramFile,
const bool &  computeJacobian 
)
pure virtual

DTO initializes the solver using this method.

Parameters
[in]problemNameThe name of the problem provided by user
[in]outputFileThe name of the outputfile provided by user
[in]paramFileThe name of the parameters file (solver dependent)
[in]computeJacobianThe flag to use solver numerical differentiation

Implemented in DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >, and DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS >.

template<typename DIMENSIONS >
virtual void DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >::SetupSolverParameters ( )
pure virtual

Setting up solver parameters.

set solver specific parameters

Implemented in DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >, and DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS >.

template<typename DIMENSIONS >
void DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >::SetVerbosity ( bool  verb)
inline

Set verbosity of the solver.

Parameters
[in]verboseThe flag determining the verbosity of the solver
template<typename DIMENSIONS >
virtual void DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >::Solve ( bool  warminit = false)
pure virtual

DTO request the solver to proceed with the NLP.

Parameters
[in]warminitThe flag indicating the type of optimization

Implemented in DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >, and DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS >.

template<typename DIMENSIONS >
virtual void DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >::WarmSolverInitialization ( const Eigen::VectorXi &  x_state,
const Eigen::VectorXd &  x_mul,
const Eigen::VectorXi &  f_state,
const Eigen::VectorXd &  f_mul 
)
inlinevirtual

Warm Initialization of NLP Solver.

set solver variables given by previous solution

Parameters
[in]x_stateIndex for SNOPT decision variables
[in]x_mulLagrange multipliers of decision variables
[in]f_stateIndex for SNOPT vector of constraints
[in]f_mulLagrange multipliers of the constraints

Reimplemented in DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >.


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