26
26
#include < boost/geometry/algorithms/union.hpp>
27
27
#include < boost/geometry/strategies/strategies.hpp>
28
28
29
+ #include < limits>
30
+
29
31
namespace behavior_path_planner ::utils::path_safety_checker
30
32
{
31
33
@@ -478,7 +480,7 @@ bool checkCollision(
478
480
{
479
481
const auto collided_polygons = getCollidedPolygons (
480
482
planned_path, predicted_ego_path, target_object, target_object_path, common_parameters,
481
- rss_parameters, hysteresis_factor, debug);
483
+ rss_parameters, hysteresis_factor, std::numeric_limits< double >:: max (), debug);
482
484
return collided_polygons.empty ();
483
485
}
484
486
@@ -488,7 +490,7 @@ std::vector<Polygon2d> getCollidedPolygons(
488
490
const ExtendedPredictedObject & target_object,
489
491
const PredictedPathWithPolygon & target_object_path,
490
492
const BehaviorPathPlannerParameters & common_parameters, const RSSparams & rss_parameters,
491
- double hysteresis_factor, CollisionCheckDebug & debug)
493
+ double hysteresis_factor, const double max_velocity_limit, CollisionCheckDebug & debug)
492
494
{
493
495
{
494
496
debug.ego_predicted_path = predicted_ego_path;
@@ -504,7 +506,7 @@ std::vector<Polygon2d> getCollidedPolygons(
504
506
// get object information at current time
505
507
const auto & obj_pose = obj_pose_with_poly.pose ;
506
508
const auto & obj_polygon = obj_pose_with_poly.poly ;
507
- const auto & object_velocity = obj_pose_with_poly.velocity ;
509
+ const auto object_velocity = obj_pose_with_poly.velocity ;
508
510
509
511
// get ego information at current time
510
512
// Note: we can create these polygons in advance. However, it can decrease the readability and
@@ -517,7 +519,7 @@ std::vector<Polygon2d> getCollidedPolygons(
517
519
}
518
520
const auto & ego_pose = interpolated_data->pose ;
519
521
const auto & ego_polygon = interpolated_data->poly ;
520
- const auto & ego_velocity = interpolated_data->velocity ;
522
+ const auto ego_velocity = std::min ( interpolated_data->velocity , max_velocity_limit) ;
521
523
522
524
// check overlap
523
525
if (boost::geometry::overlaps (ego_polygon, obj_polygon)) {
0 commit comments