00001 /* 00002 * Copyright 2016 The Cartographer Authors 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #include "cartographer/mapping/internal/constraints/constraint_builder.h" 00018 00019 #include "cartographer/mapping/internal/2d/scan_matching/ceres_scan_matcher_2d.h" 00020 #include "cartographer/mapping/internal/2d/scan_matching/fast_correlative_scan_matcher_2d.h" 00021 #include "cartographer/mapping/internal/3d/scan_matching/ceres_scan_matcher_3d.h" 00022 #include "cartographer/mapping/internal/3d/scan_matching/fast_correlative_scan_matcher_3d.h" 00023 #include "cartographer/sensor/internal/voxel_filter.h" 00024 00025 namespace cartographer { 00026 namespace mapping { 00027 namespace constraints { 00028 00029 proto::ConstraintBuilderOptions CreateConstraintBuilderOptions( 00030 common::LuaParameterDictionary* const parameter_dictionary) { 00031 proto::ConstraintBuilderOptions options; 00032 options.set_sampling_ratio(parameter_dictionary->GetDouble("sampling_ratio")); 00033 options.set_max_constraint_distance( 00034 parameter_dictionary->GetDouble("max_constraint_distance")); 00035 options.set_min_score(parameter_dictionary->GetDouble("min_score")); 00036 options.set_global_localization_min_score( 00037 parameter_dictionary->GetDouble("global_localization_min_score")); 00038 options.set_loop_closure_translation_weight( 00039 parameter_dictionary->GetDouble("loop_closure_translation_weight")); 00040 options.set_loop_closure_rotation_weight( 00041 parameter_dictionary->GetDouble("loop_closure_rotation_weight")); 00042 options.set_log_matches(parameter_dictionary->GetBool("log_matches")); 00043 *options.mutable_fast_correlative_scan_matcher_options() = 00044 scan_matching::CreateFastCorrelativeScanMatcherOptions2D( 00045 parameter_dictionary->GetDictionary("fast_correlative_scan_matcher") 00046 .get()); 00047 *options.mutable_ceres_scan_matcher_options() = 00048 scan_matching::CreateCeresScanMatcherOptions2D( 00049 parameter_dictionary->GetDictionary("ceres_scan_matcher").get()); 00050 *options.mutable_fast_correlative_scan_matcher_options_3d() = 00051 scan_matching::CreateFastCorrelativeScanMatcherOptions3D( 00052 parameter_dictionary 00053 ->GetDictionary("fast_correlative_scan_matcher_3d") 00054 .get()); 00055 *options.mutable_ceres_scan_matcher_options_3d() = 00056 scan_matching::CreateCeresScanMatcherOptions3D( 00057 parameter_dictionary->GetDictionary("ceres_scan_matcher_3d").get()); 00058 return options; 00059 } 00060 00061 } // namespace constraints 00062 } // namespace mapping 00063 } // namespace cartographer