Apollo 11.0
自动驾驶开放平台
path_time_graph.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 <string>
24#include <unordered_map>
25#include <utility>
26#include <vector>
27
28#include "modules/common_msgs/basic_msgs/geometry.pb.h"
29
37
38namespace apollo {
39namespace planning {
40
42 public:
43 PathTimeGraph(const std::vector<const Obstacle*>& obstacles,
44 const std::vector<common::PathPoint>& discretized_ref_points,
45 const ReferenceLineInfo* ptr_reference_line_info,
46 const double s_start, const double s_end, const double t_start,
47 const double t_end, const std::array<double, 3>& init_d);
48
49 const std::vector<STBoundary>& GetPathTimeObstacles() const;
50
51 bool GetPathTimeObstacle(const std::string& obstacle_id,
52 STBoundary* path_time_obstacle);
53
54 std::vector<std::pair<double, double>> GetPathBlockingIntervals(
55 const double t) const;
56
57 std::vector<std::vector<std::pair<double, double>>> GetPathBlockingIntervals(
58 const double t_start, const double t_end, const double t_resolution);
59
60 std::pair<double, double> get_path_range() const;
61
62 std::pair<double, double> get_time_range() const;
63
64 std::vector<STPoint> GetObstacleSurroundingPoints(
65 const std::string& obstacle_id, const double s_dist,
66 const double t_density) const;
67
68 bool IsObstacleInGraph(const std::string& obstacle_id);
69
70 std::vector<std::pair<double, double>> GetLateralBounds(
71 const double s_start, const double s_end, const double s_resolution);
72
73 private:
74 void SetupObstacles(
75 const std::vector<const Obstacle*>& obstacles,
76 const std::vector<common::PathPoint>& discretized_ref_points);
77
78 SLBoundary ComputeObstacleBoundary(
79 const std::vector<common::math::Vec2d>& vertices,
80 const std::vector<common::PathPoint>& discretized_ref_points) const;
81
82 STPoint SetPathTimePoint(const std::string& obstacle_id, const double s,
83 const double t) const;
84
85 void SetStaticObstacle(
86 const Obstacle* obstacle,
87 const std::vector<common::PathPoint>& discretized_ref_points);
88
89 void SetDynamicObstacle(
90 const Obstacle* obstacle,
91 const std::vector<common::PathPoint>& discretized_ref_points);
92
93 void UpdateLateralBoundsByObstacle(
94 const SLBoundary& sl_boundary,
95 const std::vector<double>& discretized_path, const double s_start,
96 const double s_end, std::vector<std::pair<double, double>>* const bounds);
97
98 private:
99 std::pair<double, double> time_range_;
100 std::pair<double, double> path_range_;
101 const ReferenceLineInfo* ptr_reference_line_info_;
102 std::array<double, 3> init_d_;
103
104 std::unordered_map<std::string, STBoundary> path_time_obstacle_map_;
105 std::vector<STBoundary> path_time_obstacles_;
106 std::vector<SLBoundary> static_obs_sl_boundaries_;
107};
108
109} // namespace planning
110} // namespace apollo
This is the class that associates an Obstacle with its path properties.
Definition obstacle.h:62
std::vector< STPoint > GetObstacleSurroundingPoints(const std::string &obstacle_id, const double s_dist, const double t_density) const
std::vector< std::pair< double, double > > GetPathBlockingIntervals(const double t) const
std::pair< double, double > get_path_range() const
bool GetPathTimeObstacle(const std::string &obstacle_id, STBoundary *path_time_obstacle)
bool IsObstacleInGraph(const std::string &obstacle_id)
std::vector< std::pair< double, double > > GetLateralBounds(const double s_start, const double s_end, const double s_resolution)
std::pair< double, double > get_time_range() const
const std::vector< STBoundary > & GetPathTimeObstacles() const
ReferenceLineInfo holds all data for one reference line.
Planning module main class.
class register implement
Definition arena_queue.h:37
Define the Polygon2d class.