15 #include <gtest/gtest.h>
26 #include <range/v3/range/conversion.hpp>
27 #include <range/v3/view/transform.hpp>
45 return std::transform_reduce(
46 landmark_probs.cbegin(), landmark_probs.cend(), 1.0, std::multiplies{}, [](
const double v) { return v; });
56 auto make_sensor_data(std::vector<std::tuple<double, double, double, uint32_t>> detections) {
57 const auto conversion_function = [](
const auto& t) {
58 const auto [x, y, z, category] = t;
61 return detections | ranges::views::transform(conversion_function) | ranges::to<std::vector>;
90 const auto pose = get_robot_pose_in_world<typename TypeParam::state_type>();
94 auto state_weighting_function = sensor_model({{{1.0, 0.0, 0.0}, 0}});
99 const auto pose = get_robot_pose_in_world<typename TypeParam::state_type>();
104 auto state_weighting_function = sensor_model({{{1.0, 0.0, 0.0}, 0}});
106 ASSERT_NO_THROW(sensor_model.update_map(std::move(map_2)));
112 const auto sensor_model = TypeParam{
117 {{1.0, -2.0, 0.0}, 0},
118 {{1.0, -2.0, 1.0}, 1},
119 {{1.0, -2.0, 2.0}, 2},
122 const auto state_weighting_function = sensor_model({
123 {{+1.0, +0.0, -1.0}, 0},
124 {{+1.0, +0.0, +0.0}, 1},
125 {{+1.0, +0.0, +1.0}, 2},
128 const auto pose = get_robot_pose_in_world<typename TypeParam::state_type>();
133 const auto pose = get_robot_pose_in_world<typename TypeParam::state_type>();
139 auto state_weighting_function = sensor_model({{{1.0, 0.0, 0.0}, 0}});
144 auto state_weighting_function = sensor_model({{{1.0, 1.0, 0.0}, 0}});
149 auto state_weighting_function = sensor_model({{{1.0, -1.0, 0.0}, 0}});
154 auto state_weighting_function = sensor_model({{{1.0, 0.0, 1.0}, 0}});
159 auto state_weighting_function = sensor_model({{{1.0, 0.0, -1.0}, 0}});
168 const auto state_weighting_function = sensor_model({{{1.0, 0.0, 0.0}, 99}});
169 const auto pose = get_robot_pose_in_world<typename TypeParam::state_type>();