submap_controller.cc
Go to the documentation of this file.
00001 /*
00002  * Copyright 2018 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/submap_controller.h"
00018 
00019 namespace cartographer {
00020 namespace mapping {
00021 
00022 template <>
00023 std::shared_ptr<mapping::Submap2D>
00024 SubmapController<mapping::Submap2D>::CreateSubmap(
00025     const mapping::proto::Submap& proto) {
00026   if (proto.submap_2d().num_range_data() != 1) {
00027     LOG(WARNING) << "Refusing to create partially filled submap: "
00028                  << proto.submap_2d().num_range_data();
00029     return nullptr;
00030   }
00031   return std::make_shared<mapping::Submap2D>(proto.submap_2d(),
00032                                              &conversion_tables_);
00033 }
00034 
00035 template <>
00036 std::shared_ptr<mapping::Submap3D>
00037 SubmapController<mapping::Submap3D>::CreateSubmap(
00038     const mapping::proto::Submap& proto) {
00039   if (proto.submap_3d().num_range_data() != 1) {
00040     LOG(INFO) << "Refusing to create partially filled submap: "
00041               << proto.submap_3d().num_range_data();
00042     return nullptr;
00043   }
00044   return std::make_shared<mapping::Submap3D>(proto.submap_3d());
00045 }
00046 
00047 }  // namespace mapping
00048 }  // namespace cartographer


cartographer
Author(s): The Cartographer Authors
autogenerated on Thu May 9 2019 02:27:36