Macros | Functions
test/common.h File Reference
#include <gtest/gtest.h>
#include <turbomath/turbomath.h>
#include "rosflight.h"
#include "test_board.h"
#include "eigen3/Eigen/Core"
#include "eigen3/Eigen/Geometry"
#include "eigen3/Eigen/Dense"
#include <cstdint>
Include dependency graph for test/common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ASSERT_BASICALLYTHESAME(x, y)   ASSERT_NEAR(x, y, 0.00001)
 
#define ASSERT_CLOSE(x, y)   ASSERT_NEAR(x, y, 0.01)
 
#define ASSERT_INTHESAMEBALLPARK(x, y)   ASSERT_NEAR(x, y, 0.1)
 
#define ASSERT_QUAT_SUPERCLOSE(q, q_eig)
 
#define ASSERT_SUPERCLOSE(x, y)   ASSERT_NEAR(x, y, 0.0001)
 
#define ASSERT_TURBOQUAT_SUPERCLOSE(q, q2)
 
#define EXPECT_BASICALLYTHESAME(x, y)   EXPECT_NEAR(x, y, 0.00001)
 
#define EXPECT_CLOSE(x, y)   EXPECT_NEAR(x, y, 0.01)
 
#define EXPECT_INTHESAMEBALLPARK(x, y)   EXPECT_NEAR(x, y, 0.1)
 
#define EXPECT_QUAT_SUPERCLOSE(q, q_eig)
 
#define EXPECT_SUPERCLOSE(x, y)   EXPECT_NEAR(x, y, 0.0001)
 
#define EXPECT_VEC3_SUPERCLOSE(vec, eig)
 

Functions

double quaternion_error (turbomath::Quaternion q0, turbomath::Quaternion q)
 
double quaternion_error (Eigen::Quaternionf q_eig, turbomath::Quaternion q)
 
void step_firmware (rosflight_firmware::ROSflight &rf, rosflight_firmware::testBoard &board, uint32_t us)
 

Macro Definition Documentation

#define ASSERT_BASICALLYTHESAME (   x,
 
)    ASSERT_NEAR(x, y, 0.00001)

Definition at line 53 of file test/common.h.

#define ASSERT_CLOSE (   x,
 
)    ASSERT_NEAR(x, y, 0.01)

Definition at line 55 of file test/common.h.

#define ASSERT_INTHESAMEBALLPARK (   x,
 
)    ASSERT_NEAR(x, y, 0.1)

Definition at line 56 of file test/common.h.

#define ASSERT_QUAT_SUPERCLOSE (   q,
  q_eig 
)
Value:
{ \
double e1 = quaternion_error((q_eig), (q)); \
Eigen::Quaternionf q_eig_neg = q_eig; \
q_eig_neg.coeffs() *= -1.0; \
double e2 = quaternion_error(q_eig_neg, (q)); \
double error = (e1 < e2) ? e1 : e2; \
EXPECT_LE(error, 0.0001); \
}
static volatile bool error
Definition: drv_i2c.c:92
double quaternion_error(turbomath::Quaternion q0, turbomath::Quaternion q)
Definition: common.cpp:16

Definition at line 26 of file test/common.h.

#define ASSERT_SUPERCLOSE (   x,
 
)    ASSERT_NEAR(x, y, 0.0001)

Definition at line 54 of file test/common.h.

#define ASSERT_TURBOQUAT_SUPERCLOSE (   q,
  q2 
)
Value:
{ \
double e1 = quaternion_error(q, q2); \
turbomath::Quaternion q2_neg = q2; \
q2_neg.w *= -1.0; \
q2_neg.x *= -1.0; \
q2_neg.y *= -1.0; \
q2_neg.z *= -1.0; \
double e2 = quaternion_error(q, q2_neg); \
double error = (e1 < e2) ? e1 : e2; \
ASSERT_LE(error, 0.0001); \
}
static volatile bool error
Definition: drv_i2c.c:92
double quaternion_error(turbomath::Quaternion q0, turbomath::Quaternion q)
Definition: common.cpp:16

Definition at line 35 of file test/common.h.

#define EXPECT_BASICALLYTHESAME (   x,
 
)    EXPECT_NEAR(x, y, 0.00001)

Definition at line 48 of file test/common.h.

#define EXPECT_CLOSE (   x,
 
)    EXPECT_NEAR(x, y, 0.01)

Definition at line 50 of file test/common.h.

#define EXPECT_INTHESAMEBALLPARK (   x,
 
)    EXPECT_NEAR(x, y, 0.1)

Definition at line 51 of file test/common.h.

#define EXPECT_QUAT_SUPERCLOSE (   q,
  q_eig 
)
Value:
{ \
double e1 = quaternion_error((q_eig), (q)); \
Eigen::Quaternionf q_eig_neg = q_eig; \
q_eig_neg.coeffs() *= -1.0; \
double e2 = quaternion_error(q_eig_neg, (q)); \
double error = (e1 < e2) ? e1 : e2; \
EXPECT_LE(error, 0.0001); \
}
static volatile bool error
Definition: drv_i2c.c:92
double quaternion_error(turbomath::Quaternion q0, turbomath::Quaternion q)
Definition: common.cpp:16

Definition at line 18 of file test/common.h.

#define EXPECT_SUPERCLOSE (   x,
 
)    EXPECT_NEAR(x, y, 0.0001)

Definition at line 49 of file test/common.h.

#define EXPECT_VEC3_SUPERCLOSE (   vec,
  eig 
)
Value:
EXPECT_NEAR((vec).x, (eig).x(), 0.0001);\
EXPECT_NEAR((vec).y, (eig).y(), 0.0001);\
EXPECT_NEAR((vec).z, (eig).z(), 0.0001)

Definition at line 14 of file test/common.h.

Function Documentation

double quaternion_error ( turbomath::Quaternion  q0,
turbomath::Quaternion  q 
)

Definition at line 16 of file common.cpp.

double quaternion_error ( Eigen::Quaternionf  q_eig,
turbomath::Quaternion  q 
)

Definition at line 3 of file common.cpp.

void step_firmware ( rosflight_firmware::ROSflight rf,
rosflight_firmware::testBoard board,
uint32_t  us 
)

Definition at line 30 of file common.cpp.



rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Oct 24 2019 03:17:20