提交 6f832862 编写于 作者: D Dong Li 提交者: Jiaming Tao

use point distance, instead of lane distance to calculate the Path (#505)

distance

Thanks to @haoyang
上级 a1a05bb6
......@@ -178,13 +178,7 @@ void Path::init_points() {
// TODO(lianglia_apollo):
// use heading.length when all adjacent lanes are guarantee to be
// connected.
LaneSegment lane_segment;
if (find_lane_segment(_path_points[i], _path_points[i + 1],
&lane_segment)) {
s += lane_segment.end_s - lane_segment.start_s;
} else {
s += heading.Length();
}
s += heading.Length();
}
heading.Normalize();
_unit_directions.push_back(heading);
......
......@@ -88,7 +88,8 @@ TEST_F(DpRoadGraphTest, speed_road_graph) {
EXPECT_TRUE(result);
EXPECT_EQ(648, path_data_.discretized_path().num_of_points());
EXPECT_EQ(648, path_data_.frenet_frame_path().number_of_points());
EXPECT_FLOAT_EQ(72.00795, path_data_.frenet_frame_path().points().back().s());
EXPECT_FLOAT_EQ(70.450378,
path_data_.frenet_frame_path().points().back().s());
EXPECT_FLOAT_EQ(0.0, path_data_.frenet_frame_path().points().back().l());
// export_path_data(path_data_, "/tmp/path.txt");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册