27 #include "gmock/gmock.h" 28 #include "gtest/gtest.h" 32 namespace constraints {
40 class ConstraintBuilder3DTest :
public ::testing::Test {
42 void SetUp()
override {
44 include "pose_graph.lua" 45 POSE_GRAPH.constraint_builder.sampling_ratio = 1 46 POSE_GRAPH.constraint_builder.min_score = 0 47 POSE_GRAPH.constraint_builder.global_localization_min_score = 0 48 POSE_GRAPH.constraint_builder.fast_correlative_scan_matcher_3d.min_low_resolution_score = 0 49 POSE_GRAPH.constraint_builder.fast_correlative_scan_matcher_3d.min_rotational_score = 0 50 return POSE_GRAPH.constraint_builder)text"); 61 TEST_F(ConstraintBuilder3DTest, CallsBack) { 63 EXPECT_CALL(mock_, Run(testing::IsEmpty())); 71 TEST_F(ConstraintBuilder3DTest, FindsConstraints) { 73 auto node_data = std::make_shared<TrajectoryNode::Data>();
74 node_data->gravity_alignment = Eigen::Quaterniond::Identity();
75 node_data->high_resolution_point_cloud.push_back(
76 Eigen::Vector3f(0.1, 0.2, 0.3));
77 node_data->low_resolution_point_cloud.push_back(
78 Eigen::Vector3f(0.1, 0.2, 0.3));
79 node_data->rotational_scan_matcher_histogram = Eigen::VectorXf::Zero(3);
81 node.constant_data = node_data;
82 std::vector<TrajectoryNode> submap_nodes = {node};
83 SubmapId submap_id{0, 1};
85 int expected_nodes = 0;
86 for (
int i = 0; i < 2; ++i) {
88 for (
int j = 0; j < 2; ++j) {
90 submap_id, &submap, NodeId{}, node.constant_data.get(), submap_nodes,
94 submap_id, &submap, NodeId{}, node.constant_data.get(), submap_nodes,
95 Eigen::Quaterniond::Identity(), Eigen::Quaterniond::Identity());
105 testing::Each(testing::Field(
std::vector< Constraint > Result
enum cartographer::mapping::PoseGraphInterface::Constraint::Tag tag
std::unique_ptr< ConstraintBuilder3D > constraint_builder_
proto::ConstraintBuilderOptions CreateConstraintBuilderOptions(common::LuaParameterDictionary *const parameter_dictionary)
void Run(const std::string &configuration_directory, const std::string &configuration_basename)
std::unique_ptr<::cartographer::common::LuaParameterDictionary > ResolveLuaParameters(const std::string &lua_code)
common::testing::ThreadPoolForTesting thread_pool_