DirectTrajectoryOptimization
v0.3
|
This class serves as a base interface for inheriting classes. More...
#include <base_solver_interface.hpp>
Public Member Functions | |
virtual void | InitializeSolver (const std::string &problemName, const std::string &outputFile, const std::string ¶mFile, 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... | |
This class serves as a base interface for inheriting classes.
Inheriting classes are responsible for implementing interfaces for NLP solvers (eg. IPOPT/SNOPT).
|
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.
|
pure virtual |
Method to get the current values of the solution.
this point is not necessarily feasible or optimal
[out] | yTraj | The state space trajectory |
[out] | uTraj | The control trajectory |
[out] | hTraj | The time increments between the discretization points |
Implemented in DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >, and DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS >.
|
pure virtual |
Method to get the current values of the solution.
overloaded to also return the phase ID for each node
[out] | yTraj | The state space trajectory |
[out] | uTraj | The control trajectory |
[out] | hTraj | The time increments between the discretization points |
[out] | phaseId | The vector of phases ID's of the corresponding nodes |
Implemented in DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >, and DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS >.
|
inlinevirtual |
Method to get the current values of the solution.
overloaded to also return the state derivatives
[out] | yTraj | The state space trajectory |
[out] | ydotTraj | The state derivative trajectory |
[out] | uTraj | The control trajectory |
[out] | hTraj | The time increments between the discretization points |
[out] | phaseId | The vector of phases ID's of the corresponding nodes |
Reimplemented in DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >.
|
pure virtual |
Returns the vector of NLP-constraints.
[out] | fVec | The vector of NLP-constraints |
Implemented in DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >, and DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS >.
|
inlinevirtual |
Method to get final values of internal solver variables.
the meaning of the state variables is solver dependent
[out] | _x_state | The vector of integers indicating the final state of all decision variables |
[out] | _x_mul | The vector of Lagrange multipliers corresponding to all decision variables |
[out] | _f_state | The vector of integers indicating the final state of the vector of NLP-constraints |
[out] | _f_mul | The vector of Lagrange multipliers corresponding to the vector of NLP-constraints |
Reimplemented in DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >.
|
pure virtual |
Initial solution point for the solver.
Set the decision variables to the values given by a trajectory
[in] | y_sol | vector of states describing the trajectory |
[in] | u_sol | vector of controls describing the trajectory |
[in] | h_sol | vector of time increments between discretization points |
Implemented in DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >, and DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS >.
|
pure virtual |
DTO initializes the solver using this method.
[in] | problemName | The name of the problem provided by user |
[in] | outputFile | The name of the outputfile provided by user |
[in] | paramFile | The name of the parameters file (solver dependent) |
[in] | computeJacobian | The flag to use solver numerical differentiation |
Implemented in DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >, and DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS >.
|
pure virtual |
Setting up solver parameters.
set solver specific parameters
Implemented in DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >, and DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS >.
|
inline |
Set verbosity of the solver.
[in] | verbose | The flag determining the verbosity of the solver |
|
pure virtual |
DTO request the solver to proceed with the NLP.
[in] | warminit | The flag indicating the type of optimization |
Implemented in DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >, and DirectTrajectoryOptimization::DTOIpoptInterface< DIMENSIONS >.
|
inlinevirtual |
Warm Initialization of NLP Solver.
set solver variables given by previous solution
[in] | x_state | Index for SNOPT decision variables |
[in] | x_mul | Lagrange multipliers of decision variables |
[in] | f_state | Index for SNOPT vector of constraints |
[in] | f_mul | Lagrange multipliers of the constraints |
Reimplemented in DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >.