30 #ifndef MCL_3DL_RAYCASTS_RAYCAST_USING_KDTREE_H 31 #define MCL_3DL_RAYCASTS_RAYCAST_USING_KDTREE_H 43 template <
typename POINT_TYPE>
49 RaycastUsingKDTree(
const float map_grid_size_x,
const float map_grid_size_y,
const float map_grid_size_z,
50 const float hit_tolerance)
54 ,
map_grid_max_(std::max({ map_grid_size_x, map_grid_size_y, map_grid_size_z }))
74 bool collision(
false);
77 const POINT_TYPE* point =
nullptr;
82 std::vector<int> id(1);
83 std::vector<float> sqdist(1);
87 point = &(
kdtree_->getInputCloud()->points[
id[0]]);
89 const float d0 = std::sqrt(sqdist[0]);
91 POINT_TYPE center_prev;
92 center_prev.x = pos_prev.
x_;
93 center_prev.y = pos_prev.
y_;
94 center_prev.z = pos_prev.
z_;
97 const float d1 = std::sqrt(sqdist[0]);
125 #endif // MCL_3DL_RAYCASTS_RAYCAST_USING_KDTREE_H
RaycastUsingKDTree(const float map_grid_size_x, const float map_grid_size_y, const float map_grid_size_z, const float hit_tolerance)
const float map_grid_max_
std::shared_ptr< ChunkedKdtree > Ptr
ChunkedKdtree< POINT_TYPE >::Ptr kdtree_
void setRay(typename ChunkedKdtree< POINT_TYPE >::Ptr kdtree, const Vec3 ray_begin, const Vec3 ray_end) final
TFSIMD_FORCE_INLINE Vector3 normalized() const
bool getNextCastResult(CastResult &result) final
const float hit_tolerance_
const float map_grid_min_
double min(double a, double b)