Apollo 11.0
自动驾驶开放平台
open_space_roi_wrapper.cc
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 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#include "Eigen/Dense"
22
23#include "modules/planning/planning_open_space/proto/planner_open_space_config.pb.h"
24
25#include "cyber/common/file.h"
31
32namespace apollo {
33namespace planning {
34
41
42constexpr double kMathEpsilon = 1e-10;
43
45public:
46 bool OpenSpaceROI() {
47 // left or right of the parking lot is decided when viewing the parking spot
48 // open upward
49 Vec2d left_top = target_parking_spot_->polygon().points().at(3);
50 Vec2d left_down = target_parking_spot_->polygon().points().at(0);
51 Vec2d right_top = target_parking_spot_->polygon().points().at(2);
52 Vec2d right_down = target_parking_spot_->polygon().points().at(1);
53 double left_top_s = 0.0;
54 double left_top_l = 0.0;
55 double right_top_s = 0.0;
56 double right_top_l = 0.0;
57 if (!(nearby_path_->GetProjection(left_top, &left_top_s, &left_top_l)
58 && nearby_path_->GetProjection(right_top, &right_top_s, &right_top_l))) {
59 AERROR << "fail to get parking spot points' projections "
60 "on reference line";
61 return false;
62 }
63 // start or end, left or right is decided by the vehicle's heading
64 double center_line_s = (left_top_s + right_top_s) / 2;
65 double start_s = center_line_s - planner_open_space_config_.roi_config().roi_longitudinal_range_start();
66 double end_s = center_line_s + planner_open_space_config_.roi_config().roi_longitudinal_range_end();
67 hdmap::MapPathPoint end_point = nearby_path_->GetSmoothPoint(end_s);
68 hdmap::MapPathPoint start_point = nearby_path_->GetSmoothPoint(start_s);
69 double start_left_width = nearby_path_->GetRoadLeftWidth(start_s);
70 double start_right_width = nearby_path_->GetRoadRightWidth(start_s);
71 double end_left_width = nearby_path_->GetRoadLeftWidth(end_s);
72 double end_right_width = nearby_path_->GetRoadRightWidth(end_s);
73 double start_right_vec_cos = std::cos(start_point.heading() - M_PI / 2);
74 double start_right_vec_sin = std::sin(start_point.heading() - M_PI / 2);
75 double start_left_vec_cos = std::cos(start_point.heading() + M_PI / 2);
76 double start_left_vec_sin = std::sin(start_point.heading() + M_PI / 2);
77 double end_right_vec_cos = std::cos(end_point.heading() - M_PI / 2);
78 double end_right_vec_sin = std::sin(end_point.heading() - M_PI / 2);
79 double end_left_vec_cos = std::cos(end_point.heading() + M_PI / 2);
80 double end_left_vec_sin = std::sin(end_point.heading() + M_PI / 2);
81
82 Vec2d start_right = Vec2d(start_right_width * start_right_vec_cos, start_right_width * start_right_vec_sin);
83 start_right = start_right + start_point;
84 Vec2d start_left = Vec2d(start_left_width * start_left_vec_cos, start_left_width * start_left_vec_sin);
85 start_left = start_left + start_point;
86 Vec2d end_right = Vec2d(end_right_width * end_right_vec_cos, end_right_width * end_right_vec_sin);
87 end_right = end_right + end_point;
88 Vec2d end_left = Vec2d(end_left_width * end_left_vec_cos, end_left_width * end_left_vec_sin);
89 end_left = end_left + end_point;
90
91 // rotate the points to have the lane to be horizontal to x axis and scale
92 // them base on the origin point
93 origin_heading_ = nearby_path_->GetSmoothPoint(center_line_s).heading();
94 origin_point_.set_x(left_top.x());
95 origin_point_.set_y(left_top.y());
96 left_top -= origin_point_;
97 left_down -= origin_point_;
98 right_top -= origin_point_;
99 right_down -= origin_point_;
100 start_right -= origin_point_;
101 start_left -= origin_point_;
102 end_right -= origin_point_;
103 end_left -= origin_point_;
104 AINFO << "left_down x " << left_down.x();
105 AINFO << "right_down x " << right_down.x();
106 AINFO << "left_top x " << left_top.x();
107 left_top.SelfRotate(-origin_heading_);
108 left_down.SelfRotate(-origin_heading_);
109 right_top.SelfRotate(-origin_heading_);
110 right_down.SelfRotate(-origin_heading_);
111 start_right.SelfRotate(-origin_heading_);
112 start_left.SelfRotate(-origin_heading_);
113 end_right.SelfRotate(-origin_heading_);
114 end_left.SelfRotate(-origin_heading_);
115
116 // get end_pose of the parking spot
117 parking_spot_heading_ = (left_down - left_top).Angle();
118 double end_x = (left_top.x() + right_top.x()) / 2;
119 double end_y = 0.0;
120 if (parking_spot_heading_ > kMathEpsilon) {
121 if (planner_open_space_config_.roi_config().parking_inwards()) {
122 end_y = left_top.y() + (left_down.y() - left_top.y()) / 4;
123 } else {
124 end_y = left_top.y() + 3 * (left_down.y() - left_top.y()) / 4;
125 }
126 } else {
127 if (planner_open_space_config_.roi_config().parking_inwards()) {
128 end_y = left_down.y() + 3 * (left_top.y() - left_down.y()) / 4;
129 } else {
130 end_y = left_down.y() + (left_top.y() - left_down.y()) / 4;
131 }
132 }
133 open_space_end_pose_.emplace_back(end_x);
134 open_space_end_pose_.emplace_back(end_y);
135 if (planner_open_space_config_.roi_config().parking_inwards()) {
136 open_space_end_pose_.emplace_back(parking_spot_heading_);
137 } else {
138 open_space_end_pose_.emplace_back(common::math::NormalizeAngle(parking_spot_heading_ + M_PI));
139 }
140 open_space_end_pose_.emplace_back(0.0);
141
142 // get xy boundary of the ROI
143 double x_min = std::min({start_left.x(), start_right.x()});
144 double x_max = std::max({end_left.x(), end_right.x()});
145 double y_min = std::min({left_down.y(), start_right.y(), start_left.y()});
146 double y_max = std::max({left_down.y(), start_right.y(), start_left.y()});
147 ROI_xy_boundary_.emplace_back(x_min);
148 ROI_xy_boundary_.emplace_back(x_max);
149 ROI_xy_boundary_.emplace_back(y_min);
150 ROI_xy_boundary_.emplace_back(y_max);
151
152 // If smaller than zero, the parking spot is on the right of the lane
153 // Left, right, down or up of the boundary is decided when viewing the
154 // parking spot upward
155 std::vector<Vec2d> left_boundary;
156 std::vector<Vec2d> down_boundary;
157 std::vector<Vec2d> right_boundary;
158 std::vector<Vec2d> up_boundary;
159
160 if (left_top_l < 0) {
161 start_right.set_x(-left_top_l * start_right_vec_cos);
162 start_right.set_y(-left_top_l * start_right_vec_sin);
163 start_right = start_right + start_point;
164 end_right.set_x(-left_top_l * end_right_vec_cos);
165 end_right.set_y(-left_top_l * end_right_vec_sin);
166 end_right = end_right + end_point;
167 start_right -= origin_point_;
168 end_right -= origin_point_;
169 start_right.SelfRotate(-origin_heading_);
170 end_right.SelfRotate(-origin_heading_);
171 left_boundary.push_back(start_right);
172 left_boundary.push_back(left_top);
173 left_boundary.push_back(left_down);
174 down_boundary.push_back(left_down);
175 down_boundary.push_back(right_down);
176 right_boundary.push_back(right_down);
177 right_boundary.push_back(right_top);
178 right_boundary.push_back(end_right);
179 up_boundary.push_back(end_left);
180 up_boundary.push_back(start_left);
181 } else {
182 start_left.set_x(left_top_l * start_left_vec_cos);
183 start_left.set_y(left_top_l * start_left_vec_sin);
184 start_left = start_left + start_point;
185 end_left.set_x(left_top_l * end_left_vec_cos);
186 end_left.set_y(left_top_l * end_left_vec_sin);
187 end_left = end_left + end_point;
188 start_left -= origin_point_;
189 end_left -= origin_point_;
190 start_left.SelfRotate(-origin_heading_);
191 end_left.SelfRotate(-origin_heading_);
192 left_boundary.push_back(end_left);
193 left_boundary.push_back(left_top);
194 left_boundary.push_back(left_down);
195 down_boundary.push_back(left_down);
196 down_boundary.push_back(right_down);
197 right_boundary.push_back(right_down);
198 right_boundary.push_back(right_top);
199 right_boundary.push_back(start_left);
200 up_boundary.push_back(start_right);
201 up_boundary.push_back(end_right);
202 }
203 ROI_parking_boundary_.emplace_back(left_boundary);
204 ROI_parking_boundary_.emplace_back(down_boundary);
205 ROI_parking_boundary_.emplace_back(right_boundary);
206 ROI_parking_boundary_.emplace_back(up_boundary);
207
208 return true;
209 }
210
212 // left or right of the parking lot is decided when viewing the parking spot
213 // open upward
214 Vec2d left_top = target_parking_spot_->polygon().points().at(3);
215 Vec2d left_down = target_parking_spot_->polygon().points().at(0);
216 Vec2d right_top = target_parking_spot_->polygon().points().at(2);
217 Vec2d right_down = target_parking_spot_->polygon().points().at(1);
218 double left_top_s = 0.0;
219 double left_top_l = 0.0;
220 double right_top_s = 0.0;
221 double right_top_l = 0.0;
222 if (!(nearby_path_->GetProjection(left_top, &left_top_s, &left_top_l)
223 && nearby_path_->GetProjection(right_top, &right_top_s, &right_top_l))) {
224 AERROR << "fail to get parking spot points' projections "
225 "on reference line";
226 return false;
227 }
228 // start or end, left or right is decided by the vehicle's heading
229 double center_line_s = (left_top_s + right_top_s) / 2;
230 double start_s = center_line_s - planner_open_space_config_.roi_config().roi_longitudinal_range_start();
231 double end_s = center_line_s + planner_open_space_config_.roi_config().roi_longitudinal_range_end();
232 hdmap::MapPathPoint end_point = nearby_path_->GetSmoothPoint(end_s);
233 hdmap::MapPathPoint start_point = nearby_path_->GetSmoothPoint(start_s);
234 double start_left_width = nearby_path_->GetRoadLeftWidth(start_s);
235 double start_right_width = nearby_path_->GetRoadRightWidth(start_s);
236 double end_left_width = nearby_path_->GetRoadLeftWidth(end_s);
237 double end_right_width = nearby_path_->GetRoadRightWidth(end_s);
238
239 double start_right_vec_cos = std::cos(start_point.heading() - M_PI / 2);
240 double start_right_vec_sin = std::sin(start_point.heading() - M_PI / 2);
241 double start_left_vec_cos = std::cos(start_point.heading() + M_PI / 2);
242 double start_left_vec_sin = std::sin(start_point.heading() + M_PI / 2);
243 double end_right_vec_cos = std::cos(end_point.heading() - M_PI / 2);
244 double end_right_vec_sin = std::sin(end_point.heading() - M_PI / 2);
245 double end_left_vec_cos = std::cos(end_point.heading() + M_PI / 2);
246 double end_left_vec_sin = std::sin(end_point.heading() + M_PI / 2);
247
248 Vec2d start_right = Vec2d(start_right_width * start_right_vec_cos, start_right_width * start_right_vec_sin);
249 start_right = start_right + start_point;
250 Vec2d start_left = Vec2d(start_left_width * start_left_vec_cos, start_left_width * start_left_vec_sin);
251 start_left = start_left + start_point;
252 Vec2d end_right = Vec2d(end_right_width * end_right_vec_cos, end_right_width * end_right_vec_sin);
253 end_right = end_right + end_point;
254 Vec2d end_left = Vec2d(end_left_width * end_left_vec_cos, end_left_width * end_left_vec_sin);
255 end_left = end_left + end_point;
256
257 // get end_pose of the parking spot
258 double heading = (left_down - left_top).Angle();
259 double x = (left_top.x() + right_top.x()) / 2;
260 double y = 0.0;
261 if (heading > kMathEpsilon) {
262 y = left_top.y() + (-left_top.y() + left_down.y()) / 4;
263 } else {
264 y = left_down.y() + 3 * (left_top.y() - left_down.y()) / 4;
265 }
266 open_space_end_pose_.emplace_back(x);
267 open_space_end_pose_.emplace_back(y);
268 open_space_end_pose_.emplace_back(heading);
269 open_space_end_pose_.emplace_back(0.0);
270
271 // get xy boundary of the ROI
272 double x_min = std::min({start_left.x(), start_right.x()});
273 double x_max = std::max({end_left.x(), end_right.x()});
274 double y_min = std::min({left_down.y(), start_right.y(), start_left.y()});
275 double y_max = std::max({left_down.y(), start_right.y(), start_left.y()});
276 ROI_xy_boundary_.emplace_back(x_min);
277 ROI_xy_boundary_.emplace_back(x_max);
278 ROI_xy_boundary_.emplace_back(y_min);
279 ROI_xy_boundary_.emplace_back(y_max);
280
281 // If smaller than zero, the parking spot is on the right of the lane
282 // Left, right, down or up of the boundary is decided when viewing the
283 // parking spot upward
284 std::vector<Vec2d> left_boundary;
285 std::vector<Vec2d> down_boundary;
286 std::vector<Vec2d> right_boundary;
287 std::vector<Vec2d> up_boundary;
288
289 if (left_top_l < 0) {
290 start_right.set_x(-left_top_l * start_right_vec_cos);
291 start_right.set_y(-left_top_l * start_right_vec_sin);
292 start_right = start_right + start_point;
293 end_right.set_x(-left_top_l * end_right_vec_cos);
294 end_right.set_y(-left_top_l * end_right_vec_sin);
295 end_right = end_right + end_point;
296 left_boundary.push_back(start_right);
297 left_boundary.push_back(left_top);
298 left_boundary.push_back(left_down);
299 down_boundary.push_back(left_down);
300 down_boundary.push_back(right_down);
301 right_boundary.push_back(right_down);
302 right_boundary.push_back(right_top);
303 right_boundary.push_back(end_right);
304 up_boundary.push_back(end_left);
305 up_boundary.push_back(start_left);
306 } else {
307 start_left.set_x(left_top_l * start_left_vec_cos);
308 start_left.set_y(left_top_l * start_left_vec_sin);
309 start_left = start_left + start_point;
310 end_left.set_x(left_top_l * end_left_vec_cos);
311 end_left.set_y(left_top_l * end_left_vec_sin);
312 end_left = end_left + end_point;
313 left_boundary.push_back(end_left);
314 left_boundary.push_back(left_top);
315 left_boundary.push_back(left_down);
316 down_boundary.push_back(left_down);
317 down_boundary.push_back(right_down);
318 right_boundary.push_back(right_down);
319 right_boundary.push_back(right_top);
320 right_boundary.push_back(start_left);
321 up_boundary.push_back(start_right);
322 up_boundary.push_back(end_right);
323 }
324 No_rotate_ROI_parking_boundary_.emplace_back(left_boundary);
325 No_rotate_ROI_parking_boundary_.emplace_back(down_boundary);
326 No_rotate_ROI_parking_boundary_.emplace_back(right_boundary);
327 No_rotate_ROI_parking_boundary_.emplace_back(up_boundary);
328
329 return true;
330 }
331
332 bool VPresentationObstacle(const std::string& lane_id, const std::string& parking_id) {
333 if (!LoadMap(lane_id, parking_id)) {
334 AINFO << "fail at loading map";
335 return false;
336 }
337
338 ACHECK(cyber::common::GetProtoFromFile(FLAGS_planner_open_space_config_filename, &planner_open_space_config_))
339 << "Failed to load open space config file " << FLAGS_planner_open_space_config_filename;
340
341 // load info from pnc map
342 if (!OpenSpaceROI()) {
343 AINFO << "fail at ROI()";
344 return false;
345 }
346 if (!NoRotateOpenSpaceROI()) {
347 AINFO << "fail at ROI()";
348 return false;
349 }
350
351 size_t parking_boundaries_num = ROI_parking_boundary_.size();
352
353 if (parking_boundaries_num != 4) {
354 AERROR << "parking boundary obstacles size not right";
355 return false;
356 }
357
358 obstacles_num_ = parking_boundaries_num;
359 // load vertice vector for distance approach
360 Eigen::MatrixXd parking_boundaries_obstacles_edges_num(4, 1);
361 // the order is decided by the ROI()
362 parking_boundaries_obstacles_edges_num << 2, 1, 2, 1;
363 obstacles_edges_num_.resize(parking_boundaries_obstacles_edges_num.rows(), 1);
364 obstacles_edges_num_ << parking_boundaries_obstacles_edges_num;
365 return true;
366 }
367
368 bool LoadMap(const std::string& lane_id, const std::string& parking_id) {
369 std::cout << lane_id << std::endl;
370 std::cout << parking_id << std::endl;
371 auto map_ptr = HDMapUtil::BaseMapPtr();
372 hdmap::Id nearby_lane_id;
373 nearby_lane_id.set_id(lane_id);
374 hdmap::Id target_lane_id;
375 target_lane_id.set_id(parking_id);
376 auto nearby_lane = map_ptr->GetLaneById(nearby_lane_id);
377 if (nearby_lane == nullptr) {
378 std::cout << "No such lane found " << lane_id << std::endl;
379 return false;
380 }
381 std::cout << "the lane found is " << nearby_lane->id().id() << std::endl;
382 LaneSegment nearby_lanesegment
383 = LaneSegment(nearby_lane, nearby_lane->accumulate_s().front(), nearby_lane->accumulate_s().back());
384 std::vector<LaneSegment> segments_vector;
385 segments_vector.push_back(nearby_lanesegment);
386 nearby_path_ = std::unique_ptr<Path>(new Path(segments_vector));
387 const auto& parking_space_overlaps = nearby_path_->parking_space_overlaps();
388 if (parking_space_overlaps.empty()) {
389 std::cout << "No parking overlaps found on the lane requested" << std::endl;
390 return false;
391 }
392 for (const auto parking_overlap : parking_space_overlaps) {
393 if (parking_overlap.object_id != parking_id) {
394 target_parking_spot_ = map_ptr->GetParkingSpaceById(target_lane_id);
395 std::cout << "parking_overlap.object_id is " << target_lane_id.id() << std::endl;
396 }
397 }
398 if (target_parking_spot_ == nullptr) {
399 std::cout << "No such parking spot found " << parking_id << std::endl;
400 return false;
401 }
402 parking_spot_box_ = target_parking_spot_->polygon();
403 return true;
404 }
405
406 std::vector<double>* GetROIXYBoundary() {
407 return &ROI_xy_boundary_;
408 }
409 std::vector<std::vector<Vec2d>>* GetROIParkingBoundary() {
410 return &ROI_parking_boundary_;
411 }
412 std::vector<std::vector<Vec2d>>* GetNoRotateROIParkingBoundary() {
413 return &No_rotate_ROI_parking_boundary_;
414 }
415 std::vector<double>* GetEndPose() {
416 return &open_space_end_pose_;
417 }
419 return origin_heading_;
420 }
422 return origin_point_;
423 }
425 return parking_spot_box_;
426 }
427
428private:
429 apollo::planning::PlannerOpenSpaceConfig planner_open_space_config_;
430 ParkingSpaceInfoConstPtr target_parking_spot_ = nullptr;
431 Polygon2d parking_spot_box_;
432 std::unique_ptr<Path> nearby_path_ = nullptr;
433 size_t obstacles_num_ = 0;
434 Eigen::MatrixXd obstacles_edges_num_;
435 std::vector<double> ROI_xy_boundary_;
436 std::vector<std::vector<Vec2d>> ROI_parking_boundary_;
437 std::vector<std::vector<Vec2d>> No_rotate_ROI_parking_boundary_;
438 std::vector<double> open_space_end_pose_;
439 double origin_heading_;
440 Vec2d origin_point_;
441 double parking_spot_heading_;
442};
443
444extern "C" {
448// all data in form of array
450 OpenSpaceROITest* test_ptr,
451 char* lane_id,
452 char* parking_id,
453 double* unrotated_roi_boundary_x,
454 double* unrotated_roi_boundary_y,
455 double* roi_boundary_x,
456 double* roi_boundary_y,
457 double* parking_spot_x,
458 double* parking_spot_y,
459 double* end_pose,
460 double* xy_boundary,
461 double* origin_pose) {
462 std::string lane_id_str(lane_id);
463 std::string parking_id_str(parking_id);
464 if (!test_ptr->VPresentationObstacle(lane_id_str, parking_id_str)) {
465 AINFO << "VPresentationObstacle fail";
466 return false;
467 }
468 std::vector<std::vector<Vec2d>>* unrotated_roi_boundary_ = test_ptr->GetNoRotateROIParkingBoundary();
469 std::vector<std::vector<Vec2d>>* roi_boundary_ = test_ptr->GetROIParkingBoundary();
470 Polygon2d parking_spot_ = test_ptr->GetParkingSpotBox();
471 std::vector<double>* end_pose_ = test_ptr->GetEndPose();
472 std::vector<double>* xy_boundary_ = test_ptr->GetROIXYBoundary();
473 double origin_heading_ = test_ptr->GetOriginHeading();
474 Vec2d origin_point_ = test_ptr->GetOriginPose();
475
476 // load all into array
477 size_t index = 0;
478 for (size_t i = 0; i < unrotated_roi_boundary_->size(); i++) {
479 std::vector<Vec2d> boundary = unrotated_roi_boundary_->at(i);
480 for (size_t j = 0; j < boundary.size(); j++) {
481 unrotated_roi_boundary_x[index] = boundary[j].x();
482 unrotated_roi_boundary_y[index] = boundary[j].y();
483 index++;
484 }
485 }
486
487 index = 0;
488 for (size_t i = 0; i < roi_boundary_->size(); i++) {
489 std::vector<Vec2d> boundary = roi_boundary_->at(i);
490 for (size_t j = 0; j < boundary.size(); j++) {
491 roi_boundary_x[index] = boundary[j].x();
492 roi_boundary_y[index] = boundary[j].y();
493 index++;
494 }
495 }
496
497 index = 0;
498 std::vector<Vec2d> parking_spot_vec_ = parking_spot_.points();
499 for (size_t i = 0; i < parking_spot_vec_.size(); i++) {
500 parking_spot_x[index] = parking_spot_vec_[i].x();
501 parking_spot_y[index] = parking_spot_vec_[i].y();
502 index++;
503 }
504
505 for (size_t i = 0; i < end_pose_->size(); i++) {
506 end_pose[i] = end_pose_->at(i);
507 }
508
509 for (size_t i = 0; i < xy_boundary_->size(); i++) {
510 xy_boundary[i] = xy_boundary_->at(i);
511 }
512
513 // x, y, heading
514 origin_pose[0] = origin_point_.x();
515 origin_pose[1] = origin_point_.y();
516 origin_pose[2] = origin_heading_;
517
518 return true;
519}
520};
521
522} // namespace planning
523} // namespace apollo
The class of Box2d.
The class of polygon in 2-D.
Definition polygon2d.h:42
const std::vector< Vec2d > & points() const
Get the vertices of the polygon.
Definition polygon2d.h:65
Implements a class of 2-dimensional vectors.
Definition vec2d.h:42
void set_x(const double x)
Setter for x component
Definition vec2d.h:60
void SelfRotate(const double angle)
rotate the vector itself by angle.
Definition vec2d.cc:70
double y() const
Getter for y component
Definition vec2d.h:57
double x() const
Getter for x component
Definition vec2d.h:54
void set_y(const double y)
Setter for y component
Definition vec2d.h:63
static const HDMap * BaseMapPtr()
double heading() const
Definition path.h:118
std::vector< std::vector< Vec2d > > * GetROIParkingBoundary()
std::vector< std::vector< Vec2d > > * GetNoRotateROIParkingBoundary()
bool VPresentationObstacle(const std::string &lane_id, const std::string &parking_id)
bool LoadMap(const std::string &lane_id, const std::string &parking_id)
Planning module main class.
#define ACHECK(cond)
Definition log.h:80
#define AERROR
Definition log.h:44
#define AINFO
Definition log.h:42
double NormalizeAngle(const double angle)
Normalize angle to [-PI, PI).
Definition math_utils.cc:53
bool GetProtoFromFile(const std::string &file_name, google::protobuf::Message *message)
Parses the content of the file specified by the file_name as a representation of protobufs,...
Definition file.cc:132
std::shared_ptr< const ParkingSpaceInfo > ParkingSpaceInfoConstPtr
constexpr double kMathEpsilon
bool ROITest(OpenSpaceROITest *test_ptr, char *lane_id, char *parking_id, double *unrotated_roi_boundary_x, double *unrotated_roi_boundary_y, double *roi_boundary_x, double *roi_boundary_y, double *parking_spot_x, double *parking_spot_y, double *end_pose, double *xy_boundary, double *origin_pose)
OpenSpaceROITest * CreateROITestPtr()
class register implement
Definition arena_queue.h:37
optional string id
Definition map_id.proto:7
Defines the Vec2d class.