Apollo 10.0
自动驾驶开放平台
on_lane_planning.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 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
17#pragma once
18
19#include <memory>
20#include <string>
21#include <vector>
22
25
30namespace apollo {
31namespace planning {
32
40 public:
41 explicit OnLanePlanning(const std::shared_ptr<DependencyInjector>& injector)
42 : PlanningBase(injector) {}
43
44 virtual ~OnLanePlanning();
45
49 std::string Name() const override;
50
55 common::Status Init(const PlanningConfig& config) override;
56
61 void RunOnce(const LocalView& local_view,
62 ADCTrajectory* const ptr_trajectory_pb) override;
63
65 const double current_time_stamp,
66 const std::vector<common::TrajectoryPoint>& stitching_trajectory,
67 ADCTrajectory* const trajectory) override;
68
69 private:
70 common::Status InitFrame(const uint32_t sequence_num,
71 const common::TrajectoryPoint& planning_start_point,
72 const common::VehicleState& vehicle_state);
73
74 common::VehicleState AlignTimeStamp(const common::VehicleState& vehicle_state,
75 const double curr_timestamp) const;
76
77 void ExportReferenceLineDebug(planning_internal::Debug* debug);
78 bool CheckPlanningConfig(const PlanningConfig& config);
79 void GenerateStopTrajectory(ADCTrajectory* ptr_trajectory_pb);
80 void ExportFailedLaneChangeSTChart(const planning_internal::Debug& debug_info,
81 planning_internal::Debug* debug_chart);
82 void ExportOnLaneChart(const planning_internal::Debug& debug_info,
83 planning_internal::Debug* debug_chart);
84 void ExportOpenSpaceChart(const planning_internal::Debug& debug_info,
85 const ADCTrajectory& trajectory_pb,
86 planning_internal::Debug* debug_chart);
87 void AddOpenSpaceOptimizerResult(const planning_internal::Debug& debug_info,
88 planning_internal::Debug* debug_chart);
89 void AddPartitionedTrajectory(const planning_internal::Debug& debug_info,
90 planning_internal::Debug* debug_chart);
91
92 void AddStitchSpeedProfile(planning_internal::Debug* debug_chart);
93
94 void AddPublishedSpeed(const ADCTrajectory& trajectory_pb,
95 planning_internal::Debug* debug_chart);
96
97 void AddPublishedAcceleration(const ADCTrajectory& trajectory_pb,
99
100 void AddFallbackTrajectory(const planning_internal::Debug& debug_info,
101 planning_internal::Debug* debug_chart);
102
103 private:
104 PlanningCommand last_command_;
105 std::unique_ptr<ReferenceLineProvider> reference_line_provider_;
106 Smoother planning_smoother_;
107};
108
109} // namespace planning
110} // namespace apollo
A general class to denote the return status of an API call.
Definition status.h:43
common::Status Plan(const double current_time_stamp, const std::vector< common::TrajectoryPoint > &stitching_trajectory, ADCTrajectory *const trajectory) override
Plan the trajectory given current vehicle state
void RunOnce(const LocalView &local_view, ADCTrajectory *const ptr_trajectory_pb) override
main logic of the planning module, runs periodically triggered by timer.
OnLanePlanning(const std::shared_ptr< DependencyInjector > &injector)
common::Status Init(const PlanningConfig &config) override
module initialization function
std::string Name() const override
Planning name.
Planning module main class.
class register implement
Definition arena_queue.h:37
LocalView contains all necessary data as planning input