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

Add a common function called transformPointWithNormal #908

Merged
merged 1 commit into from
Oct 1, 2014

Conversation

Tonsty
Copy link
Contributor

@Tonsty Tonsty commented Sep 13, 2014

This is a simple but common function and has passed the unit test.


ret.normal_x = static_cast<float> (transform (0, 0) * point.normal_x + transform (0, 1) * point.normal_y + transform (0, 2) * point.normal_z);
ret.normal_y = static_cast<float> (transform (1, 0) * point.normal_x + transform (1, 1) * point.normal_y + transform (1, 2) * point.normal_z);
ret.normal_z = static_cast<float> (transform (2, 0) * point.normal_x + transform (2, 1) * point.normal_y + transform (2, 2) * point.normal_z);
Copy link
Member

Choose a reason for hiding this comment

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

Can't we use matrix multiplications here? I.e. obtain xyz values as an Eigen vector via getVector3fMap() and multiply with the transform matrix? The same for normals.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we can also use matrix multiplication.
I just copied the similar code in transformPoint here for consistency.

Copy link
Member

Choose a reason for hiding this comment

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

We could update transformPoint as well ;)
Matrix multiplication is faster and makes more obvious what's going on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, then I could update both functions.
By the way, it's so strange why this pull request cannot pass the Travis,
and I can't find clues in the output information. https://travis-ci.org/PointCloudLibrary/pcl/jobs/35188356

Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately Travis became almost useless for us in the recent months. Compilation often fails not because of errors in code but because their machines can not fulfill memory/computational demands... So do not be intimidated by these red crosses.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I see. So I have modified the code to use Eigen's matrix multiplication, both in transformPoint and transformPointWithNormal. And the unit test is also passed.

@jspricke
Copy link
Member

jspricke commented Oct 1, 2014

@rbrusu do you remember why you changed the matrix multiplication code in 0266f79? Otherwise I'm fine with merging.

@taketwo
Copy link
Member

taketwo commented Oct 1, 2014

Actually I already asked Radu about this here. His reply suggested we need some more investigation as to find out what is faster nowadays.

@jspricke
Copy link
Member

jspricke commented Oct 1, 2014

Thanks!

jspricke added a commit that referenced this pull request Oct 1, 2014
Add a common function called transformPointWithNormal
@jspricke jspricke merged commit df4ec7c into PointCloudLibrary:master Oct 1, 2014
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.

3 participants