Skip to content

Commit

Permalink
style(pre-commit): autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] authored and beyza committed Jun 5, 2024
1 parent 6fed02d commit 9954717
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ std::optional<geometry_msgs::msg::Point> find_closest_collision_point(
abs(dist_obj_to_coll) / object.kinematics.initial_twist_with_covariance.twist.linear.x;
const auto tta_cp_ego =
dist_ego_to_coll / ego_data.path.points[path_idx].point.longitudinal_velocity_mps;
if (abs(dist_ego_to_coll) < closest_dist && std::abs(tta_cp_npc - tta_cp_ego) < params.time_horizon) {
if (
abs(dist_ego_to_coll) < closest_dist &&
std::abs(tta_cp_npc - tta_cp_ego) < params.time_horizon) {
closest_dist = dist_ego_to_coll;
closest_collision_point = p;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,17 @@ std::vector<autoware_perception_msgs::msg::PredictedObject> filter_predicted_obj
const auto obj_arc_length = motion_utils::calcSignedArcLength(
ego_data.path.points, ego_data.pose.position,
o.kinematics.initial_pose_with_covariance.pose.position);

bool is_behind_object = obj_arc_length < 0.0 && std::abs(obj_arc_length) < params.behind_object_distance_threshold + o.shape.dimensions.x / 2.0;
bool is_near_ego = obj_arc_length > 0.0 && obj_arc_length < params.behind_object_distance_threshold + o.shape.dimensions.x / 2.0;

bool is_behind_object =
obj_arc_length < 0.0 && std::abs(obj_arc_length) < params.behind_object_distance_threshold +
o.shape.dimensions.x / 2.0;
bool is_near_ego =
obj_arc_length > 0.0 &&
obj_arc_length < params.behind_object_distance_threshold + o.shape.dimensions.x / 2.0;
bool is_in_front_of_ego = obj_arc_length > o.shape.dimensions.x / 2.0;
bool is_past_ego_end = obj_arc_length > ego_data.longitudinal_offset_to_first_path_idx + params.ego_longitudinal_offset + o.shape.dimensions.x / 2.0;
bool is_past_ego_end = obj_arc_length > ego_data.longitudinal_offset_to_first_path_idx +
params.ego_longitudinal_offset +
o.shape.dimensions.x / 2.0;

if (!params.ignore_objects_behind_ego)
return is_behind_object || (is_near_ego || (is_in_front_of_ego && is_past_ego_end));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ bool DynamicObstacleStopModule::modifyPathVelocity(PathWithLaneId * path, StopRe
}
} else {
stopwatch.tic("footprints");
obstacle_forward_footprints.push_back(make_forward_footprints(dynamic_obstacles, params_, hysteresis));
obstacle_forward_footprints.push_back(
make_forward_footprints(dynamic_obstacles, params_, hysteresis));
footprints_duration_us = stopwatch.toc("footprints");
stopwatch.tic("collisions");
collisions = find_collisions(ego_data, dynamic_obstacles, obstacle_forward_footprints, params_);
Expand Down

0 comments on commit 9954717

Please sign in to comment.