提交 98d5a7b7 编写于 作者: A Aaron Xiao 提交者: Lei Wang

Map: Refactor to use map_dir to config map data bundle. (#900)

* Map: Refactor to use map_dir to config map data bundle.

* Map: Code style fix.

* Hot fix.
上级 05a10065
......@@ -19,5 +19,11 @@
DEFINE_string(map_file_path, "modules/map/data/base_map.txt",
"the file path of map data file");
DEFINE_string(map_dir, "modules/map/data",
"Directory which contains a group of related maps.");
DEFINE_string(base_map_filename, "base_map.txt",
"Base map file which locates in the map_dir.");
DEFINE_string(vehicle_config_path, "modules/common/data/mkz_config.pb.txt",
"the file path of vehicle config file");
......@@ -19,8 +19,14 @@
#include "gflags/gflags.h"
// TODO(xiangquan): To be deprecated.
DECLARE_string(map_file_path);
// The directory which contains a group of related maps, such as base_map,
// sim_map, routing_topo_grapth, etc.
DECLARE_string(map_dir);
DECLARE_string(base_map_filename);
DECLARE_string(vehicle_config_path);
#endif // MODULES_COMMON_CONFIGS_GFLAGS_H_
......@@ -6,4 +6,5 @@
# are evaluated strictly in order.
--map_file_path=modules/map/data/base_map.txt
--map_dir=modules/map/data
--vehicle_config_path=modules/common/data/mkz_config.pb.txt
......@@ -13,6 +13,7 @@ cc_library(
"hdmap.h",
"hdmap_common.h",
"hdmap_impl.h",
"hdmap_util.h",
],
deps = [
"//modules/common:macro",
......
/* Copyright 2017 The Apollo Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=========================================================================*/
#ifndef MODULES_MAP_HDMAP_HDMAP_UTIL_H
#define MODULES_MAP_HDMAP_HDMAP_UTIL_H
#include <string>
#include "modules/common/configs/config_gflags.h"
#include "modules/common/util/string_util.h"
/**
* @namespace apollo::hdmap
* @brief apollo::hdmap
*/
namespace apollo {
namespace hdmap {
/**
* @brief get base map file path from flags.
* @return base map path
*/
inline std::string BaseMapFile() {
return apollo::common::util::StrCat(
FLAGS_map_dir, "/", FLAGS_base_map_filename);
}
} // namespace hdmap
} // namespace apollo
#endif // MODULES_MAP_HDMAP_HDMAP_UTIL_H
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册