提交 f25484e9 编写于 作者: J Jiangtao Hu 提交者: lianglia-apollo

fix routing file loading problem.

上级 6758a7c0
......@@ -59,6 +59,7 @@ void EMPlanner::RegisterOptimizers() {
}
Status EMPlanner::Init(const PlanningConfig& config) {
AINFO << "In EMPlanner::Init()";
RegisterOptimizers();
for (int i = 0; i < config.em_planner_config().optimizer_size(); ++i) {
optimizers_.emplace_back(optimizer_factory_.CreateObject(
......@@ -157,6 +158,7 @@ Status EMPlanner::GenerateReferenceLineFromRouting(
for (const auto& lane : routing_result.route()) {
hdmap::Id lane_id;
lane_id.set_id(lane.id());
ADEBUG << "Added lane from routing:" << lane.id();
lane_info_ptr = map.get_lane_by_id(lane_id);
if (!lane_info_ptr) {
std::string msg("failed to find lane " + lane.id() + " from map ");
......@@ -184,6 +186,7 @@ Status EMPlanner::GenerateReferenceLineFromRouting(
AERROR << msg;
return Status(ErrorCode::PLANNING_ERROR, msg);
}
ADEBUG << "smooth reference points num:" << smoothed_ref_points.size();
reference_line_.reset(new ReferenceLine(smoothed_ref_points));
return Status::OK();
}
......
......@@ -62,7 +62,7 @@ Status Planning::Init() {
"planning is not initialized with config : " + config_.DebugString());
}
return Status::OK();
return planner_->Init(config_);
}
Status Planning::Start() {
......
......@@ -19,11 +19,12 @@ using apollo::common::ErrorCode;
apollo::common::Status RoutingProxy::Init() {
// FIXME(all): change to use real routing server
std::string routing_file("modules/map/data/garage.pb.txt");
std::string routing_file("modules/map/data/garage_routing.pb.txt");
if (!::apollo::common::util::GetProtoFromFile(routing_file, &routing_)) {
return Status(ErrorCode::PLANNING_ERROR,
"Unable to load routing file: " + routing_file);
std::string msg("Unable to load routing file: " + routing_file);
AERROR << msg;
return Status(ErrorCode::PLANNING_ERROR, msg);
}
return Status::OK();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册