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

Extend bindings for OBB and misc fixes. #493

Merged
merged 2 commits into from
Feb 20, 2020
Merged

Extend bindings for OBB and misc fixes. #493

merged 2 commits into from
Feb 20, 2020

Conversation

Skylion007
Copy link
Contributor

Motivation and Context

Added some functionality needed for properly using OBBs in the Habitat-API.
1). Add new python bindings to OBB
2). Fix bugs computeMOBB and expose to python.
3). Have sampleNavigablePoint return a point that will always not be navigable if it fails. That ensure that we get a proper error state that we can check against pt(inf,inf,inf).

How Has This Been Tested

It has been tested by being used for generating the ObjectNav datasets in the Habitat-API.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Feb 13, 2020
@codecov
Copy link

codecov bot commented Feb 13, 2020

Codecov Report

Merging #493 into master will decrease coverage by 0.03%.
The diff coverage is 37.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #493      +/-   ##
==========================================
- Coverage   59.19%   59.16%   -0.04%     
==========================================
  Files         165      165              
  Lines        7340     7346       +6     
  Branches       84       84              
==========================================
+ Hits         4345     4346       +1     
- Misses       2995     3000       +5
Flag Coverage Δ
#CPP 54.5% <28.57%> (-0.06%) ⬇️
#JavaScript 10% <ø> (ø) ⬆️
#Python 79.72% <100%> (ø) ⬆️
Impacted Files Coverage Δ
src/esp/geo/OBB.cpp 31.42% <0%> (ø) ⬆️
src/esp/geo/geo.cpp 30% <0%> (-4.29%) ⬇️
src/esp/nav/PathFinder.cpp 77.32% <100%> (+0.04%) ⬆️
habitat_sim/geo.py 100% <100%> (ø) ⬆️

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 05db83e...23cee7b. Read the comment docs.

Copy link
Contributor

@erikwijmans erikwijmans left a comment

Choose a reason for hiding this comment

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

LGTM. One request to use constexpr

src/esp/nav/PathFinder.cpp Outdated Show resolved Hide resolved
Co-Authored-By: Erik Wijmans <etw@gatech.edu>
Copy link
Contributor

@mathfac mathfac left a comment

Choose a reason for hiding this comment

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

@Skylion007 thank you for all the courage to fix low level hard to capture issues. Well done!

@@ -107,7 +107,7 @@ OBB computeGravityAlignedMOBB(const vec3f& gravity,
const float dd = d0[0] * d1[1] - d0[1] * d1[0];

const float dx = s1[0] - s0[0];
const float dy = s1[1] - s0[0];
const float dy = s1[1] - s0[1];
Copy link
Contributor

Choose a reason for hiding this comment

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

@Skylion007, can you remind me what was the bug here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

dy was not actually calculating a delta y.

@@ -240,7 +240,7 @@ OBB computeGravityAlignedMOBB(const vec3f& gravity,
aabb.extend(T_w2b * pt);
}

return OBB{aabb.center(), aabb.sizes(), T_w2b.inverse()};
return OBB{T_w2b.inverse() * aabb.center(), aabb.sizes(), T_w2b.inverse()};
Copy link
Contributor

Choose a reason for hiding this comment

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

And here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The center was not in world coordinates

@@ -39,13 +39,12 @@ std::vector<vec2f> convexHull2D(const std::vector<vec2f>& points) {
}

// Build upper hull
for (size_t i = idx.size() - 2, t = k + 1; i >= 0; i--) {
Copy link
Contributor

Choose a reason for hiding this comment

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

And here, just to have a history record for all this deep changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolves a segfault that occurs on Linux due to undefined behavior of unsigned integer underflows.

@Skylion007 Skylion007 merged commit 599bebb into master Feb 20, 2020
@Skylion007 Skylion007 deleted the extend_obb branch February 20, 2020 22:20
Ram81 pushed a commit to Ram81/habitat-web-sim that referenced this pull request Dec 10, 2020
* OBB fixes and extends. Also added error val to sample navigable point
* Make getRandomNavigablePoint failure value constant.

Co-Authored-By: Erik Wijmans <etw@gatech.edu>

Co-authored-by: Erik Wijmans <ewijmans2@gmail.com>
luoj1 pushed a commit to luoj1/habitat-sim that referenced this pull request Aug 16, 2022
* Extract ckpt_id from ckpt_path

* rename util function

* Move defrost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants