26 #ifndef MPBLOCKS_DUBINS_CURVES_EIGEN_HYPER_ONE_X_H_
27 #define MPBLOCKS_DUBINS_CURVES_EIGEN_HYPER_ONE_X_H_
31 namespace curves_eigen {
35 template <
int xSpec,
typename Format_t>
52 v << -std::sin(q0[2]), std::cos(q0[2]);
56 Format_t
X = get_constraint<xSpec, 0>(h);
60 if (std::abs(c[0] - X) < r) {
61 Format_t theta1 = std::acos((X - c[0]) / r);
63 Format_t dist0 =
ccwArc(theta0, theta1);
64 Format_t dist1 =
ccwArc(theta0, -theta1);
65 Format_t arc0 = std::min(dist0, dist1);
77 Format_t target = M_PI / 2;
78 if (X > c[0]) target = -M_PI / 2;
82 Format_t arc0 =
ccwArc(theta0, target);
85 Format_t d1 = std::abs(X - c[0]);
98 v << std::sin(q0[2]), -std::cos(q0[2]);
102 Format_t
X = get_constraint<xSpec, 0>(h);
106 if (std::abs(c[0] - X) < r) {
107 Format_t theta1 = std::acos((X - c[0]) / r);
109 Format_t dist0 =
cwArc(theta0, theta1);
110 Format_t dist1 =
cwArc(theta0, -theta1);
111 Format_t arc0 = std::min(dist0, dist1);
123 Format_t target = -M_PI / 2;
124 if (X > c[0]) target = M_PI / 2;
128 Format_t arc0 =
cwArc(theta0, target);
131 Format_t d1 = std::abs(X - c[0]);
139 return bestOf(solveLS(q0, h, r), solveRS(q0, h, r), r);
148 #endif // MPBLOCKS_DUBINS_CURVES_EIGEN_HYPER_ONE_X_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...
Encodes a dubins path primitive, which is three connected arc segments.
Path< Format_t > bestOf(const Path< Format_t > &r0, const Path< Format_t > &r1, const Format_t r)