Skip to content

Commit

Permalink
Planning: disable reanchoring in iterative smoother
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonZhou404 authored and jinghaomiao committed Jun 24, 2019
1 parent 71c3e1b commit 35cea78
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
2 changes: 2 additions & 0 deletions modules/common/data/global_flagfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
--use_navigation_mode=false

--map_dir=/apollo/modules/map/data/sunnyvale_with_two_offices

--map_dir=/apollo/modules/map/data/san_mateo
2 changes: 1 addition & 1 deletion modules/planning/conf/planning.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@

--open_space_planning_period=1000.0

--noenable_scenario_pull_over
--enable_scenario_pull_over
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,13 @@ bool IterativeAnchoringSmoother::Smooth(

// Check initial path collision avoidance, if it fails, smoother assumption
// fails. Try reanchoring
std::vector<size_t> colliding_point_index;
if (!CheckCollisionAvoidance(interpolated_warm_start_path,
&colliding_point_index)) {
&input_colliding_point_index_)) {
AERROR << "Interpolated input path points colliding with obstacle";
if (!ReAnchoring(colliding_point_index, &interpolated_warm_start_path)) {
AERROR << "Fail to reanchor colliding input path points";
return false;
}
// if (!ReAnchoring(colliding_point_index, &interpolated_warm_start_path)) {
// AERROR << "Fail to reanchor colliding input path points";
// return false;
// }
}

const auto path_smooth_start_timestamp = std::chrono::system_clock::now();
Expand Down Expand Up @@ -491,6 +490,18 @@ bool IterativeAnchoringSmoother::CheckCollisionAvoidance(
colliding_point_index->clear();
size_t path_points_size = path_points.size();
for (size_t i = 0; i < path_points_size; ++i) {
// Skip checking collision for thoese points colliding originally
bool skip_checking = false;
for (const auto index : input_colliding_point_index_) {
if (i == index) {
skip_checking = true;
break;
}
}
if (skip_checking) {
continue;
}

const double heading = gear_
? path_points[i].theta()
: NormalizeAngle(path_points[i].theta() + M_PI);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ class IterativeAnchoringSmoother {
std::vector<std::vector<common::math::LineSegment2d>>
obstacles_linesegments_vec_;

std::vector<size_t> input_colliding_point_index_;

// gear DRIVE as true and gear REVERSE as false
bool gear_ = false;
};
Expand Down

0 comments on commit 35cea78

Please sign in to comment.