2 #include <gtest/gtest.h>
7 TEST(RotationTests, rotationsOK)
9 KDL::Rotation one_radian_axis_x1 = KDL::Rotation::RPY(1.0, 0.0, 0.0);
12 EXPECT_EQ(one_radian_axis_x1.UnitX(), one_radian_axis_x2.UnitX());
13 EXPECT_EQ(one_radian_axis_x1.UnitY(), one_radian_axis_x2.UnitY());
14 EXPECT_EQ(one_radian_axis_x1.UnitZ(), one_radian_axis_x2.UnitZ());
16 KDL::Rotation neg_radian_axis_x1 = KDL::Rotation::RPY(-1.0, 0.0, 0.0);
19 EXPECT_EQ(neg_radian_axis_x1.UnitX(), neg_radian_axis_x2.UnitX());
20 EXPECT_EQ(neg_radian_axis_x1.UnitY(), neg_radian_axis_x2.UnitY());
21 EXPECT_EQ(neg_radian_axis_x1.UnitZ(), neg_radian_axis_x2.UnitZ());
23 KDL::Rotation one_radian_axis_z1 = KDL::Rotation::RPY(0.0, 0.0, 1.0);
26 EXPECT_EQ(one_radian_axis_z1.UnitX(), one_radian_axis_z2.UnitX());
27 EXPECT_EQ(one_radian_axis_z1.UnitY(), one_radian_axis_z2.UnitY());
28 EXPECT_EQ(one_radian_axis_z1.UnitZ(), one_radian_axis_z2.UnitZ());
32 EXPECT_DOUBLE_EQ(1.0,
x);
33 EXPECT_DOUBLE_EQ(0.0,
y);
34 EXPECT_DOUBLE_EQ(0.0,
z);
37 EXPECT_DOUBLE_EQ(-1.0,
x);
38 EXPECT_DOUBLE_EQ(0.0,
y);
39 EXPECT_DOUBLE_EQ(0.0,
z);
42 EXPECT_DOUBLE_EQ(0.0,
x);
43 EXPECT_DOUBLE_EQ(0.0,
y);
44 EXPECT_DOUBLE_EQ(1.0,
z);
47 int main(
int argc,
char** argv)
49 testing::InitGoogleTest(&argc, argv);
50 return RUN_ALL_TESTS();