26 #ifndef MPBLOCKS_DUBINS_CURVES_EIGEN_HYPER_TWO_X_Y_H_
27 #define MPBLOCKS_DUBINS_CURVES_EIGEN_HYPER_TWO_X_Y_H_
31 namespace curves_eigen {
35 template <
int xSpec,
int ySpec,
typename Format_t>
54 p << get_constraint<xSpec, 0>(h), get_constraint<ySpec, 1>(h);
60 if (cp.squaredNorm() < r * r)
return out;
65 Format_t d_cp = cp.norm();
71 Format_t alpha = std::acos(r / d_cp);
74 Format_t beta = std::atan2(cp[1], cp[0]);
83 Format_t arc0 =
ccwArc(theta0, theta1);
86 Format_t d1 = d_cp * std::sin(alpha);
101 p << get_constraint<xSpec, 0>(h), get_constraint<ySpec, 1>(h);
107 if (cp.squaredNorm() < r * r)
return out;
112 Format_t d_cp = cp.norm();
118 Format_t alpha = std::acos(r / d_cp);
121 Format_t beta = std::atan2(cp[1], cp[0]);
130 Format_t arc0 =
cwArc(theta0, theta1);
133 Format_t d1 = d_cp * std::sin(alpha);
141 return bestOf(solveLS(q0, h, r), solveRS(q0, h, r), r);
150 #endif // MPBLOCKS_DUBINS_CURVES_EIGEN_HYPER_TWO_X_Y_H_
__host__ __device__ Format_t cwArc(Format_t a, Format_t b)
returns the clockwise (right) distance from a to b
the default solver is instantated when not all three constraints are active and it simply dispatches ...
Scalar leftAngleOf(const Scalar q_theta)
return the angle of the vector from the center of the counter clockwise (left) circle coincident to q...
__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
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...
__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
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 ...
Path< Format_t > bestOf(const Path< Format_t > &r0, const Path< Format_t > &r1, const Format_t r)