27 #ifndef INCLUDE_STOMP_MOVEIT_UTILS_POLYNOMIAL_H_ 28 #define INCLUDE_STOMP_MOVEIT_UTILS_POLYNOMIAL_H_ 30 #include <stomp_core/utils.h> 55 Eigen::Matrix<double, 2, Eigen::Dynamic>
xy;
56 Eigen::Matrix<double, 2, Eigen::Dynamic>
xyfp;
57 Eigen::Matrix<double, 2, Eigen::Dynamic>
xyfs;
66 return ((xyfp.cols() > 0) || (xyfs.cols() > 0));
75 return (xyfp.cols() > 0);
84 return (xyfs.cols() > 0);
118 void generateMinimumDomainValues(
const std::vector<const moveit::core::JointModel*> joint_models,
const Eigen::MatrixXd ¶meters,
119 Eigen::VectorXd &domain_values);
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);
Eigen::VectorXd y
The fit values.
bool hasSlopeConstraints() const
Check if request has slope constraints.
The Polynomial Fit request data.
Eigen::VectorXd p
The polynomial parameter found during fit.
bool hasConstraints() const
Check if request has constraints.
Eigen::Matrix< double, 2, Eigen::Dynamic > xyfp
The position constraint data.
Eigen::VectorXd x
The fit domain values.
The Polynomial Fit results data.
Eigen::Matrix< double, 2, Eigen::Dynamic > xy
The fit data.
bool successful
True if polynomial fit was found, otherwise false.
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.
int d
Degree of the polynomial.
Eigen::VectorXd output_domain
The fit output domain. If not provided it will use the input domain.
void generateMinimumDomainValues(const std::vector< const moveit::core::JointModel * > joint_models, const Eigen::MatrixXd ¶meters, Eigen::VectorXd &domain_values)
Get the polynomial smoother domain values.
bool hasPositionConstraints() const
Check if request has position constraints.
Eigen::Matrix< double, 2, Eigen::Dynamic > xyfs
The slope constraint data.
bool applyPolynomialSmoothing(moveit::core::RobotModelConstPtr robot_model, const std::string &group_name, Eigen::MatrixXd ¶meters, 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...
PolyFitResults polyFit(const PolyFitRequest &request)
Fit a polynomial with fixed indices.