提交 af35f555 编写于 作者: D Dong Li 提交者: Liangliang Zhang

planning: fix reference line smoother by adding start point constraint

上级 cde205de
......@@ -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, 30,
look_backward_distance, 10,
"look backward this distance when creating reference line from routing");
DEFINE_double(
......
......@@ -152,14 +152,12 @@ bool ReferenceLineSmoother::Sampling(const ReferenceLine& raw_reference_line) {
bool ReferenceLineSmoother::ApplyConstraint(
const ReferenceLine& raw_reference_line) {
const double t_length = t_knots_.back() - t_knots_.front();
uint32_t constraint_num =
std::max(static_cast<uint32_t>(raw_reference_line.Length() /
smoother_config_.max_constraint_length()),
3u);
double dt = t_length / constraint_num;
std::vector<double> evaluated_t;
common::util::uniform_slice(0.0 + dt, t_length, constraint_num - 1,
common::util::uniform_slice(t_knots_.front(), t_knots_.back(), constraint_num,
&evaluated_t);
std::vector<common::PathPoint> path_points;
if (!ExtractEvaluatedPoints(raw_reference_line, evaluated_t, &path_points)) {
......
......@@ -71,7 +71,7 @@ TEST_F(ReferenceLineSmootherTest, smooth) {
ReferenceLine smoothed_reference_line;
EXPECT_FLOAT_EQ(153.87421, reference_line_->Length());
EXPECT_TRUE(smoother_.Smooth(*reference_line_, &smoothed_reference_line));
EXPECT_FLOAT_EQ(154.66971, smoothed_reference_line.Length());
EXPECT_FLOAT_EQ(153.21724, smoothed_reference_line.Length());
}
} // namespace planning
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册