Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(obstacle_cruise_planner): use motion utils #1381

Merged
merged 10 commits into from
Jul 21, 2022

Conversation

purewater0901
Copy link
Contributor

@purewater0901 purewater0901 commented Jul 20, 2022

Signed-off-by: yutaka purewater0901@gmail.com

Description

Use insert stop point from motion utils to get the accurate stop distance

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

Signed-off-by: yutaka <purewater0901@gmail.com>
@purewater0901 purewater0901 marked this pull request as ready for review July 20, 2022 07:25
Signed-off-by: yutaka <purewater0901@gmail.com>
@codecov
Copy link

codecov bot commented Jul 20, 2022

Codecov Report

Merging #1381 (2b027db) into main (9e7e7bf) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@           Coverage Diff            @@
##            main   #1381      +/-   ##
========================================
- Coverage   9.92%   9.92%   -0.01%     
========================================
  Files       1117    1117              
  Lines      77975   77987      +12     
  Branches   18118   18118              
========================================
  Hits        7742    7742              
- Misses     62679   62691      +12     
  Partials    7554    7554              
Flag Coverage Δ *Carryforward flag
differential 0.00% <0.00%> (?)
total 9.91% <0.00%> (ø) Carriedforward from 9e7e7bf

*This pull request uses carry forward flags. Click here to find out more.

Impacted Files Coverage Δ
.../obstacle_cruise_planner/src/planner_interface.cpp 0.00% <0.00%> (ø)
planning/obstacle_cruise_planner/src/utils.cpp 0.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9e7e7bf...2b027db. Read the comment docs.

const auto zero_vel_idx = motion_utils::insertStopPoint(0, zero_vel_dist, output_traj.points);
if (zero_vel_idx) {
const auto wall_idx = obstacle_cruise_utils::getIndexWithLongitudinalOffset(
planner_data.traj.points, vehicle_info_.max_longitudinal_offset_m, *zero_vel_idx);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use abs_ego_offset

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

for (size_t o_idx = zero_vel_idx; o_idx < output_traj.points.size(); ++o_idx) {
output_traj.points.at(o_idx).longitudinal_velocity_mps = 0.0;
const double zero_vel_dist =
closest_obstacle_dist - vehicle_info_.max_longitudinal_offset_m - feasible_margin_from_obstacle;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use abs_ego_offset

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 135 to 157
const double zero_vel_dist =
closest_obstacle_dist - vehicle_info_.max_longitudinal_offset_m - feasible_margin_from_obstacle;
const auto zero_vel_idx = motion_utils::insertStopPoint(0, zero_vel_dist, output_traj.points);
if (zero_vel_idx) {
const auto wall_idx = obstacle_cruise_utils::getIndexWithLongitudinalOffset(
planner_data.traj.points, vehicle_info_.max_longitudinal_offset_m, *zero_vel_idx);

// virtual wall marker for stop obstacle
const auto marker_pose = planner_data.traj.points.at(wall_idx).pose;
const auto markers = motion_utils::createStopVirtualWallMarker(
marker_pose, "obstacle stop", planner_data.current_time, 0);
tier4_autoware_utils::appendMarkerArray(markers, &debug_data.stop_wall_marker);
debug_data.obstacles_to_stop.push_back(*closest_stop_obstacle);

// Publish Stop Reason
const auto stop_pose = output_traj.points.at(*zero_vel_idx).pose;
const auto stop_reasons_msg =
makeStopReasonArray(planner_data.current_time, stop_pose, *closest_stop_obstacle);
stop_reasons_pub_->publish(stop_reasons_msg);

// Publish if ego vehicle collides with the obstacle with a limit acceleration
const auto stop_speed_exceeded_msg =
createStopSpeedExceededMsg(planner_data.current_time, will_collide_with_obstacle);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use output_traj.points for wall_idx handling.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Signed-off-by: yutaka <purewater0901@gmail.com>
Signed-off-by: yutaka <purewater0901@gmail.com>
Signed-off-by: yutaka <purewater0901@gmail.com>
Signed-off-by: yutaka <purewater0901@gmail.com>
@purewater0901
Copy link
Contributor Author

@takayuki5168 Please merge this PR after this fix

Copy link
Contributor

@takayuki5168 takayuki5168 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@takayuki5168
Copy link
Contributor

@purewater0901 Resolve the conflicts please.

Signed-off-by: yutaka <purewater0901@gmail.com>
@purewater0901
Copy link
Contributor Author

fixed

@purewater0901 purewater0901 merged commit fb88141 into autowarefoundation:main Jul 21, 2022
@purewater0901 purewater0901 deleted the feat/use-motion-utils branch July 21, 2022 17:26
@purewater0901 purewater0901 restored the feat/use-motion-utils branch September 14, 2022 13:58
@purewater0901 purewater0901 deleted the feat/use-motion-utils branch September 14, 2022 13:59
yukke42 pushed a commit to tzhong518/autoware.universe that referenced this pull request Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants