26 #ifndef MPBLOCKS_DUBINS_CURVES_EIGEN_SOLUTION_RLR_A_HPP_
27 #define MPBLOCKS_DUBINS_CURVES_EIGEN_SOLUTION_RLR_A_HPP_
35 namespace curves_eigen {
49 template <
typename Scalar>
67 Scalar d = (c[0] - c[2]).
norm();
83 Scalar
a = acos(d / (4 * r));
86 Eigen::Rotation2D<Scalar>
R(-a);
92 c[1] = c[0] + R * (c[2] - c[0]).
normalized() * 2 * r;
97 Scalar a1 = std::atan2(dc[1], dc[0]);
105 a0 = std::atan2(dc[1], dc[0]);
107 s[2] =
cwArc(a0, a1);
118 #endif // MPBLOCKS_DUBINS_CURVES_EIGEN_SOLUTION_RLR_A_HPP_
__host__ __device__ Format_t cwArc(Format_t a, Format_t b)
returns the clockwise (right) distance from a to b
Eigen::Matrix< Scalar, 2, 1 > Vector2d
Matrix< double, 3, 1 > Vector3d
empty struct used to template "variant" of three arc primitives
empty struct used to template "right turn" primitive
Scalar rightAngleOf(const Scalar q_theta)
return the angle of the vector from the center of the clockwise (right) circle coincident to q...
interface for different solutions, this is specialized for each Id in the SolutionId enum ...
__device__ __host__ Scalar norm(const RValue< Scalar, ROWS, COLS, Exp > &M)
compute the norm
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
__host__ __device__ Normalized< Scalar, Exp, Spec > normalized(const RValue< Scalar, Exp, Spec > &exp)
Encodes a dubins path primitive, which is three connected arc segments.
Eigen::Matrix< Scalar, 3, 1 > Vector3d
static Path< Scalar > solve(const Vector3d &q0, const Vector3d &q1, const Scalar r)