From 6ad87fe087ed3690e00b2c9904528a6f01945099 Mon Sep 17 00:00:00 2001 From: Aaron Xiao Date: Thu, 27 Jul 2017 16:06:14 -0700 Subject: [PATCH] Combine Path and PathDebug. --- modules/common/proto/path_point.proto | 3 ++- modules/planning/planner/em/em_planner.cc | 12 ++++++------ modules/planning/proto/planning_internal.proto | 7 +------ 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/modules/common/proto/path_point.proto b/modules/common/proto/path_point.proto index 785fceb881..d5f67ab37f 100644 --- a/modules/common/proto/path_point.proto +++ b/modules/common/proto/path_point.proto @@ -38,7 +38,8 @@ message PathPoint { } message Path { - repeated PathPoint path_point = 1; + optional string name = 1; + repeated PathPoint path_point = 2; } message TrajectoryPoint { diff --git a/modules/planning/planner/em/em_planner.cc b/modules/planning/planner/em/em_planner.cc index bb22afa817..3d8ba4fc5b 100644 --- a/modules/planning/planner/em/em_planner.cc +++ b/modules/planning/planner/em/em_planner.cc @@ -113,8 +113,8 @@ Status EMPlanner::Plan(const TrajectoryPoint& start_point, auto* optimized_path = trajectory_pb->mutable_debug()->mutable_planning_data()->add_path(); optimized_path->set_name(optimizer->name()); - optimized_path->mutable_path()->mutable_path_point()->CopyFrom({ - path_points.begin(), path_points.end()}); + optimized_path->mutable_path_point()->CopyFrom({path_points.begin(), + path_points.end()}); } } } @@ -130,13 +130,13 @@ Status EMPlanner::Plan(const TrajectoryPoint& start_point, // Add debug information. if (FLAGS_enable_record_debug) { - auto* debug_reference_line = + auto* reference_line = trajectory_pb->mutable_debug()->mutable_planning_data()->add_path(); - debug_reference_line->set_name("planning_reference_line"); + reference_line->set_name("planning_reference_line"); const auto& reference_points = planning_data->reference_line().reference_points(); - debug_reference_line->mutable_path()->mutable_path_point()->CopyFrom({ - reference_points.begin(), reference_points.end()}); + reference_line->mutable_path_point()->CopyFrom({reference_points.begin(), + reference_points.end()}); } return Status::OK(); diff --git a/modules/planning/proto/planning_internal.proto b/modules/planning/proto/planning_internal.proto index d9207fe66b..49b7127a87 100644 --- a/modules/planning/proto/planning_internal.proto +++ b/modules/planning/proto/planning_internal.proto @@ -82,11 +82,6 @@ message LightSignal { optional TurnSignal turn_signal = 2 [default = NO_TURN]; } -message PathDebug { - optional string name = 1; - optional apollo.common.Path path = 2; -} - // next id: 12 message PlanningData { optional apollo.common.Header header = 1; @@ -101,7 +96,7 @@ message PlanningData { // processed planning_obstacles repeated PlanningObstacle planning_obstacle = 4; - repeated PathDebug path = 6; + repeated apollo.common.Path path = 6; optional apollo.localization.Pose init_status = 2 [deprecated = true]; // initial status of adc optional apollo.planning.MainDecision main_decision = 3 [deprecated = true]; -- GitLab