From d25d884596fa546dd0b85feec0a7acb485cc1997 Mon Sep 17 00:00:00 2001 From: Aaron Xiao Date: Sat, 16 Sep 2017 11:44:55 +0800 Subject: [PATCH] HDMap: Fallback to a default map path if none candidates exist. --- modules/map/hdmap/hdmap_util.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/map/hdmap/hdmap_util.cc b/modules/map/hdmap/hdmap_util.cc index c2102bad68..45984f7942 100644 --- a/modules/map/hdmap/hdmap_util.cc +++ b/modules/map/hdmap/hdmap_util.cc @@ -33,8 +33,10 @@ std::string FindFirstExist(const std::string& dir, const std::string& files) { return file_path; } } - AERROR << "No existing file found in " << dir << "/" << files; - return ""; + AERROR << "No existing file found in " << dir << "/" << files << ". " + "Fallback to first candidate as default result."; + CHECK(!candidates.empty()) << "Please specify at least one map."; + return apollo::common::util::StrCat(FLAGS_map_dir, "/", candidates[0]); } } // namespace -- GitLab