34 #include <boost/chrono.hpp> 41 std::cerr <<
"## Chunk size: " << chunk_size << std::endl;
42 const auto ts = boost::chrono::high_resolution_clock::now();
43 pcl::PointCloud<pcl::PointXYZ> pc;
44 for (
float y = -50.0;
y < 50.0;
y += 0.1)
46 for (
float z = -50.0;
z < 50.0;
z += 0.1)
48 pc.push_back(pcl::PointXYZ(5.0,
y,
z));
49 pc.push_back(pcl::PointXYZ(
y + 10.0, 1.5,
z));
55 const auto tnow = boost::chrono::high_resolution_clock::now();
56 std::cerr <<
"- Generate kdtree: " 57 << boost::chrono::duration<float>(tnow - ts).count()
58 <<
" sec" << std::endl;
60 const auto ts2 = boost::chrono::high_resolution_clock::now();
61 size_t collision_cnt = 0;
63 for (
float y = -50.0;
y < 50.0;
y += 1.2)
65 for (
float z = -50.0;
z < 50.0;
z += 1.1)
71 for (
auto point : ray)
81 std::cerr <<
"- Collisions: " << collision_cnt <<
"/" << cnt << std::endl;
82 const auto tnow2 = boost::chrono::high_resolution_clock::now();
83 std::cerr <<
"- mcl_3dl::Raycast: " 84 << boost::chrono::duration<float>(tnow2 - ts2).count()
85 <<
" sec" << std::endl;
86 std::cerr << std::endl;
89 int main(
int argc,
char** argv)
std::shared_ptr< ChunkedKdtree > Ptr
TFSIMD_FORCE_INLINE const tfScalar & y() const
void setInputCloud(const typename pcl::PointCloud< POINT_TYPE >::ConstPtr cloud)
TFSIMD_FORCE_INLINE const tfScalar & z() const