Apollo  6.0
Open source self driving car software
st_boundary_mapper.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 <memory>
24 #include <string>
25 #include <vector>
26 
27 #include "modules/common/configs/proto/vehicle_config.pb.h"
35 #include "modules/planning/proto/task_config.pb.h"
37 
38 namespace apollo {
39 namespace planning {
40 
42  public:
43  STBoundaryMapper(const SpeedBoundsDeciderConfig& config,
44  const ReferenceLine& reference_line,
45  const PathData& path_data, const double planning_distance,
46  const double planning_time,
47  const std::shared_ptr<DependencyInjector>& injector);
48 
49  virtual ~STBoundaryMapper() = default;
50 
51  common::Status ComputeSTBoundary(PathDecision* path_decision) const;
52 
53  private:
54  FRIEND_TEST(StBoundaryMapperTest, check_overlap_test);
55 
60  void ComputeSTBoundary(Obstacle* obstacle) const;
61 
66  bool GetOverlapBoundaryPoints(
67  const std::vector<common::PathPoint>& path_points,
68  const Obstacle& obstacle, std::vector<STPoint>* upper_points,
69  std::vector<STPoint>* lower_points) const;
70 
77  bool CheckOverlap(const common::PathPoint& path_point,
78  const common::math::Box2d& obs_box,
79  const double l_buffer) const;
80 
85  bool MapStopDecision(Obstacle* stop_obstacle,
86  const ObjectDecisionType& decision) const;
87 
92  void ComputeSTBoundaryWithDecision(Obstacle* obstacle,
93  const ObjectDecisionType& decision) const;
94 
95  private:
96  const SpeedBoundsDeciderConfig& speed_bounds_config_;
97  const ReferenceLine& reference_line_;
98  const PathData& path_data_;
99  const common::VehicleParam& vehicle_param_;
100  const double planning_max_distance_;
101  const double planning_max_time_;
102  std::shared_ptr<DependencyInjector> injector_;
103 };
104 
105 } // namespace planning
106 } // namespace apollo
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
Definition: st_boundary_mapper.h:41
Planning module main class. It processes GPS and IMU as input, to generate planning info...
Rectangular (undirected) bounding box in 2-D.
Definition: box2d.h:52
Definition: path_data.h:36
common::Status ComputeSTBoundary(PathDecision *path_decision) const
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
STBoundaryMapper(const SpeedBoundsDeciderConfig &config, const ReferenceLine &reference_line, const PathData &path_data, const double planning_distance, const double planning_time, const std::shared_ptr< DependencyInjector > &injector)