Skip to content

Commit 4edb973

Browse files
authored
fix(out_of_lane): fix object path time collision calculation (#10267)
fix collision time calculation Signed-off-by: mohammad alqudah <alqudah.mohammad@tier4.jp>
1 parent 0f1bfb6 commit 4edb973

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

planning/motion_velocity_planner/autoware_motion_velocity_out_of_lane_module/src/out_of_lane_collisions.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,8 @@ void calculate_object_path_time_collisions(
6161
const autoware_perception_msgs::msg::Shape & object_shape)
6262
{
6363
const auto time_step = rclcpp::Duration(object_path.time_step).seconds();
64-
auto time = time_step;
64+
auto time = 0.0;
6565
for (const auto & object_pose : object_path.path) {
66-
time += time_step;
6766
const auto object_footprint = autoware_utils::to_polygon2d(object_pose, object_shape);
6867
std::vector<OutAreaNode> query_results;
6968
out_of_lane_data.outside_areas_rtree.query(
@@ -74,6 +73,7 @@ void calculate_object_path_time_collisions(
7473
potential_collision_indexes.insert(index);
7574
}
7675
update_collision_times(out_of_lane_data, potential_collision_indexes, object_footprint, time);
76+
time += time_step;
7777
}
7878
}
7979

@@ -117,10 +117,8 @@ void calculate_collisions_to_avoid(
117117
const std::vector<autoware_planning_msgs::msg::TrajectoryPoint> & trajectory,
118118
const PlannerParam & params)
119119
{
120-
for (auto & out_of_lane_point : out_of_lane_data.outside_points) {
121-
calculate_min_max_arrival_times(out_of_lane_point, trajectory);
122-
}
123120
for (auto & p : out_of_lane_data.outside_points) {
121+
calculate_min_max_arrival_times(p, trajectory);
124122
if (params.mode == "ttc") {
125123
p.to_avoid = p.ttc && p.ttc <= params.ttc_threshold;
126124
} else {

0 commit comments

Comments
 (0)