Apollo 11.0
自动驾驶开放平台
scenario_manager.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 <unordered_map>
21#include <vector>
22
23#include "modules/common_msgs/basic_msgs/pnc_point.pb.h"
24#include "modules/planning/planners/public_road/proto/planner_config.pb.h"
25
26namespace apollo {
27namespace planning {
28
29class DependencyInjector;
30class Frame;
31} // namespace planning
32} // namespace apollo
33
34namespace apollo {
35namespace planning {
36
37class Scenario;
38
39class ScenarioManager final {
40 public:
41 bool Init(const std::shared_ptr<DependencyInjector>& injector,
42 const PlannerPublicRoadConfig& planner_config);
43
44 Scenario* mutable_scenario() { return current_scenario_.get(); }
45
46 DependencyInjector* injector() { return injector_.get(); }
47
48 void Update(const common::TrajectoryPoint& ego_point, Frame* frame);
49
50 void Reset(Frame* frame);
51
52 private:
53 std::shared_ptr<DependencyInjector> injector_;
54 std::shared_ptr<Scenario> current_scenario_;
55 std::shared_ptr<Scenario> default_scenario_type_;
56 std::vector<std::shared_ptr<Scenario>> scenario_list_;
57 bool init_ = false;
58};
59
60} // namespace planning
61} // namespace apollo
Frame holds all data for one planning cycle.
Definition frame.h:62
bool Init(const std::shared_ptr< DependencyInjector > &injector, const PlannerPublicRoadConfig &planner_config)
void Update(const common::TrajectoryPoint &ego_point, Frame *frame)
Planning module main class.
class register implement
Definition arena_queue.h:37