27 #ifndef MPBLOCKS_DUBINS_CURVES_EIGEN_INTEGRATOR_H_
28 #define MPBLOCKS_DUBINS_CURVES_EIGEN_INTEGRATOR_H_
32 namespace curves_eigen {
38 template <
typename Scalar>
49 return Vector3d(c[0] + r * std::cos(alpha1),
50 c[1] + r * std::sin(alpha1),
59 return Vector3d(c[0] + r * std::cos(alpha1),
60 c[1] + r * std::sin(alpha1),
65 return Vector3d(q0[0] + d1 * std::cos(q0[2]),
66 q0[1] + d1 * std::sin(q0[2]),
73 return L(q2, r, s[2]);
79 return R(q2, r, s[2]);
85 return L(q2, r, s[2]);
91 return R(q2, r, s[2]);
97 return R(q2, r, s[2]);
103 return L(q2, r, s[2]);
113 return LRL(q0, path.
s, r);
117 return RLR(q0, path.
s, r);
120 return LSL(q0, path.
s, r);
123 return RSR(q0, path.
s, r);
126 return LSR(q0, path.
s, r);
129 return RSL(q0, path.
s, r);
132 return Vector3d::Zero();
141 template <
typename Scalar>
149 if (*budget < r * arc) {
157 return Vector3d(c[0] + r * std::cos(alpha1), c[1] + r * std::sin(alpha1),
163 if (*budget < r * arc) {
171 return Vector3d(c[0] + r * std::cos(alpha1), c[1] + r * std::sin(alpha1),
180 return Vector3d(q0[0] + d1 * std::cos(q0[2]),
181 q0[1] + d1 * std::sin(q0[2]),
189 return L(q2, r, s[2], budget);
196 return R(q2, r, s[2], budget);
203 return L(q2, r, s[2], budget);
210 return R(q2, r, s[2], budget);
217 return R(q2, r, s[2], budget);
224 return L(q2, r, s[2], budget);
235 return LRL(q0, path.
s, r, &budget);
239 return RLR(q0, path.
s, r, &budget);
242 return LSL(q0, path.
s, r, &budget);
245 return RSR(q0, path.
s, r, &budget);
248 return LSR(q0, path.
s, r, &budget);
251 return RSL(q0, path.
s, r, &budget);
254 return Vector3d::Zero();
263 #endif // MPBLOCKS_DUBINS_CURVES_EIGEN_INTEGRATOR_H_
static Vector3d LSR(const Vector3d &q0, const Vector3d &s, const Scalar r, double *budget)
static Vector3d LRL(const Vector3d &q0, const Vector3d &s, const Scalar r, double *budget)
static Vector3d RLR(const Vector3d &q0, const Vector3d &s, const Scalar r)
static Vector3d LSL(const Vector3d &q0, const Vector3d &s, const Scalar r)
Scalar leftAngleOf(const Scalar q_theta)
return the angle of the vector from the center of the counter clockwise (left) circle coincident to q...
static Vector3d R(const Vector3d &q0, const Scalar r, const Scalar arc)
static Vector3d LSL(const Vector3d &q0, const Vector3d &s, const Scalar r, double *budget)
static Vector3d RLR(const Vector3d &q0, const Vector3d &s, const Scalar r, double *budget)
Vector3d s
lengths of each segment, how it's interpreted depends on id
static Vector3d LRL(const Vector3d &q0, const Vector3d &s, const Scalar r)
static Vector3d RSL(const Vector3d &q0, const Vector3d &s, const Scalar r, double *budget)
static Vector3d L(const Vector3d &q0, const Scalar r, const Scalar arc)
Eigen::Matrix< Scalar, 2, 1 > Vector2d
static Vector3d RSR(const Vector3d &q0, const Vector3d &s, const Scalar r, double *budget)
Eigen::Matrix< Scalar, 3, 1 > Vector3d
static Vector3d solve(const Vector3d q0, const Path_t &path, const Scalar r)
Given an initial dubins state (position, heading), a path primitive composed of three arc segments...
int id
identifies the type of path
static Vector3d RSR(const Vector3d &q0, const Vector3d &s, const Scalar r)
static Vector3d L(const Vector3d &q0, const Scalar r, Scalar arc, Scalar *budget)
Scalar rightAngleOf(const Scalar q_theta)
return the angle of the vector from the center of the clockwise (right) circle coincident to q...
Eigen::Matrix< Scalar, 3, 1 > Vector3d
__host__ __device__ Format_t clampRadian(Format_t a)
wraps the input onto [-pi,pi]
Eigen::Matrix< Scalar, 2, 1 > rightCenter(const Eigen::Matrix< Scalar, 3, 1 > &q, Scalar r)
return the center of a clockwise (right) circle coincident to q with radius r
static Vector3d RSL(const Vector3d &q0, const Vector3d &s, const Scalar r)
static Vector3d S(const Vector3d &q0, const Scalar d1)
static Vector3d LSR(const Vector3d &q0, const Vector3d &s, const Scalar r)
Encodes a dubins path primitive, which is three connected arc segments.
static Vector3d S(const Vector3d &q0, Scalar d1, double *budget)
Eigen::Matrix< Scalar, 2, 1 > Vector2d
Eigen::Matrix< Scalar, 2, 1 > leftCenter(const Eigen::Matrix< Scalar, 3, 1 > &q, Scalar r)
return the center of a counter clockwise (left) circle coincident to q with radius r ...
static Vector3d R(const Vector3d &q0, const Scalar r, Scalar arc, Scalar *budget)
static Vector3d solve(const Vector3d q0, const Path_t &path, const Scalar r, double budget)
Given an initial dubins state (position, heading), a path primitive composed of three arc segments...