Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restoring tf2_eigen Tests #670

Open
wants to merge 2 commits into
base: rolling
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 20 additions & 22 deletions tf2_eigen/test/tf2_eigen-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,17 @@ TEST(TfEigen, ConvertVector3dStamped)
EXPECT_EQ(v, v1);
}

// TODO(clalancette) Re-enable these tests once we have tf2/convert.h:convert(A, B) implemented
// TEST(TfEigen, ConvertVector3d)
// {
// const Eigen::Vector3d v(1,2,3);
TEST(TfEigen, ConvertVector3d)
{
const Eigen::Vector3d v(1, 2, 3);

// Eigen::Vector3d v1;
// geometry_msgs::msg::Point p1;
// tf2::convert(v, p1);
// tf2::convert(p1, v1);
Eigen::Vector3d v1;
geometry_msgs::msg::Point p1;
tf2::convert(v, p1);
tf2::convert(p1, v1);

// EXPECT_EQ(v, v1);
// }
EXPECT_EQ(v, v1);
}

TEST(TfEigen, ConvertAffine3dStamped)
{
Expand All @@ -111,20 +110,19 @@ TEST(TfEigen, ConvertAffine3dStamped)
EXPECT_EQ(v.stamp_, v1.stamp_);
}

// TODO(clalancette) Re-enable these tests once we have tf2/convert.h:convert(A, B) implemented
// TEST(TfEigen, ConvertAffine3d)
// {
// const Eigen::Affine3d v(
// Eigen::Translation3d(1,2,3) * Eigen::AngleAxis<double>(1, Eigen::Vector3d::UnitX()));
TEST(TfEigen, ConvertAffine3d)
{
const Eigen::Affine3d v(
Eigen::Translation3d(1, 2, 3) * Eigen::AngleAxis<double>(1, Eigen::Vector3d::UnitX()));

// Eigen::Affine3d v1;
// geometry_msgs::msg::Pose p1;
// tf2::convert(v, p1);
// tf2::convert(p1, v1);
Eigen::Affine3d v1;
geometry_msgs::msg::Pose p1;
tf2::convert(v, p1);
tf2::convert(p1, v1);

// EXPECT_EQ(v.translation(), v1.translation());
// EXPECT_EQ(v.rotation(), v1.rotation());
// }
EXPECT_EQ(v.translation(), v1.translation());
EXPECT_EQ(v.rotation(), v1.rotation());
}

TEST(TfEigen, ConvertTransform)
{
Expand Down