Apollo 10.0
自动驾驶开放平台
speed_optimizer.cc
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
22
25
26namespace apollo {
27namespace planning {
28
31
33 ReferenceLineInfo* reference_line_info) {
34 Task::Execute(frame, reference_line_info);
35
36 auto ret =
37 Process(reference_line_info->path_data(), frame->PlanningStartPoint(),
38 reference_line_info->mutable_speed_data());
39
40 RecordDebugInfo(reference_line_info->speed_data());
41 return ret;
42}
43
45 auto* debug = reference_line_info_->mutable_debug();
46 auto ptr_speed_plan = debug->mutable_planning_data()->add_speed_plan();
47 ptr_speed_plan->set_name(Name());
48 ptr_speed_plan->mutable_speed_point()->CopyFrom(
49 {speed_data.begin(), speed_data.end()});
50}
51
53 STGraphDebug* st_graph_debug) {
54 if (!FLAGS_enable_record_debug || !st_graph_debug) {
55 ADEBUG << "Skip record debug info";
56 return;
57 }
58 st_graph_debug->set_name(Name());
59 st_graph_debug->mutable_speed_profile()->CopyFrom(
60 {speed_data.begin(), speed_data.end()});
61}
62
63} // namespace planning
64} // namespace apollo
A general class to denote the return status of an API call.
Definition status.h:43
Frame holds all data for one planning cycle.
Definition frame.h:62
const common::TrajectoryPoint & PlanningStartPoint() const
Definition frame.cc:79
ReferenceLineInfo holds all data for one reference line.
planning_internal::Debug * mutable_debug()
common::Status Execute(Frame *frame, ReferenceLineInfo *reference_line_info) override
void RecordDebugInfo(const SpeedData &speed_data)
virtual common::Status Process(const PathData &path_data, const common::TrajectoryPoint &init_point, SpeedData *const speed_data)=0
const std::string & Name() const
Definition task.cc:58
ReferenceLineInfo * reference_line_info_
Definition task.h:58
virtual common::Status Execute(Frame *frame, ReferenceLineInfo *reference_line_info)
Definition task.cc:60
Planning module main class.
#define ADEBUG
Definition log.h:41
class register implement
Definition arena_queue.h:37