Skip to content

Commit

Permalink
Planning: set minimum spline number to 1, and added check before addi…
Browse files Browse the repository at this point in the history
…ng third derivative constraints in qp path optimizer. (ApolloAuto#630)
  • Loading branch information
lianglia-apollo authored and startcode committed Oct 10, 2017
1 parent 5d70d69 commit 6bb58c9
Show file tree
Hide file tree
Showing 15 changed files with 9,752 additions and 9,659 deletions.
2 changes: 1 addition & 1 deletion modules/planning/common/planning_gflags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ DEFINE_bool(publish_estop, false, "publish estop decision in planning");
DEFINE_bool(enable_trajectory_stitcher, true, "enable stitching trajectory");

DEFINE_double(
look_backward_distance, 10,
look_backward_distance, 30,
"look backward this distance when creating reference line from routing");

DEFINE_double(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ bool QpSplinePathGenerator::InitSpline(const double start_s,
const double end_s) {
uint32_t number_of_spline = static_cast<uint32_t>(
(end_s - start_s) / qp_spline_path_config_.max_spline_length());
number_of_spline = std::max(2u, number_of_spline);
number_of_spline = std::max(1u, number_of_spline);
common::util::uniform_slice(start_s, end_s, number_of_spline, &knots_);
// spawn a new spline generator
spline_generator_.reset(
Expand Down Expand Up @@ -298,7 +298,8 @@ bool QpSplinePathGenerator::AddConstraint(
}

// add spline joint third derivative constraint
if (!spline_constraint->AddThirdDerivativeSmoothConstraint()) {
if (knots_.size() >= 2 &&
!spline_constraint->AddThirdDerivativeSmoothConstraint()) {
AERROR << "Add spline joint third derivative constraint failed!";
return false;
}
Expand Down
Loading

0 comments on commit 6bb58c9

Please sign in to comment.