-
Notifications
You must be signed in to change notification settings - Fork 289
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 support to get link AABB from its collisions #2787
base: gz-sim9
Are you sure you want to change the base?
Conversation
Signed-off-by: Gabriel Pacheco <[email protected]>
2697b91
to
38b52d4
Compare
Signed-off-by: Gabriel Pacheco <[email protected]>
38b52d4
to
9c45098
Compare
include/gz/sim/Link.hh
Outdated
/// collision shapes attached to the it. The link bounding box is | ||
/// generated by merging all the bounding boxes of the collision | ||
/// geometries. | ||
/// \param _ecm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// \param _ecm | |
/// \param _ecm Entity-component manager. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 7cbf8a3
EXPECT_EQ(aab.Center(), math::Vector3d::Zero); | ||
|
||
meshSdf.SetUri("duck.dae"); | ||
std::string filePath = common::joinPaths(std::string(PROJECT_SOURCE_PATH), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include <string>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 469a446
TEST_F(UtilTest, TransformAxisAlignedBoxFrame) | ||
{ | ||
// Creates a pseudo-random vector with values between -max and max | ||
std::srand(std::time(nullptr)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include <cstdlib>
and <ctime>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 469a446
Signed-off-by: Gabriel Pacheco <[email protected]>
Signed-off-by: Gabriel Pacheco <[email protected]>
🎉 New feature
Summary
This PR adds AABB support to the Link API. It computes the overall link aligned bounding box (in local and world coordinates) by merging all collision bounding boxes obtained from their geometry shapes. Plus, it adds utility functions to transform AABB coordinates and calculate mesh AABB using utilities from
gz::common::Mesh
.Test it
gz-sim
andsdformat
branches$ colcon build --packages-select sdformat15 gz-sim9 --merge-install
gz-sim9
tests:$ ./build/gz-sim9/bin/UNIT_Util_TEST && ./build/gz-sim9/bin/INTEGRATION_link
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.