Skip to content

Commit 2bba956

Browse files
pre-commit-ci[bot]beyza
authored and
beyza
committed
style(pre-commit): autofix
1 parent 1914ff3 commit 2bba956

File tree

6 files changed

+19
-11
lines changed

6 files changed

+19
-11
lines changed

planning/behavior_velocity_dynamic_obstacle_stop_module/config/dynamic_obstacle_stop.param.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
minimum_object_distance_from_ego_path: 1.0 # [m] minimum distance between the footprints of ego and an object to consider for collision
1414
ignore_unavoidable_collisions : true # if true, ignore collisions that cannot be avoided by stopping (assuming the obstacle continues going straight)
1515
ignore_objects_behind_ego: false # if true, ignore objects that are behind the ego vehicle
16-
behind_object_distance_threshold: 5.0 # [m] distance behind the ego vehicle to ignore objects
16+
behind_object_distance_threshold: 5.0 # [m] distance behind the ego vehicle to ignore objects

planning/behavior_velocity_dynamic_obstacle_stop_module/src/collision.cpp

+8-4
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ std::optional<geometry_msgs::msg::Point> find_closest_collision_point(
4242
const auto & ego_pose = ego_data.path.points[path_idx].point.pose;
4343
const auto angle_diff = tier4_autoware_utils::normalizeRadian(
4444
tf2::getYaw(ego_pose.orientation) - tf2::getYaw(object_pose.orientation));
45-
if ((!params.ignore_objects_behind_ego && std::abs(angle_diff) < params.yaw_threshold_behind_object) ||
46-
std::abs(angle_diff) > params.yaw_threshold) {
45+
if (
46+
(!params.ignore_objects_behind_ego &&
47+
std::abs(angle_diff) < params.yaw_threshold_behind_object) ||
48+
std::abs(angle_diff) > params.yaw_threshold) {
4749
tier4_autoware_utils::MultiPoint2d collision_points;
4850
boost::geometry::intersection(
4951
object_footprint.outer(), ego_footprint.outer(), collision_points);
@@ -64,13 +66,15 @@ std::optional<geometry_msgs::msg::Point> find_closest_collision_point(
6466
std::vector<Collision> find_collisions(
6567
const EgoData & ego_data,
6668
const std::vector<autoware_auto_perception_msgs::msg::PredictedObject> & objects,
67-
const tier4_autoware_utils::MultiPolygon2d & object_forward_footprints, const PlannerParam & params)
69+
const tier4_autoware_utils::MultiPolygon2d & object_forward_footprints,
70+
const PlannerParam & params)
6871
{
6972
std::vector<Collision> collisions;
7073
for (auto object_idx = 0UL; object_idx < objects.size(); ++object_idx) {
7174
const auto & object_pose = objects[object_idx].kinematics.initial_pose_with_covariance.pose;
7275
const auto & object_footprint = object_forward_footprints[object_idx];
73-
const auto collision = find_closest_collision_point(ego_data, object_pose, object_footprint, params);
76+
const auto collision =
77+
find_closest_collision_point(ego_data, object_pose, object_footprint, params);
7478
if (collision) {
7579
Collision c;
7680
c.object_uuid = tier4_autoware_utils::toHexString(objects[object_idx].object_id);

planning/behavior_velocity_dynamic_obstacle_stop_module/src/collision.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ std::optional<geometry_msgs::msg::Point> find_closest_collision_point(
3939
std::vector<Collision> find_collisions(
4040
const EgoData & ego_data,
4141
const std::vector<autoware_auto_perception_msgs::msg::PredictedObject> & objects,
42-
const tier4_autoware_utils::MultiPolygon2d & obstacle_forward_footprints, const PlannerParam & params);
42+
const tier4_autoware_utils::MultiPolygon2d & obstacle_forward_footprints,
43+
const PlannerParam & params);
4344

4445
} // namespace behavior_velocity_planner::dynamic_obstacle_stop
4546

planning/behavior_velocity_dynamic_obstacle_stop_module/src/manager.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ DynamicObstacleStopModuleManager::DynamicObstacleStopModuleManager(rclcpp::Node
3535
pp.stop_distance_buffer = getOrDeclareParameter<double>(node, ns + ".stop_distance_buffer");
3636
pp.time_horizon = getOrDeclareParameter<double>(node, ns + ".time_horizon");
3737
pp.yaw_threshold = getOrDeclareParameter<double>(node, ns + ".yaw_threshold");
38-
pp.yaw_threshold_behind_object = getOrDeclareParameter<double>(node, ns + ".yaw_threshold_behind_object");
38+
pp.yaw_threshold_behind_object =
39+
getOrDeclareParameter<double>(node, ns + ".yaw_threshold_behind_object");
3940
pp.hysteresis = getOrDeclareParameter<double>(node, ns + ".hysteresis");
4041
pp.add_duration_buffer = getOrDeclareParameter<double>(node, ns + ".add_stop_duration_buffer");
4142
pp.remove_duration_buffer =

planning/behavior_velocity_dynamic_obstacle_stop_module/src/object_filtering.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ std::vector<autoware_auto_perception_msgs::msg::PredictedObject> filter_predicte
5656
const auto obj_arc_length = motion_utils::calcSignedArcLength(
5757
ego_data.path.points, ego_data.pose.position,
5858
o.kinematics.initial_pose_with_covariance.pose.position);
59-
if(!params.ignore_objects_behind_ego){
59+
if (!params.ignore_objects_behind_ego) {
6060
return (obj_arc_length < 0.0 &&
61-
std::abs(obj_arc_length) < params.behind_object_distance_threshold + o.shape.dimensions.x / 2.0) ||
61+
std::abs(obj_arc_length) <
62+
params.behind_object_distance_threshold + o.shape.dimensions.x / 2.0) ||
6263
obj_arc_length > ego_data.longitudinal_offset_to_first_path_idx +
63-
params.ego_longitudinal_offset + o.shape.dimensions.x / 2.0;
64+
params.ego_longitudinal_offset + o.shape.dimensions.x / 2.0;
6465
}
6566
return obj_arc_length > ego_data.longitudinal_offset_to_first_path_idx +
6667
params.ego_longitudinal_offset + o.shape.dimensions.x / 2.0;

planning/behavior_velocity_dynamic_obstacle_stop_module/src/scene_dynamic_obstacle_stop.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ bool DynamicObstacleStopModule::modifyPathVelocity(PathWithLaneId * path, StopRe
9191
make_forward_footprints(dynamic_obstacles, params_, hysteresis);
9292
const auto footprints_duration_us = stopwatch.toc("footprints");
9393
stopwatch.tic("collisions");
94-
auto collisions = find_collisions(ego_data, dynamic_obstacles, obstacle_forward_footprints, params_);
94+
auto collisions =
95+
find_collisions(ego_data, dynamic_obstacles, obstacle_forward_footprints, params_);
9596
update_object_map(object_map_, collisions, clock_->now(), ego_data.path.points, params_);
9697
std::optional<geometry_msgs::msg::Point> earliest_collision =
9798
find_earliest_collision(object_map_, ego_data);

0 commit comments

Comments
 (0)