26 #ifndef MPBLOCKS_DUBINS_CURVES_EIGEN_HYPER_ONE_Y_H_
27 #define MPBLOCKS_DUBINS_CURVES_EIGEN_HYPER_ONE_Y_H_
31 namespace curves_eigen {
35 template <
int ySpec,
typename Format_t>
48 const Format_t _PI =
static_cast<Format_t
>(M_PI);
53 v << -std::sin(q0[2]), std::cos(q0[2]);
57 Format_t
Y = get_constraint<ySpec, 1>(h);
61 if (std::abs(c[1] - Y) < r) {
62 Format_t theta1 = std::asin((Y - c[1]) / r);
64 Format_t dist0 =
ccwArc(theta0, theta1);
67 dist1 =
ccwArc(theta0, _PI - theta1);
69 dist1 =
ccwArc(theta0, -_PI - theta1);
70 Format_t arc0 = std::min(dist0, dist1);
82 Format_t target = _PI;
83 if (Y > c[1]) target = 0;
87 Format_t arc0 =
ccwArc(theta0, target);
90 Format_t d1 = std::abs(Y - c[1]);
99 const Format_t _PI =
static_cast<Format_t
>(M_PI);
104 v << std::sin(q0[2]), -std::cos(q0[2]);
108 Format_t
Y = get_constraint<ySpec, 1>(h);
112 if (std::abs(c[1] - Y) < r) {
113 Format_t theta1 = std::asin((Y - c[1]) / r);
115 Format_t dist0 =
cwArc(theta0, theta1);
118 dist1 =
cwArc(theta0, _PI - theta1);
120 dist1 =
cwArc(theta0, -_PI - theta1);
121 Format_t arc0 = dist0;
122 std::min(dist0, dist1);
135 if (Y > c[1]) target = _PI;
139 Format_t arc0 =
cwArc(theta0, target);
142 Format_t d1 = std::abs(Y - c[1]);
150 return bestOf(solveLS(q0, h, r), solveRS(q0, h, r), r);
159 #endif // MPBLOCKS_DUBINS_CURVES_EIGEN_HYPER_ONE_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...
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)