35 #include <gtest/gtest.h> 44 const float error_x = fabs(result.
getOrigin().x() - truth.getOrigin().x());
45 const float error_y = fabs(result.
getOrigin().y() - truth.getOrigin().y());
46 const float error_z = fabs(result.
getOrigin().z() - truth.getOrigin().z());
48 ASSERT_LT(error_x, 0.001);
49 ASSERT_LT(error_y, 0.001);
50 ASSERT_LT(error_z, 0.001);
51 ASSERT_LT(fabs(error_q.getAngle()), 0.001);
54 TEST(TfProjection, ProjectionTransform)
59 tf2::Vector3(1.0, 3.0, 10.0)),
65 tf2::Vector3(1.0, 0.0, 0.5)),
72 tf2::Vector3(-2.0, 1.0, 0.5)),
79 tf2::Vector3(1.0, 1.0, 100.0)),
85 tf2::Vector3(0.0, -sqrtf(3.0) / 2.0, 3.0 / 2.0)),
91 tf2::Vector3(1.0, 0.0, 2.0)),
96 int main(
int argc,
char** argv)
98 ::testing::InitGoogleTest(&argc, argv);
100 return RUN_ALL_TESTS();
void testTransform(const tf2::Stamped< tf2::Transform > proj2base, const tf2::Stamped< tf2::Transform > targ2proj, const tf2::Stamped< tf2::Transform > truth)
tf2::Transform projectTranslation(const tf2::Transform &trans, const tf2::Transform &trans_target)
TEST(TfProjection, ProjectionTransform)
int main(int argc, char **argv)