26 #include "gmock/gmock.h" 27 #include "gtest/gtest.h" 31 namespace constraints {
39 class ConstraintBuilder2DTest :
public ::testing::Test {
41 void SetUp()
override {
43 include "pose_graph.lua" 44 POSE_GRAPH.constraint_builder.sampling_ratio = 1 45 POSE_GRAPH.constraint_builder.min_score = 0 46 POSE_GRAPH.constraint_builder.global_localization_min_score = 0 47 return POSE_GRAPH.constraint_builder)text"); 58 TEST_F(ConstraintBuilder2DTest, CallsBack) { 60 EXPECT_CALL(mock_, Run(testing::IsEmpty())); 68 TEST_F(ConstraintBuilder2DTest, FindsConstraints) { 69 TrajectoryNode::Data node_data; 70 node_data.filtered_gravity_aligned_point_cloud.push_back( 71 Eigen::Vector3f(0.1, 0.2, 0.3)); 72 node_data.gravity_alignment = Eigen::Quaterniond::Identity(); 74 SubmapId submap_id{0, 1}; 75 MapLimits map_limits(1., Eigen::Vector2d(2., 3.), CellLimits(100, 110)); 76 Submap2D submap(Eigen::Vector2f(4.f, 5.f), 77 common::make_unique<ProbabilityGrid>(map_limits)); 78 int expected_nodes = 0;
79 for (
int i = 0; i < 2; ++i) {
81 for (
int j = 0; j < 2; ++j) {
97 testing::Each(testing::Field(
common::testing::ThreadPoolForTesting thread_pool_
std::vector< Constraint > Result
std::unique_ptr< ConstraintBuilder2D > constraint_builder_
enum cartographer::mapping::PoseGraphInterface::Constraint::Tag tag
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)