Skip to content

Commit

Permalink
Fix spline initial guess test
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul committed Jan 3, 2025
1 parent 81eec8a commit 6929c24
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion trajoptlib/test/src/SwervePathBuilderTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <vector>

#include <catch2/catch_approx.hpp>
#include <catch2/catch_test_macros.hpp>
#include <trajopt/SwerveTrajectoryGenerator.hpp>

Expand Down Expand Up @@ -43,5 +44,8 @@ TEST_CASE("SwervePathBuilder - Spline initial guess", "[SwervePathBuilder]") {
std::vector<double> result = path.CalculateSplineInitialGuess().x;
std::vector<double> expected = {0.0, 1.0, 2.0, 1.0, 3.0, 5.0};

CHECK(result == expected);
REQUIRE(result.size() == expected.size());
for (size_t i = 0; i < expected.size(); ++i) {
CHECK(result[i] == Catch::Approx(expected[i]).margin(1e-15));
}
}

0 comments on commit 6929c24

Please sign in to comment.