DirectTrajectoryOptimization
v0.3
|
Class interfacing SNOPT NLP with DTO Problem. More...
#include <snopt.hpp>
Public Member Functions | |
DTOSnoptInterface (std::shared_ptr< DTOMethodInterface< DIMENSIONS > > method, bool snopt_verbose, bool feasible_point_only) | |
Constructor. More... | |
virtual void | InitializeSolver (const std::string &problem_name, const std::string &output_file, const std::string ¶m_file="", const bool &computeJacobian=false) 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... | |
void | SetupSolverParameters () override |
Setting up solver parameters. 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 | GetDTOSolution (state_vector_array_t &yTraj, state_vector_array_t &ydotTraj, control_vector_array_t &uTraj, Eigen::VectorXd &hTraj, 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... | |
void | GetSolverSolutionVariables (Eigen::VectorXi &_x_state, Eigen::VectorXd &_x_mul, Eigen::VectorXi &_f_state, Eigen::VectorXd &_f_mul) override |
Method to get final values of internal solver variables. More... | |
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 | WarmSolverInitialization (const Eigen::VectorXi &x_state, const Eigen::VectorXd &x_mul, const Eigen::VectorXi &f_state, const Eigen::VectorXd &f_mul) override |
Warm Initialization of NLP Solver. More... | |
Public Member Functions inherited from DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS > | |
void | SetVerbosity (bool verb) |
Set verbosity of the solver. More... | |
Public Attributes | |
std::shared_ptr < DTOMethodInterface < DIMENSIONS > > | _method |
std::shared_ptr< snoptProblemA > | nlp_solver |
Static Public Attributes | |
static std::shared_ptr < DTOSnoptInterface < DIMENSIONS > > | interface_pointer |
Additional Inherited Members | |
Protected Member Functions inherited from DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS > | |
DTOSolverInterface () | |
Construct an instance of the DTOSolverInterface class. More... | |
Class interfacing SNOPT NLP with DTO Problem.
It handles parameter and variables initialization
|
inline |
Constructor.
[in] | method | The pointer to the method |
[in] | snopt_verbose | The flag indicating verbosity of the solver |
[in] | feasible_point_only | The flag indicating the type of optimization |
|
overridevirtual |
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 |
Implements DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >.
|
overridevirtual |
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 |
Implements DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >.
|
overridevirtual |
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 from DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >.
|
inlineoverridevirtual |
Returns the vector of NLP-constraints.
[out] | fVec | The vector of NLP-constraints |
Implements DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >.
|
overridevirtual |
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 from DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >.
|
overridevirtual |
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 |
Implements DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >.
|
overridevirtual |
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 |
Implements DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >.
|
overridevirtual |
Setting up solver parameters.
set solver specific parameters
Implements DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >.
|
overridevirtual |
DTO request the solver to proceed with the NLP.
[in] | warminit | The flag indicating the type of optimization |
Implements DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >.
|
overridevirtual |
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 from DirectTrajectoryOptimization::DTOSolverInterface< DIMENSIONS >.
std::shared_ptr<DTOMethodInterface<DIMENSIONS> > DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >::_method |
Pointer to the DTOMethodInterface
|
static |
Pointer to the constraint function
std::shared_ptr<snoptProblemA> DirectTrajectoryOptimization::DTOSnoptInterface< DIMENSIONS >::nlp_solver |
SnoptA problem