27 #ifndef MPBLOCKS_DUBINS_CURVES_CUDA2_SOLUTION_RLR_A_HPP_
28 #define MPBLOCKS_DUBINS_CURVES_CUDA2_SOLUTION_RLR_A_HPP_
35 namespace curves_cuda {
39 template <
typename Format_t>
63 template <
typename Format_t>
70 using namespace cuda::linalg2;
72 const Format_t _PI =
static_cast<Format_t
>(M_PI);
73 const Format_t
_2 =
static_cast<Format_t
>(2);
74 const Format_t
_4 =
static_cast<Format_t
>(4);
80 v << Dispatch::sin( get<2>(q0) ),
81 -Dispatch::cos( get<2>(q0) );
86 v << Dispatch::sin( get<2>( q1) ),
87 -Dispatch::cos( get<2>( q1) );
91 Format_t d =
norm(c[0]-c[1]);
100 Format_t
a = -Dispatch::acos( d / (4*r) );
121 b = Dispatch::atan2( get<1>(dc), get<0>(dc) );
129 b = Dispatch::atan2( get<1>(dc), get<0>(dc) );
143 for(
int i=0; i < 3; i++)
162 template <
typename Format_t>
170 using namespace cuda::linalg2;
172 const Format_t _PI =
static_cast<Format_t
>(M_PI);
173 const Format_t
_2 =
static_cast<Format_t
>(2);
174 const Format_t
_4 =
static_cast<Format_t
>(4);
180 v << Dispatch::sin( get<2>(q0) ),
181 -Dispatch::cos( get<2>(q0) );
186 v << Dispatch::sin( get<2>( q1) ),
187 -Dispatch::cos( get<2>( q1) );
191 Format_t d =
norm(c[0]-c[1]);
200 Format_t
a = -Dispatch::acos( d / (4*r) );
221 b = Dispatch::atan2( get<1>(dc), get<0>(dc) );
229 b = Dispatch::atan2( get<1>(dc), get<0>(dc) );
243 for(
int i=0; i < 3; i++)
249 for(
int i=0; i < 3; i++)
276 #endif // SOLUTIONLRLA_H_
const CoefficientKey< 4 > _4
__host__ __device__ Format_t cwArc(Format_t a, Format_t b)
returns the clockwise (right) distance from a to b
__device__ __host__ Normalize< Scalar, Exp > normalize(RValue< Scalar, Exp > const &A)
empty struct used to template "variant" of three arc primitives
__device__ __host__ Matrix< Scalar, ROWS, COLS > mktmp(RValue< Scalar, ROWS, COLS, Exp > const &M)
forces the creation of a temporary
empty struct used to template "variant" of three arc primitives
empty struct used to template "right turn" primitive
Encapsulates the solution distance along with a feasibility bit for a particular primitive solution...
__host__ __device__ Format_t clampRadian(Format_t a)
wraps the input onto [-pi,pi]
__device__ __host__ Scalar norm(const RValue< Scalar, ROWS, COLS, Exp > &M)
compute the norm
static Result< Format_t > solve(const Vector3d_t &q0, const Vector3d_t &q1, const Format_t r)
basic interface returns only the total distance
interface for different solutions