-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add unit tests for environmentxyztheta * Add boost::filesystem library (must be after ugv_nav4d) * Add unit tests * Cleanup headers * Use set locale to C for grid resolution parameter from cli for gui * Throw error if translation or angular velocity is 0.0 * Add unit tests for computed motions * Update readme for unit tests * Test costs calculation for only one motion * Check if final pose of full and sampled splines * Check validity of underlying values in generated trajectories * Use the ugv_nav4d target for tests * Use rock executable macro for tests * Add filesystem dependency to all ugv_nav4d dependent tests --------- Co-authored-by: Mulo01 <[email protected]> Co-authored-by: Christoph Hertzberg <[email protected]>
- Loading branch information
1 parent
03ac049
commit 8af2e4c
Showing
9 changed files
with
709 additions
and
395 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
find_package(Boost REQUIRED COMPONENTS filesystem) | ||
find_package(Boost REQUIRED COMPONENTS filesystem serialization) | ||
|
||
|
||
rock_executable(test_ugv_nav4d | ||
SOURCES test_ugv_nav4d.cpp | ||
rock_executable(test_Planner | ||
SOURCES test_Planner.cpp | ||
DEPS Boost::filesystem | ||
DEPS_PKGCONFIG ugv_nav4d | ||
) | ||
|
||
rock_executable(test_EnvironmentXYZTheta | ||
SOURCES test_EnvironmentXYZTheta.cpp | ||
DEPS Boost::filesystem | ||
DEPS Boost::filesystem Boost::serialization | ||
DEPS_PKGCONFIG ugv_nav4d | ||
) | ||
|
||
rock_executable(test_DiscreteTheta | ||
SOURCES test_DiscreteTheta.cpp | ||
DEPS_PKGCONFIG ugv_nav4d | ||
) | ||
|
||
rock_executable(test_PreComputedMotions | ||
SOURCES test_PreComputedMotions.cpp | ||
DEPS Boost::filesystem | ||
DEPS_PKGCONFIG ugv_nav4d | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#define BOOST_TEST_MODULE DiscreteThetaModule | ||
#include <boost/test/included/unit_test.hpp> | ||
|
||
#include "ugv_nav4d/DiscreteTheta.hpp" | ||
|
||
BOOST_AUTO_TEST_CASE(check_discrete_theta_init) { | ||
DiscreteTheta theta = DiscreteTheta(0, 16); | ||
BOOST_CHECK_CLOSE_FRACTION(theta.getRadian(), 0, 0.01); | ||
|
||
theta = DiscreteTheta(1, 16); | ||
BOOST_CHECK_EQUAL(theta.getNumAngles(), 16); | ||
BOOST_CHECK_CLOSE_FRACTION(theta.getRadian(), 0.3926, 0.01); | ||
|
||
theta = DiscreteTheta(-1, 16); | ||
BOOST_CHECK_EQUAL(theta.getTheta(), 15); | ||
BOOST_CHECK_CLOSE_FRACTION(theta.getRadian(), 5.8904, 0.01); | ||
|
||
theta = DiscreteTheta(18, 16); | ||
BOOST_CHECK_EQUAL(theta.getTheta(), 2); | ||
|
||
theta = DiscreteTheta(16, 16); | ||
BOOST_CHECK_EQUAL(theta.getTheta(), 0); | ||
|
||
theta = DiscreteTheta(5.90, 16); | ||
BOOST_CHECK_EQUAL(theta.getTheta(), 15); | ||
|
||
theta = DiscreteTheta(5.45, 16); | ||
BOOST_CHECK_CLOSE_FRACTION(theta.getRadian(), 5.45, 0.01); | ||
BOOST_CHECK_EQUAL(theta.getTheta(), 14); | ||
|
||
DiscreteTheta thetaA = DiscreteTheta(3, 16); | ||
DiscreteTheta thetaB = DiscreteTheta(5, 16); | ||
BOOST_CHECK_EQUAL(thetaA.shortestDist(thetaB).getTheta(), 2); | ||
|
||
thetaA = DiscreteTheta(2, 16); | ||
thetaB = DiscreteTheta(14, 16); | ||
BOOST_CHECK_EQUAL(thetaA.shortestDist(thetaB).getTheta(), 4); | ||
} |
Oops, something went wrong.