Macros | Functions
test_helpers.h File Reference
#include <gtest/gtest.h>
#include <tf2/LinearMath/Quaternion.h>
Include dependency graph for test_helpers.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ACCEL_ONLY(ax, ay, az, mx, my, mz)   ax, ay, az
 
#define AM_EAST_NORTH_UP   /* Acceleration */ 0.0, 0.0, 9.81, /* Magnetic */ 0.0, 0.0005, -0.0005
 
#define AM_NE_NW_UP_RSD   /* Acceleration */ 0.20, 0.55, 9.779, /* Magnetic */ 8.484e-06, 8.181e-06, -4.3329e-05
 
#define AM_NORTH_EAST_DOWN   /* Acceleration */ 0.0, 0.0, -9.81, /* Magnetic */ 0.0005, 0.0, 0.0005
 
#define AM_NORTH_WEST_UP   /* Acceleration */ 0.0, 0.0, 9.81, /* Magnetic */ 0.0005, 0.0, -0.0005
 
#define AM_SOUTH_EAST_UP   /* Acceleration */ 0.0, 0.0, 9.81, /* Magnetic */ -0.0005, 0.0, -0.0005
 
#define AM_SOUTH_UP_WEST   /* Acceleration */ 0.0, 9.81, 0.0, /* Magnetic */ -0.0005, -0.0005, 0.0
 
#define AM_WEST_NORTH_DOWN   /* Acceleration */ 0.0, 0.0, -9.81, /* Magnetic */ 0.0, 0.0005, 0.0005
 
#define AM_WEST_NORTH_DOWN_RSD   /* Acceleration */ 0.12, 0.29, -9.83, /* Magnetic */ 6.363e-06, 1.0908e-05, 4.2723e-05
 
#define ASSERT_IS_NORMALIZED(...)   ASSERT_IS_NORMALIZED_(__VA_ARGS__)
 
#define ASSERT_IS_NORMALIZED_(q0, q1, q2, q3)   ASSERT_TRUE(is_normalized(q0, q1, q2, q3)) << "q0: " << q0 << ", q1: " << q1 << ", q2: " << q2 << ", q3: " << q3;
 
#define ASSERT_QUAT_EQUAL(...)   ASSERT_QUAT_EQUAL_(__VA_ARGS__)
 
#define ASSERT_QUAT_EQUAL_(q0, q1, q2, q3, qr0, qr1, qr2, qr3)   ASSERT_TRUE(quat_equal(q0, q1, q2, q3, qr0, qr1, qr2, qr3)) << "q0: " << q0 << ", q1: " << q1 << ", q2: " << q2 << ", q3: " << q3;
 
#define ASSERT_QUAT_EQUAL_EX_Z(...)   ASSERT_QUAT_EQUAL_EX_Z_(__VA_ARGS__)
 
#define ASSERT_QUAT_EQUAL_EX_Z_(q0, q1, q2, q3, qr0, qr1, qr2, qr3)   ASSERT_TRUE(quat_eq_ex_z(q0, q1, q2, q3, qr0, qr1, qr2, qr3)) << "q0: " << q0 << ", q1: " << q1 << ", q2: " << q2 << ", q3: " << q3;
 
#define MAX_DIFF   0.05
 
#define QUAT_IDENTITY   1.0, 0.0, 0.0, 0.0
 
#define QUAT_MZ_90   0.707107, 0.0, 0.0, -0.707107
 
#define QUAT_NE_NW_UP_RSD_ENU   0.93, 0.03, 0.0, 0.35 /* Axis: Z, Angle: 41deg */
 
#define QUAT_NE_NW_UP_RSD_NED   0.021, -0.91, -0.41, 0.02 /* Axis: (0.9, 0.4, 0.0), Angle: 180deg */
 
#define QUAT_NE_NW_UP_RSD_NWU   0.91, 0.03, -0.02, -0.41 /* axis: (0.0300376, -0.020025, -0.410513) | angle: 48.6734deg */
 
#define QUAT_WEST_NORTH_DOWN_RSD_ENU   0.0, -0.25, -0.97, -0.02/* Axis: (-0.2, -0.96, 0.02), Angle: 180deg */
 
#define QUAT_WEST_NORTH_DOWN_RSD_NED   0.86, -0.01, 0.01, -0.50 /* Axis: -Z, Angle: 60deg */
 
#define QUAT_WEST_NORTH_DOWN_RSD_NWU   0.01, 0.86, 0.50, 0.012 /* axis: (0.864401, 0.502559, 0.0120614) | angle: 178.848deg */
 
#define QUAT_X_180   0.0, 1.0, 0.0, 0.0
 
#define QUAT_XMYMZ_120   0.5, 0.5, -0.5, -0.5
 

Functions

template<typename T >
static bool is_normalized (T q0, T q1, T q2, T q3)
 
template<typename T >
static void normalize_quaternion (T &q0, T &q1, T &q2, T &q3)
 
template<typename T >
static bool quat_eq_ex_z (T q0, T q1, T q2, T q3, T qr0, T qr1, T qr2, T qr3)
 
template<typename T >
static bool quat_equal (T q0, T q1, T q2, T q3, T qr0, T qr1, T qr2, T qr3)
 

Macro Definition Documentation

#define ACCEL_ONLY (   ax,
  ay,
  az,
  mx,
  my,
  mz 
)    ax, ay, az

Definition at line 86 of file test_helpers.h.

#define AM_EAST_NORTH_UP   /* Acceleration */ 0.0, 0.0, 9.81, /* Magnetic */ 0.0, 0.0005, -0.0005

Definition at line 74 of file test_helpers.h.

#define AM_NE_NW_UP_RSD   /* Acceleration */ 0.20, 0.55, 9.779, /* Magnetic */ 8.484e-06, 8.181e-06, -4.3329e-05

Definition at line 83 of file test_helpers.h.

#define AM_NORTH_EAST_DOWN   /* Acceleration */ 0.0, 0.0, -9.81, /* Magnetic */ 0.0005, 0.0, 0.0005

Definition at line 75 of file test_helpers.h.

#define AM_NORTH_WEST_UP   /* Acceleration */ 0.0, 0.0, 9.81, /* Magnetic */ 0.0005, 0.0, -0.0005

Definition at line 76 of file test_helpers.h.

#define AM_SOUTH_EAST_UP   /* Acceleration */ 0.0, 0.0, 9.81, /* Magnetic */ -0.0005, 0.0, -0.0005

Definition at line 78 of file test_helpers.h.

#define AM_SOUTH_UP_WEST   /* Acceleration */ 0.0, 9.81, 0.0, /* Magnetic */ -0.0005, -0.0005, 0.0

Definition at line 77 of file test_helpers.h.

#define AM_WEST_NORTH_DOWN   /* Acceleration */ 0.0, 0.0, -9.81, /* Magnetic */ 0.0, 0.0005, 0.0005

Definition at line 79 of file test_helpers.h.

#define AM_WEST_NORTH_DOWN_RSD   /* Acceleration */ 0.12, 0.29, -9.83, /* Magnetic */ 6.363e-06, 1.0908e-05, 4.2723e-05

Definition at line 82 of file test_helpers.h.

#define ASSERT_IS_NORMALIZED (   ...)    ASSERT_IS_NORMALIZED_(__VA_ARGS__)

Definition at line 64 of file test_helpers.h.

#define ASSERT_IS_NORMALIZED_ (   q0,
  q1,
  q2,
  q3 
)    ASSERT_TRUE(is_normalized(q0, q1, q2, q3)) << "q0: " << q0 << ", q1: " << q1 << ", q2: " << q2 << ", q3: " << q3;

Definition at line 63 of file test_helpers.h.

#define ASSERT_QUAT_EQUAL (   ...)    ASSERT_QUAT_EQUAL_(__VA_ARGS__)

Definition at line 67 of file test_helpers.h.

#define ASSERT_QUAT_EQUAL_ (   q0,
  q1,
  q2,
  q3,
  qr0,
  qr1,
  qr2,
  qr3 
)    ASSERT_TRUE(quat_equal(q0, q1, q2, q3, qr0, qr1, qr2, qr3)) << "q0: " << q0 << ", q1: " << q1 << ", q2: " << q2 << ", q3: " << q3;

Definition at line 66 of file test_helpers.h.

#define ASSERT_QUAT_EQUAL_EX_Z (   ...)    ASSERT_QUAT_EQUAL_EX_Z_(__VA_ARGS__)

Definition at line 70 of file test_helpers.h.

#define ASSERT_QUAT_EQUAL_EX_Z_ (   q0,
  q1,
  q2,
  q3,
  qr0,
  qr1,
  qr2,
  qr3 
)    ASSERT_TRUE(quat_eq_ex_z(q0, q1, q2, q3, qr0, qr1, qr2, qr3)) << "q0: " << q0 << ", q1: " << q1 << ", q2: " << q2 << ", q3: " << q3;

Definition at line 69 of file test_helpers.h.

#define MAX_DIFF   0.05

Definition at line 8 of file test_helpers.h.

#define QUAT_IDENTITY   1.0, 0.0, 0.0, 0.0

Definition at line 90 of file test_helpers.h.

#define QUAT_MZ_90   0.707107, 0.0, 0.0, -0.707107

Definition at line 91 of file test_helpers.h.

#define QUAT_NE_NW_UP_RSD_ENU   0.93, 0.03, 0.0, 0.35 /* Axis: Z, Angle: 41deg */

Definition at line 98 of file test_helpers.h.

#define QUAT_NE_NW_UP_RSD_NED   0.021, -0.91, -0.41, 0.02 /* Axis: (0.9, 0.4, 0.0), Angle: 180deg */

Definition at line 99 of file test_helpers.h.

#define QUAT_NE_NW_UP_RSD_NWU   0.91, 0.03, -0.02, -0.41 /* axis: (0.0300376, -0.020025, -0.410513) | angle: 48.6734deg */

Definition at line 97 of file test_helpers.h.

#define QUAT_WEST_NORTH_DOWN_RSD_ENU   0.0, -0.25, -0.97, -0.02/* Axis: (-0.2, -0.96, 0.02), Angle: 180deg */

Definition at line 95 of file test_helpers.h.

#define QUAT_WEST_NORTH_DOWN_RSD_NED   0.86, -0.01, 0.01, -0.50 /* Axis: -Z, Angle: 60deg */

Definition at line 96 of file test_helpers.h.

#define QUAT_WEST_NORTH_DOWN_RSD_NWU   0.01, 0.86, 0.50, 0.012 /* axis: (0.864401, 0.502559, 0.0120614) | angle: 178.848deg */

Definition at line 94 of file test_helpers.h.

#define QUAT_X_180   0.0, 1.0, 0.0, 0.0

Definition at line 92 of file test_helpers.h.

#define QUAT_XMYMZ_120   0.5, 0.5, -0.5, -0.5

Definition at line 93 of file test_helpers.h.

Function Documentation

template<typename T >
static bool is_normalized ( q0,
q1,
q2,
q3 
)
inlinestatic

Definition at line 28 of file test_helpers.h.

template<typename T >
static void normalize_quaternion ( T &  q0,
T &  q1,
T &  q2,
T &  q3 
)
inlinestatic

Definition at line 11 of file test_helpers.h.

template<typename T >
static bool quat_eq_ex_z ( q0,
q1,
q2,
q3,
qr0,
qr1,
qr2,
qr3 
)
inlinestatic

Definition at line 44 of file test_helpers.h.

template<typename T >
static bool quat_equal ( q0,
q1,
q2,
q3,
qr0,
qr1,
qr2,
qr3 
)
inlinestatic

Definition at line 33 of file test_helpers.h.



imu_filter_madgwick
Author(s): Ivan Dryanovski
autogenerated on Thu Jun 18 2020 03:40:00