提交 502e2e6f 编写于 作者: J JasonZhou404 提交者: Jinyun Zhou

Planning: renaming for better semantic understanding

上级 d69525ca
...@@ -121,12 +121,14 @@ class Frame { ...@@ -121,12 +121,14 @@ class Frame {
const double planning_start_time, const double planning_start_time,
prediction::PredictionObstacles *prediction_obstacles); prediction::PredictionObstacles *prediction_obstacles);
void set_last_planned_trajectory(ADCTrajectory last_planned_trajectory) { void set_current_frame_planned_trajectory(
last_planned_trajectory_ = std::move(last_planned_trajectory); ADCTrajectory current_frame_planned_trajectory) {
current_frame_planned_trajectory_ =
std::move(current_frame_planned_trajectory);
} }
ADCTrajectory last_planned_trajectory() const { const ADCTrajectory &current_frame_planned_trajectory() const {
return last_planned_trajectory_; return current_frame_planned_trajectory_;
} }
// TODO(Qi, Jinyun): check the usage in open space planner // TODO(Qi, Jinyun): check the usage in open space planner
...@@ -205,7 +207,7 @@ class Frame { ...@@ -205,7 +207,7 @@ class Frame {
ThreadSafeIndexedObstacles obstacles_; ThreadSafeIndexedObstacles obstacles_;
ChangeLaneDecider change_lane_decider_; ChangeLaneDecider change_lane_decider_;
ADCTrajectory last_planned_trajectory_; // last published trajectory ADCTrajectory current_frame_planned_trajectory_; // last published trajectory
// debug info for open space planner // debug info for open space planner
planning_internal::OpenSpaceDebug open_space_debug_; planning_internal::OpenSpaceDebug open_space_debug_;
......
...@@ -232,7 +232,7 @@ void NaviPlanning::RunOnce(const LocalView& local_view, ...@@ -232,7 +232,7 @@ void NaviPlanning::RunOnce(const LocalView& local_view,
FillPlanningPb(start_timestamp, trajectory_pb); FillPlanningPb(start_timestamp, trajectory_pb);
} }
frame_->set_last_planned_trajectory(*trajectory_pb); frame_->set_current_frame_planned_trajectory(*trajectory_pb);
auto seq_num = frame_->SequenceNum(); auto seq_num = frame_->SequenceNum();
FrameHistory::Instance()->Add(seq_num, std::move(frame_)); FrameHistory::Instance()->Add(seq_num, std::move(frame_));
......
...@@ -274,7 +274,7 @@ void OnLanePlanning::RunOnce(const LocalView& local_view, ...@@ -274,7 +274,7 @@ void OnLanePlanning::RunOnce(const LocalView& local_view,
} }
FillPlanningPb(start_timestamp, trajectory_pb); FillPlanningPb(start_timestamp, trajectory_pb);
frame_->set_last_planned_trajectory(*trajectory_pb); frame_->set_current_frame_planned_trajectory(*trajectory_pb);
const uint32_t n = frame_->SequenceNum(); const uint32_t n = frame_->SequenceNum();
FrameHistory::Instance()->Add(n, std::move(frame_)); FrameHistory::Instance()->Add(n, std::move(frame_));
return; return;
...@@ -333,7 +333,7 @@ void OnLanePlanning::RunOnce(const LocalView& local_view, ...@@ -333,7 +333,7 @@ void OnLanePlanning::RunOnce(const LocalView& local_view,
FillPlanningPb(start_timestamp, trajectory_pb); FillPlanningPb(start_timestamp, trajectory_pb);
ADEBUG << "Planning pb:" << trajectory_pb->header().DebugString(); ADEBUG << "Planning pb:" << trajectory_pb->header().DebugString();
frame_->set_last_planned_trajectory(*trajectory_pb); frame_->set_current_frame_planned_trajectory(*trajectory_pb);
if (FLAGS_enable_planning_smoother) { if (FLAGS_enable_planning_smoother) {
planning_smoother_.Smooth(FrameHistory::Instance(), frame_.get(), planning_smoother_.Smooth(FrameHistory::Instance(), frame_.get(),
trajectory_pb); trajectory_pb);
......
...@@ -193,7 +193,7 @@ void OpenSpacePlanning::RunOnce(const LocalView& local_view, ...@@ -193,7 +193,7 @@ void OpenSpacePlanning::RunOnce(const LocalView& local_view,
} }
FillPlanningPb(start_timestamp, ptr_trajectory_pb); FillPlanningPb(start_timestamp, ptr_trajectory_pb);
frame_->set_last_planned_trajectory(*ptr_trajectory_pb); frame_->set_current_frame_planned_trajectory(*ptr_trajectory_pb);
const uint32_t n = frame_->SequenceNum(); const uint32_t n = frame_->SequenceNum();
FrameHistory::Instance()->Add(n, std::move(frame_)); FrameHistory::Instance()->Add(n, std::move(frame_));
return; return;
...@@ -229,7 +229,7 @@ void OpenSpacePlanning::RunOnce(const LocalView& local_view, ...@@ -229,7 +229,7 @@ void OpenSpacePlanning::RunOnce(const LocalView& local_view,
FillPlanningPb(start_timestamp, ptr_trajectory_pb); FillPlanningPb(start_timestamp, ptr_trajectory_pb);
ADEBUG << "Planning pb:" << ptr_trajectory_pb->header().DebugString(); ADEBUG << "Planning pb:" << ptr_trajectory_pb->header().DebugString();
frame_->set_last_planned_trajectory(*ptr_trajectory_pb); frame_->set_current_frame_planned_trajectory(*ptr_trajectory_pb);
const uint32_t n = frame_->SequenceNum(); const uint32_t n = frame_->SequenceNum();
FrameHistory::Instance()->Add(n, std::move(frame_)); FrameHistory::Instance()->Add(n, std::move(frame_));
...@@ -247,7 +247,8 @@ Status OpenSpacePlanning::Plan( ...@@ -247,7 +247,8 @@ Status OpenSpacePlanning::Plan(
Status trajectory_partition_status; Status trajectory_partition_status;
if (status == Status::OK()) { if (status == Status::OK()) {
auto trajectory_after_stitching_point = frame_->last_planned_trajectory(); auto trajectory_after_stitching_point =
frame_->current_frame_planned_trajectory();
last_stitching_trajectory_ = frame_->last_stitching_trajectory(); last_stitching_trajectory_ = frame_->last_stitching_trajectory();
trajectory_after_stitching_point.mutable_header()->set_timestamp_sec( trajectory_after_stitching_point.mutable_header()->set_timestamp_sec(
current_time_stamp); current_time_stamp);
...@@ -275,7 +276,8 @@ Status OpenSpacePlanning::Plan( ...@@ -275,7 +276,8 @@ Status OpenSpacePlanning::Plan(
last_publishable_trajectory_.reset( last_publishable_trajectory_.reset(
new PublishableTrajectory(trajectory_after_stitching_point)); new PublishableTrajectory(trajectory_after_stitching_point));
frame_->set_last_planned_trajectory(trajectory_after_stitching_point); frame_->set_current_frame_planned_trajectory(
trajectory_after_stitching_point);
ADEBUG << "current_time_stamp: " << std::to_string(current_time_stamp); ADEBUG << "current_time_stamp: " << std::to_string(current_time_stamp);
......
...@@ -189,7 +189,7 @@ void OpenSpacePlanner::LoadTrajectoryToFrame(Frame* frame) { ...@@ -189,7 +189,7 @@ void OpenSpacePlanner::LoadTrajectoryToFrame(Frame* frame) {
trajectory_to_end_pb_.Clear(); trajectory_to_end_pb_.Clear();
trajectory_to_end_pb_.mutable_trajectory_point()->CopyFrom( trajectory_to_end_pb_.mutable_trajectory_point()->CopyFrom(
*(trajectory_to_end_.mutable_trajectory_point())); *(trajectory_to_end_.mutable_trajectory_point()));
frame->set_last_planned_trajectory(trajectory_to_end_pb_); frame->set_current_frame_planned_trajectory(trajectory_to_end_pb_);
frame->mutable_open_space_debug()->CopyFrom(open_space_debug_); frame->mutable_open_space_debug()->CopyFrom(open_space_debug_);
*(frame->mutable_last_stitching_trajectory()) = stitching_trajectory_; *(frame->mutable_last_stitching_trajectory()) = stitching_trajectory_;
} }
......
...@@ -95,7 +95,8 @@ apollo::common::Status Smoother::Smooth( ...@@ -95,7 +95,8 @@ apollo::common::Status Smoother::Smooth(
AWARN << msg; AWARN << msg;
return Status(ErrorCode::PLANNING_ERROR, msg); return Status(ErrorCode::PLANNING_ERROR, msg);
} }
const auto& previous_planning = previous_frame->last_planned_trajectory(); const auto& previous_planning =
previous_frame->current_frame_planned_trajectory();
auto header = current_trajectory_pb->header(); auto header = current_trajectory_pb->header();
*current_trajectory_pb = previous_planning; *current_trajectory_pb = previous_planning;
current_trajectory_pb->mutable_header()->CopyFrom(header); current_trajectory_pb->mutable_header()->CopyFrom(header);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册