20 #define BOOST_TEST_STATIC_LINK 22 #include <boost/test/included/unit_test.hpp> 38 ROS_INFO(
"Running Test for S2C and C2S");
41 double tolerance = 2E-7;
44 int thetaDivisor = 32;
45 double thetaStepSize = M_PI / (double) thetaDivisor;
47 double phiStepSize = M_2_PI / (double) phiDivisor;
48 for (
int thetaFac = 0; thetaFac < thetaDivisor; thetaFac++) {
49 double theta = - M_PI_2 + thetaFac * thetaStepSize;
50 for (
int phiFac = 0; phiFac < phiDivisor; phiFac++) {
51 double phi = - M_PI + phiFac * phiStepSize;
62 double cerror = (ccoords - reccoords).lpNorm<2>();
64 BOOST_CHECK_MESSAGE(cerror < tolerance,
"error has to be minimal.");
75 test_suite* evaluation = BOOST_TEST_SUITE(
"Evaluation NBV");
81 framework::master_test_suite().add(evaluation);
SimpleVector3 SimpleSphereCoordinates
Eigen::Matrix< Precision, 3, 1 > SimpleVector3
test_suite * init_unit_test_suite(int argc, char *argv[])
this namespace contains all generally usable classes.
static SimpleSphereCoordinates convertC2S(const SimpleVector3 &cartesian)
converts cartesian coordinates to sphere coordinates
void evaluateS2CandC2S()
evaluates the correctness of the Sphere To Cartesian and Cartesian To Sphere Methods.
static SimpleVector3 convertS2C(const SimpleSphereCoordinates &sphere)
converts sphere coordinates to cartesian coordinates (lightweight)