Apollo  6.0
Open source self driving car software
lane_follow_stage.h
Go to the documentation of this file.
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 
21 #pragma once
22 
23 #include <memory>
24 #include <string>
25 #include <vector>
26 
27 #include "modules/common/proto/pnc_point.pb.h"
32 #include "modules/planning/proto/planning.pb.h"
38 
39 namespace apollo {
40 namespace planning {
41 namespace scenario {
42 namespace lane_follow {
43 
44 class LaneFollowStage : public Stage {
45  public:
46  LaneFollowStage(const ScenarioConfig::StageConfig& config,
47  const std::shared_ptr<DependencyInjector>& injector);
48 
49  StageStatus Process(const common::TrajectoryPoint& planning_init_point,
50  Frame* frame) override;
51 
53  const common::TrajectoryPoint& planning_start_point, Frame* frame,
54  ReferenceLineInfo* reference_line_info);
55 
57  const common::TrajectoryPoint& planning_start_point, Frame* frame,
58  ReferenceLineInfo* reference_line_info);
59 
60  void GenerateFallbackPathProfile(const ReferenceLineInfo* reference_line_info,
61  PathData* path_data);
62 
64  const ReferenceLineInfo* reference_line_info, const Frame* frame,
65  PathData* path_data);
66 
67  common::SLPoint GetStopSL(const ObjectStop& stop_decision,
68  const ReferenceLine& reference_line) const;
69 
70  void RecordObstacleDebugInfo(ReferenceLineInfo* reference_line_info);
71 
72  private:
73  ScenarioConfig config_;
74  std::unique_ptr<Stage> stage_;
75 };
76 
77 } // namespace lane_follow
78 } // namespace scenario
79 } // namespace planning
80 } // namespace apollo
StageStatus Process(const common::TrajectoryPoint &planning_init_point, Frame *frame) override
Each stage does its business logic inside Process function. If the stage want to transit to a differe...
common::Status PlanOnReferenceLine(const common::TrajectoryPoint &planning_start_point, Frame *frame, ReferenceLineInfo *reference_line_info)
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
bool RetrieveLastFramePathProfile(const ReferenceLineInfo *reference_line_info, const Frame *frame, PathData *path_data)
Planning module main class. It processes GPS and IMU as input, to generate planning info...
const ScenarioConfig::StageConfig & config() const
Definition: stage.h:52
Frame holds all data for one planning cycle.
Definition: frame.h:61
ReferenceLineInfo holds all data for one reference line.
Definition: reference_line_info.h:54
Definition: path_data.h:36
LaneFollowStage(const ScenarioConfig::StageConfig &config, const std::shared_ptr< DependencyInjector > &injector)
StageStatus
Definition: stage.h:40
Defines the Factory class.
void PlanFallbackTrajectory(const common::TrajectoryPoint &planning_start_point, Frame *frame, ReferenceLineInfo *reference_line_info)
Definition: reference_line.h:39
A general class to denote the return status of an API call. It can either be an OK status for success...
Definition: status.h:43
void RecordObstacleDebugInfo(ReferenceLineInfo *reference_line_info)
void GenerateFallbackPathProfile(const ReferenceLineInfo *reference_line_info, PathData *path_data)
common::SLPoint GetStopSL(const ObjectStop &stop_decision, const ReferenceLine &reference_line) const
Definition: stage.h:38