Apollo  6.0
Open source self driving car software
base_map_config.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2019 The Apollo Authors. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *****************************************************************************/
16 #pragma once
17 
18 #include <map>
19 #include <string>
20 #include <vector>
21 
22 #include <boost/property_tree/ptree.hpp>
23 #include <boost/property_tree/xml_parser.hpp>
24 
27 
28 namespace apollo {
29 namespace localization {
30 namespace msf {
31 namespace pyramid_map {
32 
33 enum class MapVersion {
34  UNKNOWN,
39 };
40 
43  public:
45  explicit BaseMapConfig(const std::string &map_version = "0.1");
47  virtual ~BaseMapConfig();
49  bool Save(const std::string &file_path);
51  bool Load(const std::string &file_path);
53  void SetMapVersion(const std::string &map_version);
55  void SetMapNodeSize(unsigned int size_x, unsigned int size_y);
57  void SetGroundHeightOffset(float map_ground_height_offset);
59  void SetIsCompression(bool map_is_compression);
61  void ResizeMapRange();
63  void SetSingleResolutions(float resolution = 0.125);
65  void SetMultiResolutions();
67  void SetNodeMd5Map(const std::map<std::string, std::string> &node_md5_map);
69  void AddNodeMd5(const std::string &node_path, const std::string &md5);
71  MapVersion GetMapVersion() const;
72 
74  std::string map_version_ = "";
76  std::vector<float> map_resolutions_;
78  unsigned int map_node_size_x_ = 0;
80  unsigned int map_node_size_y_ = 0;
86 
89  float map_ground_height_offset_ = 0.0f;
91  bool map_is_compression_ = false;
92 
94  std::string map_folder_path_ = "";
96  std::vector<std::string> map_datasets_;
99  std::map<std::string, std::string> node_md5_map_;
100 
101  std::string coordinate_type_ = "";
102 
103  protected:
105  virtual bool CreateXml(boost::property_tree::ptree *config) const;
107  virtual bool LoadXml(const boost::property_tree::ptree &config);
108 };
109 
110 } // namespace pyramid_map
111 } // namespace msf
112 } // namespace localization
113 } // namespace apollo
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
std::vector< float > map_resolutions_
The pixel resolutions in the map in meters.
Definition: base_map_config.h:76
SIMD_INLINE __m256i Load(const __m256i *p)
Rect2D< double > map_range_
The minimum and maximum UTM range in the map. The x direction is the easting in UTM coordinate...
Definition: base_map_config.h:85
std::map< std::string, std::string > node_md5_map_
The map structure to store map node file name and its md5. key:map node file name; value: md5 of map...
Definition: base_map_config.h:99
The options of the reflectance map.
Definition: base_map_config.h:42
std::vector< std::string > map_datasets_
The datasets that contributed to the map.
Definition: base_map_config.h:96
MapVersion
Definition: base_map_config.h:33