Commit de8fc13 1 parent b1dc13a commit de8fc13 Copy full SHA for de8fc13
File tree 1 file changed +4
-3
lines changed
planning/behavior_velocity_dynamic_obstacle_stop_module/src
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -67,10 +67,11 @@ std::vector<autoware_auto_perception_msgs::msg::PredictedObject> filter_predicte
67
67
const auto opposite_heading = yaw_diff > M_PI_2 + M_PI_4;
68
68
const auto collision_distance_threshold =
69
69
params.ego_lateral_offset + o.shape .dimensions .y / 2.0 + params.hysteresis ;
70
- auto has_collision = std::abs (
70
+ // https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line#Line_defined_by_point_and_angle
71
+ const auto lat_distance = std::abs (
71
72
(o_pose.position .y - ego_data.pose .position .y ) * std::cos (o_yaw) -
72
- (o_pose.position .x - ego_data.pose .position .x ) * std::sin (o_yaw)) <=
73
- collision_distance_threshold;
73
+ (o_pose.position .x - ego_data.pose .position .x ) * std::sin (o_yaw));
74
+ auto has_collision = lat_distance <= collision_distance_threshold;
74
75
if (ego_data.earliest_stop_pose ) {
75
76
const auto collision_at_earliest_stop_pose =
76
77
std::abs (
You can’t perform that action at this time.
0 commit comments