Apollo 10.0
自动驾驶开放平台
st_boundary_mapper.h
浏览该文件的文档.
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_msgs/config_msgs/vehicle_config.pb.h"
28#include "modules/planning/tasks/speed_bounds_decider/proto/speed_bounds_decider.pb.h"
37
38namespace apollo {
39namespace planning {
40
42 public:
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 FRIEND_TEST(StBoundaryMapperTest, get_overlap_boundary_points_test);
56
61 void ComputeSTBoundary(Obstacle* obstacle) const;
62
67 bool GetOverlapBoundaryPoints(
68 const std::vector<common::PathPoint>& path_points,
69 const Obstacle& obstacle, std::vector<STPoint>* upper_points,
70 std::vector<STPoint>* lower_points) const;
71
78 bool CheckOverlap(const common::PathPoint& path_point,
79 const common::math::Box2d& obs_box,
80 const double l_buffer) const;
81
88 bool CheckOverlap(const common::PathPoint& path_point,
89 const common::math::Polygon2d& obs_polygon,
90 const double l_buffer) const;
91
96 bool MapStopDecision(Obstacle* stop_obstacle,
97 const ObjectDecisionType& decision) const;
98
103 void ComputeSTBoundaryWithDecision(Obstacle* obstacle,
104 const ObjectDecisionType& decision) const;
105
106 bool CheckOverlapWithTrajectoryPoint(
107 const DiscretizedPath& discretized_path,
108 const common::math::Polygon2d& obstacle_shape,
109 std::vector<STPoint>* upper_points, std::vector<STPoint>* lower_points,
110 const double l_buffer, int default_num_point,
111 const double obstacle_length, const double obstacle_width,
112 const double trajectory_point_time) const;
113
114 private:
115 const SpeedBoundsDeciderConfig& speed_bounds_config_;
116 const ReferenceLine& reference_line_;
117 const PathData& path_data_;
118 const common::VehicleParam& vehicle_param_;
119 const double planning_max_distance_;
120 const double planning_max_time_;
121 std::shared_ptr<DependencyInjector> injector_;
122};
123
124} // namespace planning
125} // namespace apollo
A general class to denote the return status of an API call.
Definition status.h:43
Rectangular (undirected) bounding box in 2-D.
Definition box2d.h:52
The class of polygon in 2-D.
Definition polygon2d.h:42
This is the class that associates an Obstacle with its path properties.
Definition obstacle.h:62
PathDecision represents all obstacle decisions on one path.
common::Status ComputeSTBoundary(PathDecision *path_decision) const
Planning module main class.
class register implement
Definition arena_queue.h:37