Apollo  6.0
Open source self driving car software
stage_check.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2019 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 
21 #include "cyber/common/log.h"
22 #include "modules/common/configs/proto/vehicle_config.pb.h"
25 #include "modules/common/vehicle_state/proto/vehicle_state.pb.h"
30 #include "modules/planning/proto/planning_config.pb.h"
34 
35 namespace apollo {
36 namespace planning {
37 namespace scenario {
38 namespace park_and_go {
39 
40 struct ParkAndGoContext;
41 
42 class ParkAndGoStageCheck : public Stage {
43  public:
44  ParkAndGoStageCheck(const ScenarioConfig::StageConfig& config,
45  const std::shared_ptr<DependencyInjector>& injector)
46  : Stage(config, injector) {}
47 
48  Stage::StageStatus Process(const common::TrajectoryPoint& planning_init_point,
49  Frame* frame) override;
50 
52  return Stage::GetContextAs<ParkAndGoContext>();
53  }
54 
55  Stage::StageStatus FinishStage(const bool success);
56 
57  private:
58  bool CheckObstacle(const ReferenceLineInfo& reference_line_info);
59  void ADCInitStatus();
60 
61  private:
62  ScenarioParkAndGoConfig scenario_config_;
63 };
64 
65 } // namespace park_and_go
66 } // namespace scenario
67 } // namespace planning
68 } // namespace apollo
ParkAndGoStageCheck(const ScenarioConfig::StageConfig &config, const std::shared_ptr< DependencyInjector > &injector)
Definition: stage_check.h:44
Defines the Vec2d class.
Stage::StageStatus FinishStage(const bool success)
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
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
StageStatus
Definition: stage.h:40
ParkAndGoContext * GetContext()
Definition: stage_check.h:51
Stage::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...
Definition: stage.h:38