@@ -202,9 +202,6 @@ void SideShiftModule::updateData()
202
202
const auto reference_pose = prev_output_.shift_length .empty ()
203
203
? planner_data_->self_odometry ->pose .pose
204
204
: utils::getUnshiftedEgoPose (getEgoPose (), prev_output_);
205
- if (prev_reference_.points .empty ()) {
206
- prev_reference_ = getPreviousModuleOutput ().path ;
207
- }
208
205
if (getPreviousModuleOutput ().reference_path .points .empty ()) {
209
206
return ;
210
207
}
@@ -433,13 +430,14 @@ PathWithLaneId SideShiftModule::extendBackwardLength(const PathWithLaneId & orig
433
430
const auto backward_length = std::max (
434
431
planner_data_->parameters .backward_path_length , longest_dist_to_shift_point + extra_margin);
435
432
433
+ const auto & prev_reference = getPreviousModuleOutput ().path ;
436
434
const size_t orig_ego_idx = findNearestIndex (original_path.points , getEgoPose ().position );
437
- const size_t prev_ego_idx = findNearestSegmentIndex (
438
- prev_reference_ .points , getPoint (original_path.points .at (orig_ego_idx)));
435
+ const size_t prev_ego_idx =
436
+ findNearestSegmentIndex (prev_reference .points , getPoint (original_path.points .at (orig_ego_idx)));
439
437
440
438
size_t clip_idx = 0 ;
441
439
for (size_t i = 0 ; i < prev_ego_idx; ++i) {
442
- if (backward_length > calcSignedArcLength (prev_reference_ .points , clip_idx, prev_ego_idx)) {
440
+ if (backward_length > calcSignedArcLength (prev_reference .points , clip_idx, prev_ego_idx)) {
443
441
break ;
444
442
}
445
443
clip_idx = i;
@@ -448,8 +446,8 @@ PathWithLaneId SideShiftModule::extendBackwardLength(const PathWithLaneId & orig
448
446
PathWithLaneId extended_path{};
449
447
{
450
448
extended_path.points .insert (
451
- extended_path.points .end (), prev_reference_ .points .begin () + clip_idx,
452
- prev_reference_ .points .begin () + prev_ego_idx);
449
+ extended_path.points .end (), prev_reference .points .begin () + clip_idx,
450
+ prev_reference .points .begin () + prev_ego_idx);
453
451
}
454
452
455
453
{
0 commit comments