19 #ifndef _CLASS_EFFECTORSPLINE
20 #define _CLASS_EFFECTORSPLINE
22 #include "spline/spline_deriv_constraint.h"
28 typedef Eigen::Matrix<Numeric, 3, 1>
Point;
29 typedef std::vector<Point, Eigen::aligned_allocator<Point> >
T_Point;
42 return std::make_pair(source.first + time_offset, (source.second + normal / norm * offset));
46 const Time time_offset) {
51 Point n = normal / norm;
52 Point d = offset / (time_offset * time_offset * time_offset) * -n;
53 Point c = -3 * d * time_offset;
54 Point b = -c * time_offset;
57 points.push_back(from);
62 return spline_t(points.begin(), points.end(), init_time, init_time + time_offset);
66 const Time time_offset) {
69 constraints.end_acc = end_spline.derivate(end_spline.min(), 2);
70 constraints.end_vel = end_spline.derivate(end_spline.min(), 1);
89 template <
typename In>
91 const Point& land_normal = Eigen::Vector3d::UnitZ(),
const Numeric lift_offset = 0.02,
92 const Numeric land_offset = 0.02,
const Time lift_offset_duration = 0.02,
93 const Time land_offset_duration = 0.02) {
95 const Waypoint &inPoint = *wayPointsBegin, endPoint = *(wayPointsEnd - 1);
96 waypoints.push_back(inPoint);
98 waypoints.push_back(
compute_offset(inPoint, lift_normal, lift_offset, lift_offset_duration));
100 waypoints.insert(waypoints.end(), wayPointsBegin + 1, wayPointsEnd - 1);
103 waypoints.push_back(landWaypoint);
106 make_end_spline(land_normal, landWaypoint.second, land_offset, landWaypoint.first, land_offset_duration);
110 splines.push_back(end_spline);
115 #endif //_CLASS_EFFECTORSPLINE