Apollo  6.0
Open source self driving car software
base_map_config.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2018 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 
17 #pragma once
18 
19 #include <string>
20 #include <vector>
21 
22 #include <boost/property_tree/xml_parser.hpp>
23 
26 
27 namespace apollo {
28 namespace localization {
29 namespace msf {
30 
33  public:
35  explicit BaseMapConfig(std::string map_version = "0.1");
37  bool Save(const std::string file_path);
39  bool Load(const std::string file_path);
41  void ResizeMapRange();
43  void SetSingleResolutions(float resolution = 0.125);
45  void SetMultiResolutions();
46 
48  std::string map_version_;
50  std::vector<float> map_resolutions_;
52  unsigned int map_node_size_x_;
54  unsigned int map_node_size_y_;
61 
67 
69  std::string map_folder_path_;
71  std::vector<std::string> map_datasets_;
72 
73  protected:
75  virtual void CreateXml(boost::property_tree::ptree* config) const;
77  virtual void LoadXml(const boost::property_tree::ptree& config);
78 };
79 
80 } // namespace msf
81 } // namespace localization
82 } // namespace apollo
bool map_is_compression_
Enable the compression.
Definition: base_map_config.h:66
The options of the reflectance map.
Definition: base_map_config.h:32
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
float map_ground_height_offset_
Velodyne&#39;s height to the ground. Estimate the Velodyne&#39;s height based on the ground height...
Definition: base_map_config.h:64
unsigned int map_node_size_y_
The map node size in pixels.
Definition: base_map_config.h:54
virtual void LoadXml(const boost::property_tree::ptree &config)
Load the map options from a XML structure.
std::string map_version_
The version of map.
Definition: base_map_config.h:48
std::string map_folder_path_
The map folder path.
Definition: base_map_config.h:69
std::vector< float > map_resolutions_
The pixel resolutions in the map in meters.
Definition: base_map_config.h:50
void ResizeMapRange()
Resize map range by range and resolutions.
virtual void CreateXml(boost::property_tree::ptree *config) const
Create the XML structure.
void SetMultiResolutions()
Set multi resolutions.
BaseMapConfig(std::string map_version="0.1")
The constructor gives the default map settings.
bool Save(const std::string file_path)
Save the map option to a XML file.
Rect2D< double > map_range_
The minimum and maximum UTM range in the map.
Definition: base_map_config.h:60
void SetSingleResolutions(float resolution=0.125)
Set single resolutions.
unsigned int map_node_size_x_
The map node size in pixels.
Definition: base_map_config.h:52
std::vector< std::string > map_datasets_
The datasets that contributed to the map.
Definition: base_map_config.h:71
bool Load(const std::string file_path)
Load the map option from a XML file.