Apollo 11.0
自动驾驶开放平台
collision_checker.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 <vector>
25
31
32namespace apollo {
33namespace planning {
34
36 public:
38 const std::vector<const Obstacle*>& obstacles, const double ego_vehicle_s,
39 const double ego_vehicle_d,
40 const std::vector<common::PathPoint>& discretized_reference_line,
41 const ReferenceLineInfo* ptr_reference_line_info,
42 const std::shared_ptr<PathTimeGraph>& ptr_path_time_graph);
43
44 bool InCollision(const DiscretizedTrajectory& discretized_trajectory);
45
46 static bool InCollision(const std::vector<const Obstacle*>& obstacles,
47 const DiscretizedTrajectory& ego_trajectory,
48 const double ego_length, const double ego_width,
49 const double ego_edge_to_center);
50
51 private:
52 void BuildPredictedEnvironment(
53 const std::vector<const Obstacle*>& obstacles, const double ego_vehicle_s,
54 const double ego_vehicle_d,
55 const std::vector<common::PathPoint>& discretized_reference_line);
56
57 bool IsEgoVehicleInLane(const double ego_vehicle_s,
58 const double ego_vehicle_d);
59
60 bool IsObstacleBehindEgoVehicle(
61 const Obstacle* obstacle, const double ego_vehicle_s,
62 const std::vector<apollo::common::PathPoint>& discretized_reference_line);
63
64 private:
65 const ReferenceLineInfo* ptr_reference_line_info_;
66 std::shared_ptr<PathTimeGraph> ptr_path_time_graph_;
67 std::vector<std::vector<common::math::Box2d>> predicted_bounding_rectangles_;
68};
69
70} // namespace planning
71} // namespace apollo
The class of Box2d.
bool InCollision(const DiscretizedTrajectory &discretized_trajectory)
This is the class that associates an Obstacle with its path properties.
Definition obstacle.h:62
ReferenceLineInfo holds all data for one reference line.
Planning module main class.
class register implement
Definition arena_queue.h:37