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

Planning: renaming for better semantic understanding

上级 d69525ca
......@@ -121,12 +121,14 @@ class Frame {
const double planning_start_time,
prediction::PredictionObstacles *prediction_obstacles);
void set_last_planned_trajectory(ADCTrajectory last_planned_trajectory) {
last_planned_trajectory_ = std::move(last_planned_trajectory);
void set_current_frame_planned_trajectory(
ADCTrajectory current_frame_planned_trajectory) {
current_frame_planned_trajectory_ =
std::move(current_frame_planned_trajectory);
}
ADCTrajectory last_planned_trajectory() const {
return last_planned_trajectory_;
const ADCTrajectory &current_frame_planned_trajectory() const {
return current_frame_planned_trajectory_;
}
// TODO(Qi, Jinyun): check the usage in open space planner
......@@ -205,7 +207,7 @@ class Frame {
ThreadSafeIndexedObstacles obstacles_;
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
planning_internal::OpenSpaceDebug open_space_debug_;
......
......@@ -232,7 +232,7 @@ void NaviPlanning::RunOnce(const LocalView& local_view,
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();
FrameHistory::Instance()->Add(seq_num, std::move(frame_));
......
......@@ -274,7 +274,7 @@ void OnLanePlanning::RunOnce(const LocalView& local_view,
}
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();
FrameHistory::Instance()->Add(n, std::move(frame_));
return;
......@@ -333,7 +333,7 @@ void OnLanePlanning::RunOnce(const LocalView& local_view,
FillPlanningPb(start_timestamp, trajectory_pb);
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) {
planning_smoother_.Smooth(FrameHistory::Instance(), frame_.get(),
trajectory_pb);
......
......@@ -193,7 +193,7 @@ void OpenSpacePlanning::RunOnce(const LocalView& local_view,
}
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();
FrameHistory::Instance()->Add(n, std::move(frame_));
return;
......@@ -229,7 +229,7 @@ void OpenSpacePlanning::RunOnce(const LocalView& local_view,
FillPlanningPb(start_timestamp, ptr_trajectory_pb);
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();
FrameHistory::Instance()->Add(n, std::move(frame_));
......@@ -247,7 +247,8 @@ Status OpenSpacePlanning::Plan(
Status trajectory_partition_status;
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();
trajectory_after_stitching_point.mutable_header()->set_timestamp_sec(
current_time_stamp);
......@@ -275,7 +276,8 @@ Status OpenSpacePlanning::Plan(
last_publishable_trajectory_.reset(
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);
......
......@@ -189,7 +189,7 @@ void OpenSpacePlanner::LoadTrajectoryToFrame(Frame* frame) {
trajectory_to_end_pb_.Clear();
trajectory_to_end_pb_.mutable_trajectory_point()->CopyFrom(
*(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_last_stitching_trajectory()) = stitching_trajectory_;
}
......
......@@ -95,7 +95,8 @@ apollo::common::Status Smoother::Smooth(
AWARN << 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();
*current_trajectory_pb = previous_planning;
current_trajectory_pb->mutable_header()->CopyFrom(header);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册