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
@@ -560,7 +562,7 @@ bool checkCollision(
560
562
{
561
563
const auto collided_polygons = getCollidedPolygons (
562
564
planned_path, predicted_ego_path, target_object, target_object_path, common_parameters,
563
- rss_parameters, hysteresis_factor, debug);
565
+ rss_parameters, hysteresis_factor, std::numeric_limits< double >:: max (), debug);
564
566
return collided_polygons.empty ();
565
567
}
566
568
@@ -570,7 +572,7 @@ std::vector<Polygon2d> getCollidedPolygons(
570
572
const ExtendedPredictedObject & target_object,
571
573
const PredictedPathWithPolygon & target_object_path,
572
574
const BehaviorPathPlannerParameters & common_parameters, const RSSparams & rss_parameters,
573
- double hysteresis_factor, CollisionCheckDebug & debug)
575
+ double hysteresis_factor, const double max_velocity_limit, CollisionCheckDebug & debug)
574
576
{
575
577
{
576
578
debug.ego_predicted_path = predicted_ego_path;
@@ -586,7 +588,7 @@ std::vector<Polygon2d> getCollidedPolygons(
586
588
// get object information at current time
587
589
const auto & obj_pose = obj_pose_with_poly.pose ;
588
590
const auto & obj_polygon = obj_pose_with_poly.poly ;
589
- const auto & object_velocity = obj_pose_with_poly.velocity ;
591
+ const auto object_velocity = obj_pose_with_poly.velocity ;
590
592
591
593
// get ego information at current time
592
594
// Note: we can create these polygons in advance. However, it can decrease the readability and
@@ -599,7 +601,7 @@ std::vector<Polygon2d> getCollidedPolygons(
599
601
}
600
602
const auto & ego_pose = interpolated_data->pose ;
601
603
const auto & ego_polygon = interpolated_data->poly ;
602
- const auto & ego_velocity = interpolated_data->velocity ;
604
+ const auto ego_velocity = std::min ( interpolated_data->velocity , max_velocity_limit) ;
603
605
604
606
// check overlap
605
607
if (boost::geometry::overlaps (ego_polygon, obj_polygon)) {
0 commit comments