-
Notifications
You must be signed in to change notification settings - Fork 103
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 AxisAlignedBox getters for all relevant geometries #1547
base: sdf15
Are you sure you want to change the base?
Add AxisAlignedBox getters for all relevant geometries #1547
Conversation
* Mesh is a special case since it forwards the calculations for the caller. If callback is not set, the return is nullptr * This has been done since this library does not depend on gz-common * Geometry types that do not have a volume, return nullptr. Signed-off-by: Gabriel Pacheco <gabriel.fpacheco@gmail.com>
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.
These new methods should also be included in the python API (tests too), if you don't the time to do it, please open an issue about adding them
I'm on it already |
5e0dafd
to
caa3799
Compare
Signed-off-by: Gabriel Pacheco <gabriel.fpacheco@gmail.com>
caa3799
to
2ef02d4
Compare
it's reasonable to add
The implementation here could then be refactored to use those helper functions, but we don't need to block this PR for that |
|
@@ -76,6 +77,10 @@ namespace sdf | |||
public: std::optional<gz::math::Inertiald> | |||
CalculateInertial(double _density); | |||
|
|||
/// \brief Get the Axis-aligned box for this Box. |
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.
For this and other similar comments, please state where the center of the Axis-aligned box is located. In most cases, I believe it will be at the center of the SDFormat shape, but I think that is not always the case for meshes
🎉 New feature
Part of gazebosim/gz-sim#2787
Summary
This PR adds
AxisAlignedBox
support for SDF geometries. Now each volumetric geometry type such as Box, Capsule, Cone, Cylinder, Ellipsoid, Sphere, and Mesh has a newAxisAlignedBox()
function that computes its bounding box from the geometry dimensions. The Geometry class uses these functions to determine the correct AABB, allowing a custom calculator for meshes , which is a special case since no mesh loading is performed in thesdf::Mesh
class.Test it
sdformat
branch$ colcon build --packages-select sdformat15 --merge-install
sdformat15
tests:$ colcon test --packages-select sdformat15 --merge-install
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.