提交 3d021c75 编写于 作者: Z Zhang Liangliang 提交者: Dong Li

Planning: unified lookforward length.

上级 101f93e8
......@@ -39,7 +39,7 @@ DEFINE_double(
"look backward this distance when creating reference line from routing");
DEFINE_double(
look_forward_distance, 100,
look_forward_distance, 200,
"look forward this distance when creating reference line from routing");
DEFINE_bool(enable_smooth_reference_line, true,
"enable smooth the map reference line");
......
......@@ -126,10 +126,10 @@ em_planner_config {
}
reference_line_smoother_config {
spline_order: 5
spline_order: 6
max_spline_length: 25.0
boundary_bound: 0.2
derivative_bound: 0.15
boundary_bound: 0.15
derivative_bound: 1.0
second_derivative_bound: 1.0
third_derivative_bound: 1.0
ref_line_weight: 0.0
......
......@@ -120,13 +120,11 @@ bool ReferenceLineProvider::CreateReferenceLineFromRouting(
std::vector<hdmap::RouteSegments> route_segments;
// additional smooth reference line length, unit: meter
const double kForwardAdditionalLength = 100;
{
std::lock_guard<std::mutex> lock(pnc_map_mutex_);
if (!pnc_map_->GetRouteSegments(
position, FLAGS_look_backward_distance,
FLAGS_look_forward_distance + kForwardAdditionalLength,
&route_segments)) {
if (!pnc_map_->GetRouteSegments(position, FLAGS_look_backward_distance,
FLAGS_look_forward_distance,
&route_segments)) {
AERROR << "Failed to extract segments from routing";
return false;
}
......
......@@ -134,7 +134,7 @@ bool ReferenceLineSmoother::Sampling(const ReferenceLine& raw_reference_line) {
const double length = raw_reference_line.Length();
ADEBUG << "Length = " << length;
uint32_t num_spline = std::max(
2u, static_cast<uint32_t>(length / smoother_config_.max_spline_length()));
1u, static_cast<uint32_t>(length / smoother_config_.max_spline_length()));
const double delta_s = length / num_spline;
double s = 0.0;
for (std::uint32_t i = 0; i <= num_spline; ++i, s += delta_s) {
......@@ -152,7 +152,7 @@ bool ReferenceLineSmoother::Sampling(const ReferenceLine& raw_reference_line) {
bool ReferenceLineSmoother::ApplyConstraint(
const ReferenceLine& raw_reference_line) {
uint32_t constraint_num = 3 * (t_knots_.size() - 1) + 1;
uint32_t constraint_num = 5 * (t_knots_.size() - 1) + 1;
std::vector<double> evaluated_t;
common::util::uniform_slice(t_knots_.front(), t_knots_.back(),
......@@ -169,10 +169,8 @@ bool ReferenceLineSmoother::ApplyConstraint(
std::vector<double> lateral_bound;
std::vector<common::math::Vec2d> xy_points;
for (std::uint32_t i = 0; i < path_points.size(); ++i) {
const double kBoundCoeff = 0.5;
headings.push_back(path_points[i].theta());
longitidinal_bound.push_back(kBoundCoeff *
smoother_config_.boundary_bound());
longitidinal_bound.push_back(smoother_config_.boundary_bound());
lateral_bound.push_back(smoother_config_.boundary_bound());
xy_points.emplace_back(path_points[i].x(), path_points[i].y());
}
......
......@@ -74,7 +74,7 @@ TEST_F(ReferenceLineSmootherTest, smooth) {
Spline2dSolver spline_solver(t_knots, 5);
EXPECT_TRUE(smoother_.Smooth(*reference_line_, &smoothed_reference_line,
&spline_solver));
EXPECT_FLOAT_EQ(153.30553, smoothed_reference_line.Length());
EXPECT_FLOAT_EQ(153.19209, smoothed_reference_line.Length());
}
} // namespace planning
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册