Apollo 10.0
自动驾驶开放平台
base_map_config.h
浏览该文件的文档.
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
28namespace apollo {
29namespace localization {
30namespace msf {
31namespace pyramid_map {
32
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);
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);
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
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
std::vector< std::string > map_datasets_
The datasets that contributed to the map.
bool Save(const std::string &file_path)
Save the map option to a XML file.
unsigned int map_node_size_y_
The map node size in pixels.
void SetMapNodeSize(unsigned int size_x, unsigned int size_y)
Set map_node_size.
virtual bool CreateXml(boost::property_tree::ptree *config) const
Create the XML structure.
std::vector< float > map_resolutions_
The pixel resolutions in the map in meters.
Rect2D< double > map_range_
The minimum and maximum UTM range in the map.
virtual bool LoadXml(const boost::property_tree::ptree &config)
Load the map options from a XML structure.
void AddNodeMd5(const std::string &node_path, const std::string &md5)
Add a node md5 pair.
bool Load(const std::string &file_path)
Load the map option from a XML file.
float map_ground_height_offset_
Velodyne's height to the ground.
void SetNodeMd5Map(const std::map< std::string, std::string > &node_md5_map)
Set node_md5_map.
void SetGroundHeightOffset(float map_ground_height_offset)
Set map_ground_height_offset.
unsigned int map_node_size_x_
The map node size in pixels.
std::map< std::string, std::string > node_md5_map_
The map structure to store map node file name and its md5.
void ResizeMapRange()
Resize map range by range and resolutions.
void SetSingleResolutions(float resolution=0.125)
Set single resolutions.
void SetMapVersion(const std::string &map_version)
Set map_version.
void SetIsCompression(bool map_is_compression)
Set map_is_compression.
class register implement
Definition arena_queue.h:37