![]() |
MoveIt Pro API
Core Behaviors for MoveIt Pro
|
SplineTrajectory fits piecewise splines to target positions by minimizing a specified cost function via convex optimization. The constructor sets up all the memory needed for running the optimization in the fit function and querying new points using the evaluate function. More...
#include <spline_trajectory.hpp>
Public Member Functions | |
SplineTrajectory (size_t num_points, size_t num_coefficients) | |
The constructor initializes all memory needed for the optimization and evaluation. | |
void | fit (const moveit_pro_controllers::Trajectory &points, const SplineOptimizationParameters &optimization_parameters, double scaled_time_base=1.05) |
Fits the piecewise spline to the given trajectory points. | |
const moveit_pro_controllers::TimedJointState & | evaluate (double ti) |
Evaluates the spline at a given time point. | |
const std::vector< double > & | getKnots () const |
Returns the vector of knot time points used in the spline trajectory. | |
SplineTrajectory fits piecewise splines to target positions by minimizing a specified cost function via convex optimization. The constructor sets up all the memory needed for running the optimization in the fit function and querying new points using the evaluate function.
The cost function to minimize is the , where
.
SplineTrajectory::SplineTrajectory | ( | size_t | num_points, |
size_t | num_coefficients | ||
) |
The constructor initializes all memory needed for the optimization and evaluation.
num_points | The number of points to fit the spline to. |
num_coefficients | The number of polynomial terms to use per piecewise spline. |
const moveit_pro_controllers::TimedJointState & SplineTrajectory::evaluate | ( | double | ti | ) |
Evaluates the spline at a given time point.
ti | The time from start at which to evaluate the spline. |
void SplineTrajectory::fit | ( | const moveit_pro_controllers::Trajectory & | points, |
const SplineOptimizationParameters & | optimization_parameters, | ||
double | scaled_time_base = 1.05 |
||
) |
Fits the piecewise spline to the given trajectory points.
std::runtime_error | Thrown if:
|
points | The trajectory points to fit the spline to. |
optimization_parameters | Parameters for spline optimization, including weights and constraints. |
scaled_time_base | The multiplier to iteratively scale time if the inequality dynamic constraints are not met. |
const std::vector< double > & SplineTrajectory::getKnots | ( | ) | const |
Returns the vector of knot time points used in the spline trajectory.