Skip to content

Commit

Permalink
fix(autoware_behavior_velocity_intersection_module): fix shadowFuncti…
Browse files Browse the repository at this point in the history
…on (autowarefoundation#7835)

* fix(autoware_behavior_velocity_intersection_module): fix shadowFunction

Signed-off-by: Ryuta Kambe <[email protected]>

* style(pre-commit): autofix

---------

Signed-off-by: Ryuta Kambe <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
veqcc and pre-commit-ci[bot] authored Jul 4, 2024
1 parent 3d3118a commit 3abdced
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ void IntersectionLanelets::update(
}
}
if (first_attention_lane_ && !second_attention_lane_ && !second_attention_lane_empty_) {
const auto first_attention_lane = first_attention_lane_.value();
// remove first_attention_area_ and non-straight lanelets from attention_non_preceding
lanelet::ConstLanelets attention_non_preceding_ex_first;
lanelet::ConstLanelets sibling_first_attention_lanelets;
for (const auto & previous : routing_graph_ptr->previous(first_attention_lane)) {
for (const auto & previous : routing_graph_ptr->previous(first_attention_lane_.value())) {
for (const auto & following : routing_graph_ptr->following(previous)) {
sibling_first_attention_lanelets.push_back(following);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,9 @@ bool ObjectInfo::can_stop_before_stopline(const double brake_deceleration) const
if (!dist_to_stopline_opt) {
return false;
}
const double observed_velocity =
predicted_object_.kinematics.initial_twist_with_covariance.twist.linear.x;
const double velocity = predicted_object_.kinematics.initial_twist_with_covariance.twist.linear.x;
const double dist_to_stopline = dist_to_stopline_opt.value();
const double braking_distance =
(observed_velocity * observed_velocity) / (2.0 * brake_deceleration);
const double braking_distance = (velocity * velocity) / (2.0 * brake_deceleration);
return dist_to_stopline > braking_distance;
}

Expand All @@ -153,10 +151,8 @@ bool ObjectInfo::can_stop_before_ego_lane(
return false;
}
const double dist_to_stopline = dist_to_stopline_opt.value();
const double observed_velocity =
predicted_object_.kinematics.initial_twist_with_covariance.twist.linear.x;
const double braking_distance =
(observed_velocity * observed_velocity) / (2.0 * brake_deceleration);
const double velocity = predicted_object_.kinematics.initial_twist_with_covariance.twist.linear.x;
const double braking_distance = (velocity * velocity) / (2.0 * brake_deceleration);
if (dist_to_stopline > braking_distance) {
return false;
}
Expand Down

0 comments on commit 3abdced

Please sign in to comment.