Apollo  6.0
Open source self driving car software
traffic_light_unprotected_left_turn_scenario.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 
29 #include "modules/planning/proto/planning.pb.h"
31 
32 namespace apollo {
33 namespace planning {
34 namespace scenario {
35 namespace traffic_light {
36 
37 // stage context
39  ScenarioTrafficLightUnprotectedLeftTurnConfig scenario_config;
40  std::vector<std::string> current_traffic_light_overlap_ids;
42 };
43 
45  public:
47  const ScenarioConfig& config, const ScenarioContext* context,
48  const std::shared_ptr<DependencyInjector>& injector)
49  : Scenario(config, context, injector) {}
50 
51  void Init() override;
52 
53  std::unique_ptr<Stage> CreateStage(
54  const ScenarioConfig::StageConfig& stage_config,
55  const std::shared_ptr<DependencyInjector>& injector);
56 
58 
59  private:
60  static void RegisterStages();
61  bool GetScenarioConfig();
62 
63  private:
65  ScenarioConfig::StageType, Stage,
66  Stage* (*)(const ScenarioConfig::StageConfig& stage_config,
67  const std::shared_ptr<DependencyInjector>& injector)>
68  s_stage_factory_;
69  bool init_ = false;
71 };
72 
73 } // namespace traffic_light
74 } // namespace scenario
75 } // namespace planning
76 } // namespace apollo
TrafficLightUnprotectedLeftTurnContext * GetContext()
Definition: traffic_light_unprotected_left_turn_scenario.h:57
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
ScenarioTrafficLightUnprotectedLeftTurnConfig scenario_config
Definition: traffic_light_unprotected_left_turn_scenario.h:39
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: traffic_light_unprotected_left_turn_scenario.h:44
Defines the Factory class.
double creep_start_time
Definition: traffic_light_unprotected_left_turn_scenario.h:41
bool Init(const char *binary_name)
Definition: scenario.h:41
std::vector< std::string > current_traffic_light_overlap_ids
Definition: traffic_light_unprotected_left_turn_scenario.h:40
Definition: traffic_light_unprotected_left_turn_scenario.h:38
Definition: stage.h:38
TrafficLightUnprotectedLeftTurnScenario(const ScenarioConfig &config, const ScenarioContext *context, const std::shared_ptr< DependencyInjector > &injector)
Definition: traffic_light_unprotected_left_turn_scenario.h:46