12 #include <ndcurves/exact_cubic.h>
27 using exact_cubic_t = ndcurves::exact_cubic<double, double, false, point_t>;
46 const std::vector<waypoint_t> & waypoints = {},
47 const point_t & init_vel = {},
48 const point_t & init_acc = {},
49 const point_t & end_vel = {},
50 const point_t & end_acc = {});
129 std::vector<Eigen::Vector3d>
splev(
double t,
unsigned int der = 0);
146 std::unique_ptr<exact_cubic_t> spline_ =
nullptr;
#define MC_TRAJECTORY_DLLAPI
Definition: api.h:50
Definition: StateBuilder.h:28
Represents an Exact Cubic spline : a curve that passes exactly through waypoints in position,...
Definition: ExactCubic.h:23
void waypoint(size_t idx, const double t)
Updates the time at which an existing waypoint should be reached.
ExactCubic(double duration, const point_t &start, const point_t &target, const std::vector< waypoint_t > &waypoints={}, const point_t &init_vel={}, const point_t &init_acc={}, const point_t &end_vel={}, const point_t &end_acc={})
void update() override
Triggers recreation of the curve. Will only occur if the curve parameters were modified (waypoints,...
ndcurves::exact_cubic< double, double, false, point_t > exact_cubic_t
Definition: ExactCubic.h:27
const point_t & init_vel() const
Gets the curve's initial velocity.
const point_t & end_acc() const
Gets the curve's final acceleration.
const point_t & end_vel() const
Gets the curve's final velocity.
std::vector< Eigen::Vector3d > splev(double t, unsigned int der=0)
Computes the position along the curve at time t, and its derivatives up to the nth order (typically v...
double waypointTime(size_t idx) const
Gets the time at which a waypoint should be reached.
std::pair< double, point_t > waypoint_t
Definition: ExactCubic.h:26
Eigen::Vector3d point_t
Definition: ExactCubic.h:25
ndcurves::curve_constraints< point_t > spline_constraints_t
Definition: ExactCubic.h:28
const waypoint_t & waypoint(size_t idx) const
Gets position of a waypoint.
std::vector< Eigen::Vector3d > sampleTrajectory()
Sample positions along the trajectory (for visualization purposes)
void addToGUI(mc_rtc::gui::StateBuilder &gui, const std::vector< std::string > &category)
Add GUI elements to control the curve's waypoints and targets.
void waypoint(size_t idx, const point_t &waypoint)
Updates the position of an existing waypoint.
void constraints(const point_t &init_vel, const point_t &init_acc, const point_t &end_vel, const point_t &end_acc)
Defines the initial/final velocity and acceleration constraints for the curve.
const point_t & init_acc() const
Gets the curve's initial acceleration.