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

Class interfacing Ipopt NLP with a DirectTrajectoryOptimization problem. More...

#include <ipopt.hpp>

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

Public Member Functions

 DTOIpoptInterface (std::shared_ptr< DTOMethodInterface< DIMENSIONS > > method, bool ipopt_verbose)
 Create a new ipopt interface instance. More...
 
virtual void InitializeSolver (const std::string &problemName, const std::string &outputFile, const std::string &paramFile, const bool &computeJacobian) override
 DTO initializes the solver using this method. More...
 
virtual void Solve (bool warminit=false) override
 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) override
 Method to get the current values of the solution. More...
 
virtual void GetDTOSolution (state_vector_array_t &y_trajectory, control_vector_array_t &u_trajectory, Eigen::VectorXd &h_trajectory, std::vector< int > &phaseId) override
 Method to get the current values of the solution. More...
 
virtual void GetFVector (Eigen::VectorXd &fVec) override
 Returns the vector of NLP-constraints. More...
 
virtual void InitializeDecisionVariablesFromTrajectory (const state_vector_array_t &y_sol, const control_vector_array_t &u_sol, const Eigen::VectorXd &h_sol) override
 Initial solution point for the solver. More...
 
void SetupSolverParameters () override
 Setting up solver parameters. More...
 
- Public Member Functions inherited from DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >
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 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...
 
void SetVerbosity (bool verb)
 Set verbosity of the solver. More...
 

Additional Inherited Members

- Protected Member Functions inherited from DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >
 DTOSolverInterface ()
 Construct an instance of the DTOSolverInterface class. More...
 

Detailed Description

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

Class interfacing Ipopt NLP with a DirectTrajectoryOptimization problem.

Constructor & Destructor Documentation

template<typename DIMENSIONS >
DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS >::DTOIpoptInterface ( std::shared_ptr< DTOMethodInterface< DIMENSIONS > >  method,
bool  ipopt_verbose 
)
inline

Create a new ipopt interface instance.

Parameters
[in]methodThe method of direct transcription to employ - see enum for options.
[in]ipopt_verboseThe flag setting the verbosity

Member Function Documentation

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

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

Implements DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >.

template<class DIMENSIONS >
void DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS >::GetDTOSolution ( state_vector_array_t &  yTraj,
control_vector_array_t &  uTraj,
Eigen::VectorXd &  hTraj,
std::vector< int > &  phaseId 
)
overridevirtual

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

Implements DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >.

template<typename DIMENSIONS >
void DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS >::GetFVector ( Eigen::VectorXd &  fVec)
overridevirtual

Returns the vector of NLP-constraints.

Parameters
[out]fVecThe vector of NLP-constraints

Implements DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >.

template<class DIMENSIONS >
void DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS >::InitializeDecisionVariablesFromTrajectory ( const state_vector_array_t &  y_sol,
const control_vector_array_t &  u_sol,
const Eigen::VectorXd &  h_sol 
)
overridevirtual

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

Implements DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >.

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

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

Implements DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >.

template<typename DIMENSIONS >
void DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS >::SetupSolverParameters ( )
overridevirtual

Setting up solver parameters.

set solver specific parameters

Implements DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >.

template<typename DIMENSIONS >
void DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS >::Solve ( bool  warminit = false)
overridevirtual

DTO request the solver to proceed with the NLP.

Parameters
[in]warminitThe flag indicating the type of optimization

Implements DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >.


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