26 #ifndef MPBLOCKS_DUBINS_CURVES_EIGEN_HYPER_TWO_THETA_Y_RSL_H_
27 #define MPBLOCKS_DUBINS_CURVES_EIGEN_HYPER_TWO_THETA_Y_RSL_H_
31 namespace curves_eigen {
33 namespace two_theta_y {
36 template <
int ySpec,
int tSpec,
typename Format_t>
48 for (
int i = 0; i < 3; i++) {
57 q1 << q0[0], get_constraint<ySpec, 1>(h), get_constraint<tSpec, 2>(h);
66 const Format_t dy = c1[1] - c0[1];
69 Format_t dist, dist_i, d1, arc0, arc1;
79 arc0 =
cwArc(q0[2], target);
80 arc1 =
ccwArc(target, q1[2]);
81 dist = r * (arc0 + arc1) + d1;
90 Format_t sinTheta = std::sin(q0[2]);
91 if ((dy > 0 && sinTheta > 0) || (dy < 0 && sinTheta < 0)) {
92 d1 = (dy - 2 * r * std::sin(alpha0)) / sinTheta;
95 arc1 =
ccwArc(q0[2], q1[2]);
96 dist_i = r * (arc0 + arc1) + d1;
106 sinTheta = std::sin(q1[2]);
107 if ((dy > 0 && sinTheta > 0) || (dy < 0 && sinTheta < 0)) {
108 d1 = (dy + 2 * r * std::sin(alpha1)) / sinTheta;
110 arc0 =
cwArc(q0[2], q1[2]);
112 dist_i = r * (arc0 + arc1) + d1;
132 #endif // MPBLOCKS_DUBINS_CURVES_EIGEN_HYPER_TWO_THETA_Y_RSL_H_
Eigen::Matrix< Format_t, 3, 1 > Vector3d_t
__host__ __device__ Format_t cwArc(Format_t a, Format_t b)
returns the clockwise (right) distance from a to b
Scalar leftAngleOf(const Scalar q_theta)
return the angle of the vector from the center of the counter clockwise (left) circle coincident to q...
Eigen::Matrix< Format_t, 2, 1 > Vector2d_t
__host__ __device__ Format_t ccwArc(Format_t a, Format_t b)
returns the counter clockwise (left) distance from a to b
Eigen::Matrix< Format_t, 3, 1 > Vector3d_t
interface for variants of solvers, default template is never instantiated
int id
identifies the type of path
A hyper-rectangle in dubins space: A rectangular prism in R^3.
Scalar rightAngleOf(const Scalar q_theta)
return the angle of the vector from the center of the clockwise (right) circle coincident to q...
static Result_t solve(const Vector3d_t &q0, const Hyper_t &h, const Format_t r)
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
HyperRect< Format_t > Hyper_t
Path< Format_t > Result_t
Encodes a dubins path primitive, which is three connected arc segments.
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 ...