Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

conversions for Eigen::Isometry3d#335

Merged
tfoote merged 4 commits intoros:melodic-develfrom
rhaschke:eigen-isometry
Oct 19, 2018
Merged

conversions for Eigen::Isometry3d#335
tfoote merged 4 commits intoros:melodic-develfrom
rhaschke:eigen-isometry

Conversation

@rhaschke
Copy link
Contributor

In the vein of ros/geometry#113, I added converters for Eigen::Isometry3d also to tf2_eigen. Eigen::Affine3d cannot exploit the SE(3) structure of transforms and thus needs to

  • perform an SVD to compute rotation()
  • perform real matrix inversion for inverse()

Hence, Affine3d should be actually avoided.

t.transform.translation.y = T.translation().y();
t.transform.translation.z = T.translation().z();

Eigen::Quaterniond q(T.rotation());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Affine3d::rotation() performs a costly SVD.

msg.orientation.y = Eigen::Quaterniond(in.rotation()).y();
msg.orientation.z = Eigen::Quaterniond(in.rotation()).z();
msg.orientation.w = Eigen::Quaterniond(in.rotation()).w();
Eigen::Quaterniond q(in.linear());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compute the quaternion only once!

msg.orientation.y = q.y();
msg.orientation.z = q.z();
msg.orientation.w = q.w();
if (msg.orientation.w < 0) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constrain quaternions to the half-space w >= 0 as in tf1.

Copy link
Member

@tfoote tfoote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this support.

@tfoote tfoote merged commit f46e072 into ros:melodic-devel Oct 19, 2018
@rhaschke rhaschke deleted the eigen-isometry branch October 24, 2018 07:16
@rhaschke
Copy link
Contributor Author

@tfoote Do you plan a new release of geometry2 any time soon?
This is a blocker for moveit/moveit#1096.
Thanks.

@tfoote
Copy link
Member

tfoote commented Oct 24, 2018

Yes, I've just cleared the backlog of PRs and plan to release after the next indigo/kinetic sync

@davetcoleman
Copy link

This change needs to be ported to the ros2 version of geometry2 for moveit's conversion: https://github.com/ros2/geometry2

@davetcoleman
Copy link

Ideally the whole geometry2 would be synced to the ros2 version

seanyen pushed a commit to ms-iot/geometry2 that referenced this pull request Mar 22, 2021
As of C++11, the size() method of a std::list is guaranteed
to have constant cost, so we don't need to track the message
count ourselves.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants