hpp-bezier-com-traj  4.14.0
Multi contact trajectory generation for the COM using Bezier curves
solver-abstract.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2017 CNRS
3 //
4 // This file is part of tsid
5 // tsid is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 // tsid is distributed in the hope that it will be
10 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
11 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // General Lesser Public License for more details. You should have
13 // received a copy of the GNU Lesser General Public License along with
14 // tsid If not, see
15 // <http://www.gnu.org/licenses/>.
16 //
17 
18 #ifndef SOLVERABSTRACT_HH_
19 #define SOLVERABSTRACT_HH_
20 
21 #include <Eigen/Dense>
23 
24 namespace solvers {
25 
30 
31 static const double UNBOUNDED_UP = 100000.;
32 static const double UNBOUNDED_DOWN = -100000.;
33 
37 typedef const Eigen::Ref<const VectorXd>& Cref_vectorX;
38 
39 enum BEZIER_COM_TRAJ_DLLAPI SolverType {
40  SOLVER_QUADPROG = 0x00001
41 // SOLVER_QUADPROG_SPARSE = 0x00002
42 #ifdef USE_GLPK_SOLVER
43  ,
44  SOLVER_GLPK = 0x00002
45 #endif
46 };
47 
53  ResultData() : success_(false), cost_(-1.), x(VectorXd::Zero(0)) {}
54 
55  ResultData(const bool success, const double cost, Cref_vectorX x)
56  : success_(success), cost_(cost), x(x) {}
57 
58  ResultData(const ResultData& other)
59  : success_(other.success_), cost_(other.cost_), x(other.x) {}
61 
62  ResultData& operator=(const ResultData& other) {
63  success_ = (other.success_);
64  cost_ = (other.cost_);
65  x = (other.x);
66  return *this;
67  }
68  bool success_; // whether the optimization was successful
69  double cost_; // cost evaluation for the solved control point
70  VectorXd x; // control point
71 };
72 
73 // min g'x
74 // st CIx <= ci0
75 // CEx = ce0
87  const MatrixXd& A, const VectorXd& b, const MatrixXd& D, const VectorXd& d,
88  const MatrixXd& Hess, const VectorXd& g, const VectorXd& initGuess,
89  Cref_vectorX minBounds, Cref_vectorX maxBounds, const SolverType solver);
90 
91 } /* namespace solvers */
92 
93 #endif /* SOLVERABSTRACT_HH_ */
Definition: glpk-wrapper.hpp:24
#define BEZIER_COM_TRAJ_DLLAPI
Definition: local_config.hh:52
bool success_
Definition: solver-abstract.hpp:68
ResultData()
Definition: solver-abstract.hpp:53
Eigen::VectorXd VectorXd
Definition: solver-abstract.hpp:35
~ResultData()
Definition: solver-abstract.hpp:60
Struct used to return the results of the trajectory generation problem.
Definition: solver-abstract.hpp:52
ResultData & operator=(const ResultData &other)
Definition: solver-abstract.hpp:62
double cost_
Definition: solver-abstract.hpp:69
VectorXd x
Definition: solver-abstract.hpp:70
ResultData(const ResultData &other)
Definition: solver-abstract.hpp:58
ResultData BEZIER_COM_TRAJ_DLLAPI solve(const MatrixXd &A, const VectorXd &b, const MatrixXd &D, const VectorXd &d, const MatrixXd &Hess, const VectorXd &g, const VectorXd &initGuess, Cref_vectorX minBounds, Cref_vectorX maxBounds, const SolverType solver)
solve Solve a QP or LP given init position and velocity, 0 velocity constraints (acceleration constra...
Definition: solver-abstract.cpp:85
const Eigen::Ref< const VectorXd > & Cref_vectorX
Definition: solver-abstract.hpp:37
Definition: solver-abstract.hpp:29
Eigen::MatrixXd MatrixXd
Definition: solver-abstract.hpp:34
optim_status
Definition: solver-abstract.hpp:29
Definition: solver-abstract.hpp:29
Eigen::VectorXi VectorXi
Definition: solver-abstract.hpp:36
ResultData(const bool success, const double cost, Cref_vectorX x)
Definition: solver-abstract.hpp:55