Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
smoothing_tests.cpp
Go to the documentation of this file.
2
7TEST(PathSmoothing, path_smooth1) {
8 std::string file_path = "src/planning/tracks/path_smooth1.txt";
9 PathSmoothing path_smoothing;
10 Pose car_pose = {0, 0, 0};
11 std::vector<common_lib::structures::PathPoint> input_path = ::path_from_file(file_path);
12 std::vector<common_lib::structures::PathPoint> smoothed_path =
13 path_smoothing.smooth_path(input_path,false);
14 EXPECT_EQ((int)smoothed_path.size(), 110);
15}
21TEST(PathSmoothing, path_smooth2) {
22 std::string file_path = "src/planning/tracks/path_smooth2.txt";
23 PathSmoothing path_smoothing;
24 Pose car_pose = {0, 0, 0};
25 std::vector<common_lib::structures::PathPoint> input_path = ::path_from_file(file_path);
26 std::vector<common_lib::structures::PathPoint> smoothed_path =
27 path_smoothing.smooth_path(input_path,false);
28 EXPECT_EQ((int)smoothed_path.size(), 380);
29}
class that defines the path smoothing algorithm
Definition smoothing.hpp:22
std::vector< PathPoint > smooth_path(const std::vector< PathPoint > &path, bool is_path_closed) const
Smooths a path by fitting a B-spline through the input points.
Definition smoothing.cpp:3
std::vector< common_lib::structures::PathPoint > path_from_file(const std::string &path)
Retrieves a path point vector from a file.
Definition utils.cpp:76
TEST(PathSmoothing, path_smooth1)
simple scenario with few points in the path
Definition types.hpp:66