Add eigen utils to convert mesh 3d vertices to oriented box#224
Add eigen utils to convert mesh 3d vertices to oriented box#224adlarkin merged 17 commits intogazebosim:ign-math6from
Conversation
Signed-off-by: AmrElsersy <amrelsersay@gmail.com>
scpeters
left a comment
There was a problem hiding this comment.
you've resolved a lot of comments but I don't see the corresponding changes in the code
Signed-off-by: AmrElsersy <amrelsersay@gmail.com>
forgot to push :D |
Codecov Report
@@ Coverage Diff @@
## ign-math6 #224 +/- ##
==========================================
Coverage 99.21% 99.22%
==========================================
Files 65 66 +1
Lines 6089 6162 +73
==========================================
+ Hits 6041 6114 +73
Misses 48 48
Continue to review full report at Codecov.
|
adlarkin
left a comment
There was a problem hiding this comment.
Overall, this looks good. I'm trying to do a few verifications for testing, but I think that this can be merged as long as I don't find anything strange in the tests I run.
scpeters
left a comment
There was a problem hiding this comment.
I made a few suggestions about documentation and naming, suggesting vertices instead of mesh to avoid confusion with ignition::common::Mesh
Signed-off-by: AmrElsersy <amrelsersay@gmail.com>
Signed-off-by: AmrElsersy <amrelsersay@gmail.com>
|
This pull request has been mentioned on Gazebo Community. There might be relevant details there: https://community.gazebosim.org/t/gsoc-2021-machine-learning-extension-to-ignition-gazebo/1070/1 |
I went ahead and ran the example set of points in the unit test through Open3D's It looks like the box's center and size are similar enough between |
|
@adlarkin their code Eigen::Matrix3d R = es.eigenvectors();
R.col(0) /= R.col(0).norm();
R.col(1) /= R.col(1).norm();
R.col(2) /= R.col(2).norm();
if (evals(1) > evals(0)) {
std::swap(evals(1), evals(0));
Eigen::Vector3d tmp = R.col(1);
R.col(1) = R.col(0);
R.col(0) = tmp;
}
if (evals(2) > evals(0)) {
std::swap(evals(2), evals(0));
Eigen::Vector3d tmp = R.col(2);
R.col(2) = R.col(0);
R.col(0) = tmp;
}
if (evals(2) > evals(1)) {
std::swap(evals(2), evals(1));
Eigen::Vector3d tmp = R.col(2);
R.col(2) = R.col(1);
R.col(1) = tmp;
}But anyway I see them are close (not too much close) but they have rotation in the same directions at least .. and also the rotation is acceptable visually, so we don't need to compare it with Open3D |
Signed-off-by: AmrElsersy <amrelsersay@gmail.com>
That was the output when I tried that code of Open3D for calculating Rotation instead of the current algorithm |
Signed-off-by: AmrElsersy <amrelsersay@gmail.com>
adlarkin
left a comment
There was a problem hiding this comment.
Just a few small comments, but I think this is almost ready to merge!
|
have we considered specifying the orientation of the bounding box and then simply expanding its dimensions to include all the passed vertices? this would avoid the weird box rotations at the cost of generating non-minimal boxes |
I think the challenge is that in some scenarios, we have the vertices of an object, but not the orientation of the object. For example, in gazebosim/gz-rendering#334, I believe that we have all of the vertices from the bounding boxes provided by Ogre, but I don't believe that we have a way of getting the "combined orientation" from all of the rendering visuals (I could be wrong about this). However, that being said, I think that it would be good to provide users with the option to pass in an orientation to |
Signed-off-by: AmrElsersy <amrelsersay@gmail.com>
adlarkin
left a comment
There was a problem hiding this comment.
Code looks good! I'm going to wait to see what @scpeters thinks about #224 (comment) before merging this.
I would just add a separate API that accepts a vector of vertices as well as a |
Signed-off-by: Steve Peters <scpeters@openrobotics.org>


Signed-off-by: AmrElsersy amrelsersay@gmail.com
🎉 New feature
Summary
Adding helper functions to convert 3d vertices of a mesh to an oriented bounding box to be used in the bounding box camera
rendering#334
Checklist
codecheckpassed (See contributing)