39 #include <gtest/gtest.h> 48 const double error_x = std::abs(result.
getOrigin().x() - truth.getOrigin().x());
49 const double error_y = std::abs(result.
getOrigin().y() - truth.getOrigin().y());
50 const double error_z = std::abs(result.
getOrigin().z() - truth.getOrigin().z());
52 ASSERT_LT(error_x, 0.001);
53 ASSERT_LT(error_y, 0.001);
54 ASSERT_LT(error_z, 0.001);
55 ASSERT_LT(std::abs(error_q.getAngle()), 0.001);
58 TEST(TfProjection, ProjectionTransform)
63 tf2::Vector3(1.0, 3.0, 10.0)),
69 tf2::Vector3(1.0, 0.0, 0.5)),
76 tf2::Vector3(-2.0, 1.0, 0.5)),
83 tf2::Vector3(1.0, 1.0, 100.0)),
89 tf2::Vector3(0.0, -std::sqrt(3.0) / 2.0, 3.0 / 2.0)),
95 tf2::Vector3(1.0, 0.0, 2.0)),
100 int main(
int argc,
char** argv)
102 ::testing::InitGoogleTest(&argc, argv);
104 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)