From 90d1afb26f1f4991ac2e6522dccaf1e70dc6da4f Mon Sep 17 00:00:00 2001 From: Mirko Waechter <mirko.waechter@kit.edu> Date: Sun, 21 Oct 2018 15:17:52 +0200 Subject: [PATCH] fixed cspace test --- MotionPlanning/tests/SabaCSpaceTest.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MotionPlanning/tests/SabaCSpaceTest.cpp b/MotionPlanning/tests/SabaCSpaceTest.cpp index 2769a157c..2fa0d04c6 100644 --- a/MotionPlanning/tests/SabaCSpaceTest.cpp +++ b/MotionPlanning/tests/SabaCSpaceTest.cpp @@ -30,7 +30,7 @@ BOOST_AUTO_TEST_CASE(testCSpace) "<Robot Type='MyDemoRobotType' StandardName='ExampleRobo' RootNode='Joint1'>" " <RobotNode name='Joint1'>" " <Joint type='revolute'>" - " <Limits unit='degree' lo='-180' hi='180'/>" + " <Limits unit='degree' lo='-180' hi='180' limitless='true'/>" " <Axis x='1' y='0' z='0'/>" " </Joint>" " </RobotNode>" @@ -84,7 +84,7 @@ BOOST_AUTO_TEST_CASE(testCSpace) p1(0) = 0; p2(0) = 0.5f; d = cspace->interpolate(p1, p2, 0, 0); - BOOST_CHECK_CLOSE(d, 0.0f, 0.01f); + BOOST_CHECK_LT(std::abs(d), 0.01f); d = cspace->interpolate(p1, p2, 0, 1); BOOST_CHECK_CLOSE(d, 0.5f, 0.01f); d = cspace->interpolate(p1, p2, 0, 0.5f); @@ -93,7 +93,7 @@ BOOST_AUTO_TEST_CASE(testCSpace) p1(0) = 0; p2(0) = -0.5f; d = cspace->interpolate(p1, p2, 0, 0); - BOOST_CHECK_CLOSE(d, 0.0f, 0.01f); + BOOST_CHECK_LT(std::abs(d), 0.01f); d = cspace->interpolate(p1, p2, 0, 1); BOOST_CHECK_CLOSE(d, -0.5f, 0.01f); d = cspace->interpolate(p1, p2, 0, 0.5f); @@ -106,7 +106,7 @@ BOOST_AUTO_TEST_CASE(testCSpace) d = cspace->interpolate(p1, p2, 0, 1); BOOST_CHECK_CLOSE(d, -0.5f, 0.01f); d = cspace->interpolate(p1, p2, 0, 0.5f); - BOOST_CHECK_CLOSE(d, 0.0f, 0.01f); + BOOST_CHECK_LT(std::abs(d), 0.01f); p1(0) = -0.5; p2(0) = 0.5f; @@ -115,7 +115,7 @@ BOOST_AUTO_TEST_CASE(testCSpace) d = cspace->interpolate(p1, p2, 0, 1); BOOST_CHECK_CLOSE(d, 0.5f, 0.01f); d = cspace->interpolate(p1, p2, 0, 0.5f); - BOOST_CHECK_CLOSE(d, 0.0f, 0.01f); + BOOST_CHECK_LT(std::abs(d), 0.01f); // traverse border p1(0) = -0.75f * (float)M_PI; -- GitLab