Apollo  6.0
Open source self driving car software
bare_intersection_unprotected_scenario.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 
21 #pragma once
22 
23 #include <memory>
24 #include <string>
25 
27 #include "modules/planning/proto/planning.pb.h"
29 
30 namespace apollo {
31 namespace planning {
32 namespace scenario {
33 namespace bare_intersection {
34 
35 // stage context
37  ScenarioBareIntersectionUnprotectedConfig scenario_config;
39 };
40 
42  public:
44  const ScenarioConfig& config, const ScenarioContext* context,
45  const std::shared_ptr<DependencyInjector>& injector)
46  : Scenario(config, context, injector) {}
47 
48  void Init() override;
49 
50  std::unique_ptr<Stage> CreateStage(
51  const ScenarioConfig::StageConfig& stage_config,
52  const std::shared_ptr<DependencyInjector>& injector);
53 
55 
56  private:
57  static void RegisterStages();
58  bool GetScenarioConfig();
59 
60  private:
62  ScenarioConfig::StageType, Stage,
63  Stage* (*)(const ScenarioConfig::StageConfig& stage_config,
64  const std::shared_ptr<DependencyInjector>& injector)>
65  s_stage_factory_;
66  bool init_ = false;
68 };
69 
70 } // namespace bare_intersection
71 } // namespace scenario
72 } // namespace planning
73 } // namespace apollo
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
std::string current_pnc_junction_overlap_id
Definition: bare_intersection_unprotected_scenario.h:38
Planning module main class. It processes GPS and IMU as input, to generate planning info...
Implements a Factory design pattern with Register and Create methods.
Definition: factory.h:60
Definition: bare_intersection_unprotected_scenario.h:41
BareIntersectionUnprotectedContext * GetContext()
Definition: bare_intersection_unprotected_scenario.h:54
Defines the Factory class.
BareIntersectionUnprotectedScenario(const ScenarioConfig &config, const ScenarioContext *context, const std::shared_ptr< DependencyInjector > &injector)
Definition: bare_intersection_unprotected_scenario.h:43
bool Init(const char *binary_name)
ScenarioBareIntersectionUnprotectedConfig scenario_config
Definition: bare_intersection_unprotected_scenario.h:37
Definition: scenario.h:41
Definition: bare_intersection_unprotected_scenario.h:36
Definition: stage.h:38