diff --git a/modules/planning/common/frame.cc b/modules/planning/common/frame.cc index 3664ca4cdc4633df8f6406826aecb7190fd73cae..ae8ff1467c7eb3a3a01dd2649dbf02b6f25a9b5c 100644 --- a/modules/planning/common/frame.cc +++ b/modules/planning/common/frame.cc @@ -493,11 +493,6 @@ void Frame::RecordInputDebug(planning_internal::Debug *debug) { */ } -void Frame::RecordOpenSpacePlannerDebug(planning_internal::Debug *debug) { - auto *planning_debug_data = debug->mutable_planning_data(); - planning_debug_data->mutable_open_space()->CopyFrom(*open_space_debug_); -} - void Frame::AlignPredictionTime(const double planning_start_time, PredictionObstacles *prediction_obstacles) { if (!prediction_obstacles || !prediction_obstacles->has_header() || diff --git a/modules/planning/common/frame.h b/modules/planning/common/frame.h index f799d98e89025bac91905d50bba7baeaf8c8be8f..2ff7a1c68a1a2ef4ea52dc9a7f5b7a8deb8612fd 100644 --- a/modules/planning/common/frame.h +++ b/modules/planning/common/frame.h @@ -133,8 +133,11 @@ class Frame { ADCTrajectory *output_trajectory() { return output_trajectory_; } - std::shared_ptr - mutable_open_space_debug() { + planning_internal::OpenSpaceDebug *mutable_open_space_debug() { + return &open_space_debug_; + } + + const planning_internal::OpenSpaceDebug &open_space_debug() { return open_space_debug_; } @@ -194,14 +197,13 @@ class Frame { ThreadSafeIndexedObstacles obstacles_; ChangeLaneDecider change_lane_decider_; ADCTrajectory trajectory_; // last published trajectory + // debug info for open space planner + planning_internal::OpenSpaceDebug open_space_debug_; // TODO(all): change to use shared_ptr. // output trajectory pb ADCTrajectory *output_trajectory_ = nullptr; // not owned - // debug info for open space planner - std::shared_ptr open_space_debug_; - // TODO(All): add lag_predictor back // std::unique_ptr lag_predictor_; const ReferenceLineProvider *reference_line_provider_ = nullptr;