62 bool Init(
const std::string &config_dir,
const std::string &name,
63 const std::shared_ptr<DependencyInjector> &injector)
override;
74 bool GetPullOverSpot(
Frame *
const frame,
75 std::array<common::math::Vec2d, 4> *vertices,
80 void SetOrigin(
Frame *
const frame,
81 const std::array<common::math::Vec2d, 4> &vertices);
83 void SetParkingSpotEndPose(
const ParkingInfo &parking_info,
86 void SetPullOverSpotEndPose(
Frame *
const frame);
87 void SetParkAndGoEndPose(
Frame *
const frame);
91 const hdmap::Path &nearby_path,
const double center_line_s,
93 std::vector<common::math::Vec2d> *left_lane_boundary,
94 std::vector<common::math::Vec2d> *right_lane_boundary,
95 std::vector<common::math::Vec2d> *center_lane_boundary_left,
96 std::vector<common::math::Vec2d> *center_lane_boundary_right,
97 std::vector<double> *center_lane_s_left,
98 std::vector<double> *center_lane_s_right,
99 std::vector<double> *left_lane_road_width,
100 std::vector<double> *right_lane_road_width);
103 void GetRoadBoundaryFromMap(
104 const hdmap::Path &nearby_path,
const double center_line_s,
106 std::vector<common::math::Vec2d> *left_lane_boundary,
107 std::vector<common::math::Vec2d> *right_lane_boundary,
108 std::vector<common::math::Vec2d> *center_lane_boundary_left,
109 std::vector<common::math::Vec2d> *center_lane_boundary_right,
110 std::vector<double> *center_lane_s_left,
111 std::vector<double> *center_lane_s_right,
112 std::vector<double> *left_lane_road_width,
113 std::vector<double> *right_lane_road_width);
116 void AddBoundaryKeyPoint(
117 const hdmap::Path &nearby_path,
const double check_point_s,
118 const double start_s,
const double end_s,
const bool is_anchor_point,
119 const bool is_left_curb,
120 std::vector<common::math::Vec2d> *center_lane_boundary,
121 std::vector<common::math::Vec2d> *curb_lane_boundary,
122 std::vector<double> *center_lane_s, std::vector<double> *road_width);
138 bool GetParkingBoundary(
const ParkingInfo &parking_info,
140 std::vector<std::vector<common::math::Vec2d>>
141 *
const roi_parking_boundary);
143 bool GetParkingOutBoundary(
const hdmap::Path &nearby_path,
Frame *
const frame,
144 std::vector<std::vector<common::math::Vec2d>>
145 *
const roi_parking_boundary);
147 bool GetPullOverBoundary(
Frame *
const frame,
148 const std::array<common::math::Vec2d, 4> &vertices,
150 std::vector<std::vector<common::math::Vec2d>>
151 *
const roi_parking_boundary);
153 bool GetParkAndGoBoundary(
Frame *
const frame,
const hdmap::Path &nearby_path,
154 std::vector<std::vector<common::math::Vec2d>>
155 *
const roi_parking_boundary);
159 void SearchTargetParkingSpotOnPath(
164 bool FuseLineSegments(
165 std::vector<std::vector<common::math::Vec2d>> *line_segments_vec);
168 bool FormulateBoundaryConstraints(
169 const std::vector<std::vector<common::math::Vec2d>> &roi_parking_boundary,
175 bool LoadObstacleInVertices(
176 const std::vector<std::vector<common::math::Vec2d>> &roi_parking_boundary,
179 bool FilterOutObstacle(
const Frame &frame,
const Obstacle &obstacle);
183 bool LoadObstacleInHyperPlanes(
Frame *
const frame);
186 bool GetHyperPlanes(
const size_t &obstacles_num,
187 const Eigen::MatrixXi &obstacles_edges_num,
188 const std::vector<std::vector<common::math::Vec2d>>
189 &obstacles_vertices_vec,
190 Eigen::MatrixXd *A_all, Eigen::MatrixXd *b_all);
197 bool IsInParkingLot(
const double adc_init_x,
const double adc_init_y,
198 const double adc_init_heading,
199 std::array<common::math::Vec2d, 4> *parking_lot_vertices);
207 std::array<common::math::Vec2d, 4> *vertices);
216 std::vector<routing::LaneSegment> *routing_segments);
220 std::shared_ptr<hdmap::Path> *nearby_path);
221 bool AdjustPointsOrderToClockwise(std::vector<common::math::Vec2d> *polygon);
223 bool AddParkingSpaceBoundary(
Frame *
const frame,
225 std::vector<std::vector<common::math::Vec2d>>
226 *
const roi_parking_boundary);
230 std::string target_parking_spot_id_;
231 std::shared_ptr<apollo::hdmap::Path> nearby_path_;
240 bool is_parking_out =
false;