Skip to content

Commit

Permalink
fix same point
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Takagi <[email protected]>
  • Loading branch information
yuki-takagi-66 committed Sep 4, 2024
1 parent 649aeca commit df83730
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ PidLongitudinalController::ControlData PidLongitudinalController::getControlData
control_data.interpolated_traj.points.insert(
control_data.interpolated_traj.points.begin() + current_interpolated_pose.second + 1,
current_interpolated_pose.first);

control_data.nearest_idx = current_interpolated_pose.second + 1;
control_data.target_idx = control_data.nearest_idx;
const auto nearest_point = current_interpolated_pose.first;
Expand Down Expand Up @@ -507,6 +508,8 @@ PidLongitudinalController::ControlData PidLongitudinalController::getControlData
// calculate the target motion for delay compensation
constexpr double min_running_dist = 0.01;
if (control_data.state_after_delay.running_distance > min_running_dist) {
control_data.interpolated_traj.points =
autoware::motion_utils::removeOverlapPoints(control_data.interpolated_traj.points);
const auto target_pose = longitudinal_utils::findTrajectoryPoseAfterDistance(
control_data.nearest_idx, control_data.state_after_delay.running_distance,
control_data.interpolated_traj);
Expand Down

0 comments on commit df83730

Please sign in to comment.