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 #ifndef CARTOGRAPHER_MAPPING_3D_RANGE_DATA_INSERTER_3D_H_ 00018 #define CARTOGRAPHER_MAPPING_3D_RANGE_DATA_INSERTER_3D_H_ 00019 00020 #include "cartographer/mapping/3d/hybrid_grid.h" 00021 #include "cartographer/mapping/proto/3d/range_data_inserter_options_3d.pb.h" 00022 #include "cartographer/sensor/point_cloud.h" 00023 #include "cartographer/sensor/range_data.h" 00024 00025 namespace cartographer { 00026 namespace mapping { 00027 00028 proto::RangeDataInserterOptions3D CreateRangeDataInserterOptions3D( 00029 common::LuaParameterDictionary* parameter_dictionary); 00030 00031 class RangeDataInserter3D { 00032 public: 00033 explicit RangeDataInserter3D( 00034 const proto::RangeDataInserterOptions3D& options); 00035 00036 RangeDataInserter3D(const RangeDataInserter3D&) = delete; 00037 RangeDataInserter3D& operator=(const RangeDataInserter3D&) = delete; 00038 00039 // Inserts 'range_data' into 'hybrid_grid'. 00040 void Insert(const sensor::RangeData& range_data, 00041 HybridGrid* hybrid_grid) const; 00042 00043 private: 00044 const proto::RangeDataInserterOptions3D options_; 00045 const std::vector<uint16> hit_table_; 00046 const std::vector<uint16> miss_table_; 00047 }; 00048 00049 } // namespace mapping 00050 } // namespace cartographer 00051 00052 #endif // CARTOGRAPHER_MAPPING_3D_RANGE_DATA_INSERTER_3D_H_