mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
AP_Math: tests: define hal where requirerd for custom rotaitons
This commit is contained in:
parent
2b9421c4db
commit
15326a8d90
@ -20,6 +20,8 @@
|
|||||||
#include "math_test.h"
|
#include "math_test.h"
|
||||||
#include <AP_Math/AP_GeodesicGrid.h>
|
#include <AP_Math/AP_GeodesicGrid.h>
|
||||||
|
|
||||||
|
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
|
||||||
|
|
||||||
class TestParam {
|
class TestParam {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
#include "math_test.h"
|
#include "math_test.h"
|
||||||
|
|
||||||
|
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
|
||||||
|
|
||||||
// given we are in the Math library, you're epected to know what
|
// given we are in the Math library, you're epected to know what
|
||||||
// you're doing when directly comparing floats:
|
// you're doing when directly comparing floats:
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
#include <AP_Math/vector2.h>
|
#include <AP_Math/vector2.h>
|
||||||
#include <AP_Math/vector3.h>
|
#include <AP_Math/vector3.h>
|
||||||
|
|
||||||
|
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
|
||||||
|
|
||||||
#define EXPECT_VECTOR2F_EQ(v1, v2) \
|
#define EXPECT_VECTOR2F_EQ(v1, v2) \
|
||||||
do { \
|
do { \
|
||||||
EXPECT_FLOAT_EQ(v1[0], v2[0]); \
|
EXPECT_FLOAT_EQ(v1[0], v2[0]); \
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include <AP_Math/AP_Math.h>
|
#include <AP_Math/AP_Math.h>
|
||||||
|
|
||||||
|
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
|
||||||
|
|
||||||
// Tests that quaternion multiplication obeys Hamilton's quaternion multiplication convention
|
// Tests that quaternion multiplication obeys Hamilton's quaternion multiplication convention
|
||||||
// i*i == j*j == k*k == i*j*k == -1
|
// i*i == j*j == k*k == i*j*k == -1
|
||||||
TEST(QuaternionTest, QuaternionMultiplicationOfBases) {
|
TEST(QuaternionTest, QuaternionMultiplicationOfBases) {
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include <AP_Math/vector2.h>
|
#include <AP_Math/vector2.h>
|
||||||
|
|
||||||
|
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
|
||||||
|
|
||||||
#define EXPECT_VECTOR2F_EQ(v1, v2) \
|
#define EXPECT_VECTOR2F_EQ(v1, v2) \
|
||||||
do { \
|
do { \
|
||||||
EXPECT_FLOAT_EQ(v1[0], v2[0]); \
|
EXPECT_FLOAT_EQ(v1[0], v2[0]); \
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include <AP_Math/AP_Math.h>
|
#include <AP_Math/AP_Math.h>
|
||||||
|
|
||||||
|
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
|
||||||
|
|
||||||
TEST(Vector2Test, Operator)
|
TEST(Vector2Test, Operator)
|
||||||
{
|
{
|
||||||
Vector2f v_float0{1.0f, 1.0f};
|
Vector2f v_float0{1.0f, 1.0f};
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
#define ALLOW_DOUBLE_MATH_FUNCTIONS
|
#define ALLOW_DOUBLE_MATH_FUNCTIONS
|
||||||
#include <AP_Math/AP_Math.h>
|
#include <AP_Math/AP_Math.h>
|
||||||
|
|
||||||
|
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
|
||||||
|
|
||||||
TEST(Vector3Test, Operator)
|
TEST(Vector3Test, Operator)
|
||||||
{
|
{
|
||||||
Vector3f v_float0{1.0f, 1.0f,1.0f};
|
Vector3f v_float0{1.0f, 1.0f,1.0f};
|
||||||
|
Loading…
Reference in New Issue
Block a user