34 #include <gtest/gtest.h>
42 TEST(BeamModel, LikelihoodFunc)
44 pcl::PointCloud<mcl_3dl::LidarMeasurementModelBase::PointType> pc;
45 for (
float y = -0.2; y <= 0.2; y += 0.1)
47 for (
float z = -0.2; z <= 0.2; z += 0.1)
56 pcl::PointCloud<mcl_3dl::LidarMeasurementModelBase::PointType> pc_map = pc;
74 for (
int method = 0; method < 2; ++method)
76 for (
int mode = 0; mode < 2; ++mode)
78 for (
double hr = 0.0; hr <= 1.0; hr += 0.2)
81 pnh.
setParam(
"beam/num_points",
static_cast<int>(pc.size()));
82 pnh.
setParam(
"beam/beam_likelihood", 0.2);
84 pnh.
setParam(
"beam/use_raycast_using_dda", method == 1);
85 pnh.
setParam(
"beam/add_penalty_short_only_mode", mode == 1);
86 pnh.
setParam(
"beam/dda_grid_size", 0.1);
91 std::cerr <<
"use_raycast_using_dda: " << (method == 1) <<
", ";
92 std::cerr <<
"add_penalty_short_only_mode: " << (mode == 1) <<
", ";
93 std::cerr <<
"hit_range: " << hr << std::endl;
94 for (
int i = -50; i < 50; i++)
103 std::cerr << std::endl;
104 for (
int i = -50; i < 50; i++)
106 const float x = 0.1 * i;
108 const std::vector<mcl_3dl::Vec3> origins = {pos};
110 kdtree, pc.makeShared(), origins,
129 std::cerr << std::endl;
130 for (
int i = -50; i < 50; i++)
132 const float x = 0.1 * i;
153 std::cerr << std::endl;
159 int main(
int argc,
char** argv)
161 testing::InitGoogleTest(&argc, argv);
162 ros::init(argc, argv,
"test_beam_likelihood");
164 return RUN_ALL_TESTS();