Apollo  6.0
Open source self driving car software
path_decision.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2017 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 <limits>
24 #include <string>
25 
28 #include "modules/planning/proto/decision.pb.h"
29 
30 namespace apollo {
31 namespace planning {
32 
38 class PathDecision {
39  public:
40  PathDecision() = default;
41 
42  Obstacle *AddObstacle(const Obstacle &obstacle);
43 
45 
46  bool AddLateralDecision(const std::string &tag, const std::string &object_id,
47  const ObjectDecisionType &decision);
48  bool AddLongitudinalDecision(const std::string &tag,
49  const std::string &object_id,
50  const ObjectDecisionType &decision);
51 
52  const Obstacle *Find(const std::string &object_id) const;
53 
54  const perception::PerceptionObstacle *FindPerceptionObstacle(
55  const std::string &perception_obstacle_id) const;
56 
57  Obstacle *Find(const std::string &object_id);
58 
59  void SetSTBoundary(const std::string &id, const STBoundary &boundary);
60  void EraseStBoundaries();
61  MainStop main_stop() const { return main_stop_; }
62  double stop_reference_line_s() const { return stop_reference_line_s_; }
63  bool MergeWithMainStop(const ObjectStop &obj_stop, const std::string &obj_id,
64  const ReferenceLine &ref_line,
65  const SLBoundary &adc_sl_boundary);
66 
67  private:
69  MainStop main_stop_;
70  double stop_reference_line_s_ = std::numeric_limits<double>::max();
71 };
72 
73 } // namespace planning
74 } // namespace apollo
const Obstacle * Find(const std::string &object_id) const
bool MergeWithMainStop(const ObjectStop &obj_stop, const std::string &obj_id, const ReferenceLine &ref_line, const SLBoundary &adc_sl_boundary)
This is the class that associates an Obstacle with its path properties. An obstacle&#39;s path properties...
Definition: obstacle.h:60
PathDecision represents all obstacle decisions on one path.
Definition: path_decision.h:38
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...
void SetSTBoundary(const std::string &id, const STBoundary &boundary)
const perception::PerceptionObstacle * FindPerceptionObstacle(const std::string &perception_obstacle_id) const
double stop_reference_line_s() const
Definition: path_decision.h:62
Definition: st_boundary.h:38
bool AddLateralDecision(const std::string &tag, const std::string &object_id, const ObjectDecisionType &decision)
Obstacle * AddObstacle(const Obstacle &obstacle)
Definition: reference_line.h:39
bool AddLongitudinalDecision(const std::string &tag, const std::string &object_id, const ObjectDecisionType &decision)
MainStop main_stop() const
Definition: path_decision.h:61
const IndexedList< std::string, Obstacle > & obstacles() const