Apollo  6.0
Open source self driving car software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
st_bounds_decider.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 #include <tuple>
26 #include <utility>
27 #include <vector>
28 
31 #include "modules/planning/proto/planning_config.pb.h"
32 #include "modules/planning/proto/task_config.pb.h"
37 
38 namespace apollo {
39 namespace planning {
40 
41 constexpr double kSTBoundsDeciderResolution = 0.1;
42 constexpr double kSTPassableThreshold = 3.0;
43 
44 class STBoundsDecider : public Decider {
45  public:
46  STBoundsDecider(const TaskConfig& config,
47  const std::shared_ptr<DependencyInjector>& injector);
48 
49  private:
50  common::Status Process(Frame* const frame,
51  ReferenceLineInfo* const reference_line_info) override;
52 
53  void InitSTBoundsDecider(const Frame& frame,
54  ReferenceLineInfo* const reference_line_info);
55 
56  common::Status GenerateFallbackSTBound(
57  std::vector<std::tuple<double, double, double>>* const st_bound,
58  std::vector<std::tuple<double, double, double>>* const vt_bound);
59 
60  common::Status GenerateRegularSTBound(
61  std::vector<std::tuple<double, double, double>>* const st_bound,
62  std::vector<std::tuple<double, double, double>>* const vt_bound,
63  std::vector<std::pair<double, double>>* const st_guide_line);
64 
65  void RemoveInvalidDecisions(
66  std::pair<double, double> driving_limit,
67  std::vector<
68  std::pair<std::tuple<double, double, double>,
69  std::vector<std::pair<std::string, ObjectDecisionType>>>>*
70  available_choices);
71 
72  void RankDecisions(
73  double s_guide_line, std::pair<double, double> driving_limit,
74  std::vector<
75  std::pair<std::tuple<double, double, double>,
76  std::vector<std::pair<std::string, ObjectDecisionType>>>>*
77  available_choices);
78 
79  bool BackwardFlatten(
80  std::vector<std::tuple<double, double, double>>* const st_bound);
81 
82  void RecordSTGraphDebug(
83  const std::vector<STBoundary>& st_graph_data,
84  const std::vector<std::tuple<double, double, double>>& st_bound,
85  const std::vector<std::pair<double, double>>& st_guide_line,
86  planning_internal::STGraphDebug* const st_graph_debug);
87 
88  private:
89  STBoundsDeciderConfig st_bounds_config_;
90 
91  STGuideLine st_guide_line_;
92  STDrivingLimits st_driving_limits_;
93  STObstaclesProcessor st_obstacles_processor_;
94 };
95 
96 } // namespace planning
97 } // namespace apollo
constexpr double kSTPassableThreshold
Definition: st_bounds_decider.h:42
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: st_bounds_decider.h:44
Planning module main class. It processes GPS and IMU as input, to generate planning info...
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: st_driving_limits.h:39
STBoundsDecider(const TaskConfig &config, const std::shared_ptr< DependencyInjector > &injector)
Definition: st_guide_line.h:42
: data with map info and obstacle info
Definition: st_obstacles_processor.h:48
Definition: decider.h:32
constexpr double kSTBoundsDeciderResolution
Definition: st_bounds_decider.h:41
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