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 ahmeddesokyebrahim committed Jul 11, 2023
1 parent 4f9bade commit 042aeea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# output
output_delta_arc_length: 0.5 # delta arc length for output trajectory [m]
output_backward_traj_length: 5.0 # backward length for backward trajectory from base_link [m]

vehicle_stop_margin_outside_drivable_area: 1.5 # vehicle stop margin to let the vehicle stop before the calculated stop point if it is calculated outside the drivable area [m] .
# This margin will be realized with delta_arc_length_for_mpt_points m precision.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,8 @@ class ObstacleAvoidancePlanner : public rclcpp::Node
void publishVirtualWall(const geometry_msgs::msg::Pose & stop_pose) const;
void publishDebugMarkerOfOptimization(const std::vector<TrajectoryPoint> & traj_points) const;

private:
private:
double vehicle_stop_margin_outside_drivable_area_;

};
} // namespace obstacle_avoidance_planner

Expand Down
6 changes: 4 additions & 2 deletions planning/obstacle_avoidance_planner/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,13 @@ void ObstacleAvoidancePlanner::insertZeroVelocityOutsideDrivableArea(
for (size_t i = *first_outside_idx; i < optimized_traj_points.size(); ++i) {
size_t stop_idx = i;
const auto & op_target_point = motion_utils::calcLongitudinalOffsetPoint(
optimized_traj_points, optimized_traj_points.at(i).pose.position, -1.0 * vehicle_stop_margin_outside_drivable_area_);
optimized_traj_points, optimized_traj_points.at(i).pose.position,
-1.0 * vehicle_stop_margin_outside_drivable_area_);
if (op_target_point) {
const auto target_point = op_target_point.get();
// confirm that target point doesn't overlap with the stop point outside drivable area
const auto dist = tier4_autoware_utils::calcDistance2d(optimized_traj_points.at(i), target_point);
const auto dist =
tier4_autoware_utils::calcDistance2d(optimized_traj_points.at(i), target_point);
const double overlap_threshold = 1e-3;
if (dist > overlap_threshold) {
stop_idx = motion_utils::findNearestSegmentIndex(optimized_traj_points, target_point);
Expand Down

0 comments on commit 042aeea

Please sign in to comment.