Apollo 11.0
自动驾驶开放平台
open_space_roi_util.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 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 <algorithm>
24#include <memory>
25#include <string>
26#include <vector>
27
29
30namespace apollo {
31namespace planning {
32
35
37 public:
42 OpenSpaceInfo* const open_space_info);
48 static void GetRoiXYBoundary(
49 const std::vector<std::vector<common::math::Vec2d>>& roi_parking_boundary,
50 std::vector<double>* const XYBoundary);
51 static void TransformByOriginPoint(
52 const common::math::Vec2d& origin_point,
53 const double heading,
54 std::vector<std::vector<common::math::Vec2d>>* roi_parking_boundary);
55 static void TransformByOriginPoint(
56 const common::math::Vec2d& origin_point,
57 const double heading,
58 std::vector<common::math::Vec2d>* roi_parking_boundary);
59 static void TransformByOriginPoint(
60 const common::math::Vec2d& origin_point,
61 const double heading,
62 common::math::Vec2d* point);
71 static bool LoadObstacles(
72 const double filtering_distance,
73 const double perception_obstacle_buffer,
74 const std::vector<double>& xy_boundary,
75 Frame* const frame,
76 std::vector<std::vector<common::math::Vec2d>>*
77 const roi_parking_boundary);
85 static bool FilterOutObstacle(
86 const double filtering_distance,
87 const Frame& frame,
88 const std::vector<double>& xy_boundary,
89 const Obstacle& obstacle);
95 static bool LoadObstacleInHyperPlanes(OpenSpaceInfo* const open_space_info);
96 static bool GetHyperPlanes(
97 const size_t& obstacles_num,
98 const Eigen::MatrixXi& obstacles_edges_num,
99 const std::vector<std::vector<Vec2d>>& obstacles_vertices_vec,
100 Eigen::MatrixXd* A_all,
101 Eigen::MatrixXd* b_all);
102 static void TransformByOriginPoint(
103 const Vec2d& origin_point,
104 const double& origin_heading,
105 OpenSpaceInfo* open_space_info);
106 static bool IsPolygonClockwise(const std::vector<Vec2d>& polygon);
107 static bool AdjustPointsOrderToClockwise(std::vector<Vec2d>* polygon);
108 static bool UpdateParkingPointsOrder(const apollo::hdmap::Path& nearby_path,
109 std::vector<Vec2d>* points);
110};
111
112} // namespace planning
113} // namespace apollo
Rectangular (undirected) bounding box in 2-D.
Definition box2d.h:52
Implements a class of 2-dimensional vectors.
Definition vec2d.h:42
Frame holds all data for one planning cycle.
Definition frame.h:62
This is the class that associates an Obstacle with its path properties.
Definition obstacle.h:62
static bool AdjustPointsOrderToClockwise(std::vector< Vec2d > *polygon)
static bool LoadObstacleInHyperPlanes(OpenSpaceInfo *const open_space_info)
brief Transform the vertice presentation of the obstacles into linear inequality as Ax>b
static bool FormulateBoundaryConstraints(OpenSpaceInfo *const open_space_info)
main process to compute and load info needed by open space planner
static bool LoadObstacles(const double filtering_distance, const double perception_obstacle_buffer, const std::vector< double > &xy_boundary, Frame *const frame, std::vector< std::vector< common::math::Vec2d > > *const roi_parking_boundary)
Load obstacle polygon to roi_boundary in clock wise order
static bool UpdateParkingPointsOrder(const apollo::hdmap::Path &nearby_path, std::vector< Vec2d > *points)
static void TransformByOriginPoint(const common::math::Vec2d &origin_point, const double heading, std::vector< std::vector< common::math::Vec2d > > *roi_parking_boundary)
static bool IsPolygonClockwise(const std::vector< Vec2d > &polygon)
static void GetRoiXYBoundary(const std::vector< std::vector< common::math::Vec2d > > &roi_parking_boundary, std::vector< double > *const XYBoundary)
get XY boundary which is minmax x or y in roi boundary
static bool FilterOutObstacle(const double filtering_distance, const Frame &frame, const std::vector< double > &xy_boundary, const Obstacle &obstacle)
is obstacle can be filterd out, filtered by distance and roi XY bound
static bool GetHyperPlanes(const size_t &obstacles_num, const Eigen::MatrixXi &obstacles_edges_num, const std::vector< std::vector< Vec2d > > &obstacles_vertices_vec, Eigen::MatrixXd *A_all, Eigen::MatrixXd *b_all)
Planning module main class.
class register implement
Definition arena_queue.h:37