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

Change transform mode from AffineCompact to Isometry #318

Conversation

SeanCurtis-TRI
Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI commented Jul 26, 2018

This increases the memory footprint of the Transform class by 33% (ie.,
3x4 to 4x4). However, the X_AB.inverse() method will now implicitly use
the transpose of the linear() component rather than computing an inverse.

Resolves #317


This change is Reviewable

Copy link
Contributor

@amcastro-tri amcastro-tri left a comment

Choose a reason for hiding this comment

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

:lgtm:, pending CI

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Copy link
Contributor Author

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

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

@jslee02 @sherm1 This passes all of CI as we'd expect (still the pernicious box-box test). Shall we pull the trigger ?

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@wxmerkt
Copy link
Contributor

wxmerkt commented Jul 30, 2018

Would it make sense to update the CHANGELOG?

Copy link
Member

@sherm1 sherm1 left a comment

Choose a reason for hiding this comment

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

I vote yes! And I agree with @wxmerkt that a CHANGELOG update would be worthwhile.

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Copy link
Member

@jslee02 jslee02 left a comment

Choose a reason for hiding this comment

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

Looks good to go. Updating the changelog would be great as well.

This increases the memory footprint of the `Transform` class by 33% (ie.,
3x4 to 4x4). However, the X_AB.inverse() method will now implicitly use
the transpose of the linear() component rather than computing an inverse.
Copy link
Contributor Author

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

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

What's up with the change log vs releases/tags?

We've got release tags that don't monotonically increase.
And the changelog implies that all upcoming changes are applied to version 0.6.0. Despite the fact that the 0.5.0 release dated 2016-07-19 has been followed by 0.3.3 on 2016-07-22 and 0.3.4 on 2017-07-21.

The changelog seems to have gotten quite stale. In fact, in adding this change to the changelog, it follows the comment:

Switched to Eigen for math oeprations #96, #150

It seems we need to make sure the changelog gets updated w.r.t. PRs. It also seems that we need to have a flag day to make sure the changelog is meaningful.

Thoughts and opinions, please.

Reviewable status: 1 of 2 files reviewed, all discussions resolved

@jslee02
Copy link
Member

jslee02 commented Aug 2, 2018

We've got release tags that don't monotonically increase.
And the changelog implies that all upcoming changes are applied to version 0.6.0. Despite the fact that the 0.5.0 release dated 2016-07-19 has been followed by 0.3.3 on 2016-07-22 and 0.3.4 on 2017-07-21.

They actually monotonically increases but in different branches. A version number is decided based on which branch the change is merged to. For example, changes merging into (current) master would be for 0.6.0, while changes for fcl-0.5 would be for the next patch release of 0.5 (e.g., 0.5.1 since 0.5.0 is already released).

Sometimes we need to fix a bug for a released version (e.g., 0.3.4) before the next minor or major release (e.g., 0.6.0). Then we might see 0.3.5 release before 0.6.0, which might seem not monotonic increase.

The changelog seems to have gotten quite stale.

Yeah, this is sad.

In fact, in adding this change to the changelog, it follows the comment:

Switched to Eigen for math oeprations #96, #150

I think this change may just fit to the line as:

Switched to Eigen for math operations #96, #150, #318

The section of 0.6.0 is for the diff between 0.6.0 and 0.5.x. Since the transform type of Eigen doesn't exist in 0.5.x so we don't need to add a new line for it I think.

It seems we need to make sure the changelog gets updated w.r.t. PRs. It also seems that we need to have a flag day to make sure the changelog is meaningful.

👍

I found a useful site about changelog. We don't need to exactly follow the suggestions, but I mostly agree with.

@sherm1
Copy link
Member

sherm1 commented Aug 3, 2018

The only CI failure is the usual one. Looks like this just needs a manual merge with master and then is ready to merge?

@jslee02
Copy link
Member

jslee02 commented Aug 3, 2018

I believe the CI failure is fixed by #266. So it should be gone once master is merged.

@SeanCurtis-TRI SeanCurtis-TRI merged commit a278363 into flexible-collision-library:master Aug 4, 2018
@SeanCurtis-TRI SeanCurtis-TRI deleted the PR_transform_as_isometry branch August 4, 2018 03:12
@peci1
Copy link

peci1 commented Nov 11, 2020

I guess many users will get no improvement at all as the automatic optimization hasn't still been released in Eigen - my comment from moveit/geometric_shapes#125 (comment) still holds, it hasn't even got into the recently released Eigen 3.3.8. In Moveit, we took the way of replacing all appropriate .inverse() calls to .linear().

@SeanCurtis-TRI
Copy link
Contributor Author

@peci1 The link provided seems to discuss rotation() vs linear(). In contrast, this is about the cost of inverse() (on the full transform). It's true that the choice was made based on the documented feature and hasn't been confirmed as you did with rotation(). Have you looked at the assembly for what inverse() does on an isometry?

@peci1
Copy link

peci1 commented Nov 12, 2020

Oh, you're right, I got these two mixed up... The code for inverse() actually does examine the transform traits to improve performance for isometries: https://gitlab.com/libeigen/eigen/-/blob/3.3/Eigen/src/Geometry/Transform.h#L1211 . Sorry for the confusion...

@peci1
Copy link

peci1 commented Nov 12, 2020

And the problem with inefficient rotation() should not affect FCL, as

const Matrix3<S> CollisionObject<S>::getRotation() const
{
return t.linear();
}

uses the always efficient linear() method.

@SeanCurtis-TRI
Copy link
Contributor Author

@peci1 No apologies required. Those kinds of things can fall through the cracks all the time. Worst case scenario, it doesn't directly apply, but it's still relevant and interesting (as in this case). More typically, users keeping an eye out for things will catch unintentionally bad code. So, I appreciate you weighing in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inverting Transform<S> without extra work
6 participants