mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-23 15:27:35 +08:00
helper_functions add wrap_2pi
This commit is contained in:
committed by
Lorenz Meier
parent
abc8f82d49
commit
03a3e3ad46
@@ -8,8 +8,16 @@ int main()
|
||||
TEST(fabs(wrap_pi(4.0) - (4.0 - 2*M_PI)) < 1e-5);
|
||||
TEST(fabs(wrap_pi(-4.0) - (-4.0 + 2*M_PI)) < 1e-5);
|
||||
TEST(fabs(wrap_pi(3.0) - (3.0)) < 1e-3);
|
||||
TEST(!is_finite(wrap_pi(1000.0f)));
|
||||
TEST(!is_finite(wrap_pi(-1000.0f)));
|
||||
wrap_pi(NAN);
|
||||
|
||||
TEST(fabs(wrap_2pi(-4.0) - (-4.0 + 2*M_PI)) < 1e-5);
|
||||
TEST(fabs(wrap_2pi(3.0) - (3.0)) < 1e-3);
|
||||
TEST(!is_finite(wrap_2pi(1000.0f)));
|
||||
TEST(!is_finite(wrap_2pi(-1000.0f)));
|
||||
wrap_2pi(NAN);
|
||||
|
||||
Vector3f a(1, 2, 3);
|
||||
Vector3f b(4, 5, 6);
|
||||
a.T().print();
|
||||
|
||||
Reference in New Issue
Block a user