27 #ifndef MPBLOCKS_DUBINS_CURVES_CUDA2_SOLUTION_RLR_B_HPP_
28 #define MPBLOCKS_DUBINS_CURVES_CUDA2_SOLUTION_RLR_B_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) );
118 b = Dispatch::atan2( get<1>(dc), get<0>(dc) );
126 b = Dispatch::atan2( get<1>(dc), get<0>(dc) );
140 for(
int i=0; i < 3; i++)
158 template <
typename Format_t>
166 using namespace cuda::linalg2;
168 const Format_t _PI =
static_cast<Format_t
>(M_PI);
169 const Format_t
_2 =
static_cast<Format_t
>(2);
170 const Format_t
_4 =
static_cast<Format_t
>(4);
176 v << Dispatch::sin( get<2>(q0) ),
177 -Dispatch::cos( get<2>(q0) );
182 v << Dispatch::sin( get<2>(q1) ),
183 -Dispatch::cos( get<2>(q1) );
187 Format_t d =
norm(c[0]-c[1]);
196 Format_t
a = -Dispatch::acos( d / (
_4*r) );
214 b = Dispatch::atan2( get<1>(dc), get<0>(dc) );
222 b = Dispatch::atan2( get<1>(dc), get<0>(dc) );
236 for(
int i=0; i < 3; i++)
242 for(
int i=0; i < 3; i++)
272 #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