41 #include <visp3/core/vpConfig.h>
43 #ifdef VISP_HAVE_CATCH2
45 #include <visp3/core/vpQuaternionVector.h>
47 #define CATCH_CONFIG_RUNNER
50 TEST_CASE(
"Quaternion interpolation",
"[quaternion]")
62 const double ref_angle_middle = t * (angle0 + angle1);
63 const double margin = 1e-3;
64 const double marginLerp = 1e-1;
72 CHECK(
vpThetaUVector(qLerp).getTheta() == Approx(ref_angle_middle).margin(marginLerp));
78 CHECK(
vpThetaUVector(qNlerp).getTheta() == Approx(ref_angle_middle).margin(margin));
84 CHECK(
vpThetaUVector(qSlerp).getTheta() == Approx(ref_angle_middle).margin(margin));
88 int main(
int argc,
char *argv[])
90 Catch::Session session;
93 session.applyCommandLine(argc, argv);
95 int numFailed = session.run();
105 int main() {
return EXIT_SUCCESS; }
Implementation of column vector and the associated operations.
vpColVector & normalize()
static double rad(double deg)
Implementation of a rotation vector as quaternion angle minimal representation.
static vpQuaternionVector slerp(const vpQuaternionVector &q0, const vpQuaternionVector &q1, double t)
static vpQuaternionVector nlerp(const vpQuaternionVector &q0, const vpQuaternionVector &q1, double t)
static vpQuaternionVector lerp(const vpQuaternionVector &q0, const vpQuaternionVector &q1, double t)
Implementation of a rotation vector as axis-angle minimal representation.