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

Factored out the checkIsometry() helper function into a standalone header library. #144

Merged
merged 1 commit into from
May 24, 2020

Conversation

peci1
Copy link
Contributor

@peci1 peci1 commented May 22, 2020

As suggested in moveit/moveit#1964 .

I made the checkIsometry() function available also in release mode, so that the check can be used at other places than inside the assert macro.

@peci1 peci1 force-pushed the export_isometry_check branch from 213d8dc to ede05d0 Compare May 22, 2020 14:51
@codecov-commenter
Copy link

codecov-commenter commented May 22, 2020

Codecov Report

Merging #144 into noetic-devel will increase coverage by 0.32%.
The diff coverage is 100.00%.

Impacted file tree graph

@@               Coverage Diff                @@
##           noetic-devel     #144      +/-   ##
================================================
+ Coverage         55.54%   55.86%   +0.32%     
================================================
  Files                11       12       +1     
  Lines              1723     1722       -1     
================================================
+ Hits                957      962       +5     
+ Misses              766      760       -6     
Impacted Files Coverage Δ
include/geometric_shapes/bodies.h 90.90% <ø> (+6.00%) ⬆️
src/bodies.cpp 69.79% <ø> (ø)
src/body_operations.cpp 47.47% <ø> (+0.94%) ⬆️
include/geometric_shapes/check_isometry.h 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4538c9b...5172b9d. Read the comment docs.

Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

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

From my point of view, the checkIsometry function is somewhat over-engineered, allowing to pass the precision as well.

include/geometric_shapes/check_isometry.h Outdated Show resolved Hide resolved
include/geometric_shapes/check_isometry.h Outdated Show resolved Hide resolved
include/geometric_shapes/check_isometry.h Outdated Show resolved Hide resolved
@peci1
Copy link
Contributor Author

peci1 commented May 23, 2020

The rationale for passing the precision and setting it one order "higher" than the precision used for comparison was because I didn't like errors like:

The given transform is not an isometry! It's linear part involves scaling: 1 1 1

But if it seems over-engineered to you, I can make the precision hard-coded which would simplify the code.

@rhaschke
Copy link
Contributor

But if it seems over-engineered to you, I can make the precision hard-coded which would simplify the code.

I was expecting the 1 1 1 error output as the underlying reason for this change. What about a message like this:
"The linear part involves a scaling, which deviates from identity by %f", max(abs(scaling - ones())

@peci1
Copy link
Contributor Author

peci1 commented May 23, 2020

I'm not for introducing other possible rounding/representation errors. I was also thinking about subtracting ones, but in the end I think that showing the raw computed values is more valuable.

@peci1 peci1 force-pushed the export_isometry_check branch from c303c17 to a0f24b0 Compare May 23, 2020 13:59
Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

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

I still don't like the complexity of the code, but I approve. It's up to @v4hn to ask for more simplification if necessary.

@peci1
Copy link
Contributor Author

peci1 commented May 23, 2020

Thanks. I'm open to discussion.

@rhaschke
Copy link
Contributor

I'm not for introducing other possible rounding/representation errors.

I don't think you introduce new rounding errors by the proposed approach. You will just focus on the deviations from the expected values.

@peci1
Copy link
Contributor Author

peci1 commented May 23, 2020

I was more concerned about representation errors of IEEE floats. In 32 bits, There are approx 2^30 numbers between 0 and 1, and only 2^23 between 1 and 2. But I don't think that if you take a number from 1-2 range and subtract one, you'd have a guarantee that you'll find a corresponding normal float in the 0-1 range.

However, since these values are anyways computed by SVD, they probably accumulate so many errors during the computation that caring about the representation of the result can be seen as a negligible issue...

So, okay, you convinced me to subtract ones and use the scientific format :)

@peci1 peci1 force-pushed the export_isometry_check branch from a0f24b0 to 7fc9e4f Compare May 23, 2020 15:28
@peci1 peci1 force-pushed the export_isometry_check branch from 7fc9e4f to 5172b9d Compare May 24, 2020 20:19
@v4hn v4hn merged commit b5b8396 into moveit:noetic-devel May 24, 2020
rhaschke pushed a commit to rhaschke/geometric_shapes that referenced this pull request May 25, 2020
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.

4 participants