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/2d/local_trajectory_builder_options_2d.h" 00018 00019 #include "cartographer/mapping/2d/submap_2d.h" 00020 #include "cartographer/mapping/internal/2d/scan_matching/ceres_scan_matcher_2d.h" 00021 #include "cartographer/mapping/internal/motion_filter.h" 00022 #include "cartographer/mapping/internal/scan_matching/real_time_correlative_scan_matcher.h" 00023 #include "cartographer/sensor/internal/voxel_filter.h" 00024 00025 namespace cartographer { 00026 namespace mapping { 00027 00028 proto::LocalTrajectoryBuilderOptions2D CreateLocalTrajectoryBuilderOptions2D( 00029 common::LuaParameterDictionary* const parameter_dictionary) { 00030 proto::LocalTrajectoryBuilderOptions2D options; 00031 options.set_min_range(parameter_dictionary->GetDouble("min_range")); 00032 options.set_max_range(parameter_dictionary->GetDouble("max_range")); 00033 options.set_min_z(parameter_dictionary->GetDouble("min_z")); 00034 options.set_max_z(parameter_dictionary->GetDouble("max_z")); 00035 options.set_missing_data_ray_length( 00036 parameter_dictionary->GetDouble("missing_data_ray_length")); 00037 options.set_num_accumulated_range_data( 00038 parameter_dictionary->GetInt("num_accumulated_range_data")); 00039 options.set_voxel_filter_size( 00040 parameter_dictionary->GetDouble("voxel_filter_size")); 00041 options.set_use_online_correlative_scan_matching( 00042 parameter_dictionary->GetBool("use_online_correlative_scan_matching")); 00043 *options.mutable_adaptive_voxel_filter_options() = 00044 sensor::CreateAdaptiveVoxelFilterOptions( 00045 parameter_dictionary->GetDictionary("adaptive_voxel_filter").get()); 00046 *options.mutable_loop_closure_adaptive_voxel_filter_options() = 00047 sensor::CreateAdaptiveVoxelFilterOptions( 00048 parameter_dictionary 00049 ->GetDictionary("loop_closure_adaptive_voxel_filter") 00050 .get()); 00051 *options.mutable_real_time_correlative_scan_matcher_options() = 00052 mapping::scan_matching::CreateRealTimeCorrelativeScanMatcherOptions( 00053 parameter_dictionary 00054 ->GetDictionary("real_time_correlative_scan_matcher") 00055 .get()); 00056 *options.mutable_ceres_scan_matcher_options() = 00057 mapping::scan_matching::CreateCeresScanMatcherOptions2D( 00058 parameter_dictionary->GetDictionary("ceres_scan_matcher").get()); 00059 *options.mutable_motion_filter_options() = mapping::CreateMotionFilterOptions( 00060 parameter_dictionary->GetDictionary("motion_filter").get()); 00061 options.set_imu_gravity_time_constant( 00062 parameter_dictionary->GetDouble("imu_gravity_time_constant")); 00063 *options.mutable_submaps_options() = CreateSubmapsOptions2D( 00064 parameter_dictionary->GetDictionary("submaps").get()); 00065 options.set_use_imu_data(parameter_dictionary->GetBool("use_imu_data")); 00066 return options; 00067 } 00068 00069 } // namespace mapping 00070 } // namespace cartographer