polynomial.h
Go to the documentation of this file.
1 
27 #ifndef INCLUDE_STOMP_MOVEIT_UTILS_POLYNOMIAL_H_
28 #define INCLUDE_STOMP_MOVEIT_UTILS_POLYNOMIAL_H_
29 
30 #include <stomp_core/utils.h>
32 #include <Eigen/Core>
33 
37 namespace stomp_moveit
38 {
39 
43 namespace utils
44 {
45 
49 namespace polynomial
50 {
53  {
54  int d;
55  Eigen::Matrix<double, 2, Eigen::Dynamic> xy;
56  Eigen::Matrix<double, 2, Eigen::Dynamic> xyfp;
57  Eigen::Matrix<double, 2, Eigen::Dynamic> xyfs;
58  Eigen::VectorXd output_domain;
64  bool hasConstraints() const
65  {
66  return ((xyfp.cols() > 0) || (xyfs.cols() > 0));
67  }
68 
74  {
75  return (xyfp.cols() > 0);
76  }
77 
82  bool hasSlopeConstraints() const
83  {
84  return (xyfs.cols() > 0);
85  }
86 
87  };
88 
91  {
92  Eigen::VectorXd p;
93  Eigen::VectorXd x;
94  Eigen::VectorXd y;
95  bool successful;
96  };
97 
98 
104  PolyFitResults polyFit(const PolyFitRequest &request);
105 
118  void generateMinimumDomainValues(const std::vector<const moveit::core::JointModel*> joint_models, const Eigen::MatrixXd &parameters,
119  Eigen::VectorXd &domain_values);
120 
128  void fillVandermondeMatrix(const Eigen::ArrayXd &domain_vals, const int &order, Eigen::MatrixXd &v);
129 
140  bool applyPolynomialSmoothing(moveit::core::RobotModelConstPtr robot_model, const std::string& group_name, Eigen::MatrixXd& parameters,
141  int poly_order = 5, double joint_limit_margin = 1e-5);
142 
143 } // end of namespace smoothing
144 } // end of namespace utils
145 } // end of namespace stomp_moveit
146 
147 
148 #endif /* INCLUDE_STOMP_MOVEIT_UTILS_POLYNOMIAL_H_ */
Eigen::VectorXd y
The fit values.
Definition: polynomial.h:94
bool hasSlopeConstraints() const
Check if request has slope constraints.
Definition: polynomial.h:82
The Polynomial Fit request data.
Definition: polynomial.h:52
Eigen::VectorXd p
The polynomial parameter found during fit.
Definition: polynomial.h:92
bool hasConstraints() const
Check if request has constraints.
Definition: polynomial.h:64
Eigen::Matrix< double, 2, Eigen::Dynamic > xyfp
The position constraint data.
Definition: polynomial.h:56
Eigen::VectorXd x
The fit domain values.
Definition: polynomial.h:93
The Polynomial Fit results data.
Definition: polynomial.h:90
Eigen::Matrix< double, 2, Eigen::Dynamic > xy
The fit data.
Definition: polynomial.h:55
bool successful
True if polynomial fit was found, otherwise false.
Definition: polynomial.h:95
void fillVandermondeMatrix(const Eigen::ArrayXd &domain_vals, const int &order, Eigen::MatrixXd &v)
Generates a Vandermonde matrix from the domain values as described here https://en.wikipedia.org/wiki/Vandermonde_matrix. It uses the poly_order parameter in order to set the size of the matrix.
Definition: polynomial.cpp:149
Eigen::VectorXd output_domain
The fit output domain. If not provided it will use the input domain.
Definition: polynomial.h:58
void generateMinimumDomainValues(const std::vector< const moveit::core::JointModel * > joint_models, const Eigen::MatrixXd &parameters, Eigen::VectorXd &domain_values)
Get the polynomial smoother domain values.
Definition: polynomial.cpp:156
bool hasPositionConstraints() const
Check if request has position constraints.
Definition: polynomial.h:73
Eigen::Matrix< double, 2, Eigen::Dynamic > xyfs
The slope constraint data.
Definition: polynomial.h:57
bool applyPolynomialSmoothing(moveit::core::RobotModelConstPtr robot_model, const std::string &group_name, Eigen::MatrixXd &parameters, int poly_order=5, double joint_limit_margin=1e-5)
Applies a polynomial smoothing method to a trajectory. It checks for joint limits and makes correctio...
Definition: polynomial.cpp:187
PolyFitResults polyFit(const PolyFitRequest &request)
Fit a polynomial with fixed indices.
Definition: polynomial.cpp:49


stomp_moveit
Author(s): Jorge Nicho
autogenerated on Fri May 8 2020 03:35:47