Apollo  6.0
Open source self driving car software
path_reuse_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 <utility>
25 #include <vector>
26 
31 #include "modules/planning/proto/planning_config.pb.h"
33 
34 namespace apollo {
35 namespace planning {
36 
37 class PathReuseDecider : public Decider {
38  public:
39  PathReuseDecider(const TaskConfig& config,
40  const std::shared_ptr<DependencyInjector>& injector);
41 
42  private:
43  common::Status Process(Frame* frame,
44  ReferenceLineInfo* reference_line_info) override;
45 
46  void GetCurrentStopPositions(
47  Frame* frame,
48  std::vector<const common::PointENU*>* current_stop_positions);
49 
50  // get current s_projection of history objects which has stop decisions
51  void GetHistoryStopPositions(
52  ReferenceLineInfo* const reference_line_info,
53  const std::vector<const HistoryObjectDecision*>&
54  history_objects_decisions,
55  std::vector<std::pair<const double, const common::PointENU>>*
56  history_stop_positions);
57 
58  void GetADCSLPoint(const ReferenceLine& reference_line,
59  common::SLPoint* adc_position_sl);
60 
61  bool GetBlockingObstacleS(ReferenceLineInfo* const reference_line_info,
62  double* blocking_obstacle_s);
63  // ignore blocking obstacle when it is far away
64  bool IsIgnoredBlockingObstacle(ReferenceLineInfo* const reference_line_info);
65  // check if path is collision free
66  bool IsCollisionFree(ReferenceLineInfo* const reference_line_info);
67 
68  // check path length
69  bool NotShortPath(const DiscretizedPath& current_path);
70 
71  // trim history path
72  bool TrimHistoryPath(Frame* frame,
73  ReferenceLineInfo* const reference_line_info);
74 
75  private:
76  static int reusable_path_counter_; // count reused path
77  static int total_path_counter_; // count total path
78  static bool path_reusable_;
79 };
80 
81 } // namespace planning
82 } // namespace apollo
Definition: discretized_path.h:31
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...
PathReuseDecider(const TaskConfig &config, const std::shared_ptr< DependencyInjector > &injector)
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: path_reuse_decider.h:37
Definition: decider.h:32
Definition: reference_line.h:39
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