mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-28 11:50:35 +08:00
Removed all uses of C library from tests
This commit is contained in:
committed by
James Goppert
parent
9ebf5f89db
commit
e09cf12e2e
@@ -1,14 +1,12 @@
|
||||
#include "test_macros.hpp"
|
||||
#include <matrix/integration.hpp>
|
||||
|
||||
using matrix::Matrix;
|
||||
using matrix::ones;
|
||||
using matrix::Vector;
|
||||
using namespace matrix;
|
||||
|
||||
Vector<float, 6> f(float t, const Matrix<float, 6, 1> & /*y*/, const Matrix<float, 3, 1> & /*u*/);
|
||||
|
||||
Vector<float, 6> f(float t, const Matrix<float, 6, 1> & /*y*/, const Matrix<float, 3, 1> & /*u*/) {
|
||||
float v = -sinf(t);
|
||||
float v = -sin(t);
|
||||
return v*ones<float, 6, 1>();
|
||||
}
|
||||
|
||||
@@ -20,7 +18,7 @@ int main()
|
||||
float tf = 2;
|
||||
float h = 0.001f;
|
||||
integrate_rk4(f, y, u, t0, tf, h, y);
|
||||
float v = 1 + cosf(tf) - cosf(t0);
|
||||
float v = 1 + cos(tf) - cos(t0);
|
||||
TEST(isEqual(y, (ones<float, 6, 1>()*v)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user