-
Notifications
You must be signed in to change notification settings - Fork 67
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 Helpers pybind11 interface #313
Conversation
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Codecov Report
@@ Coverage Diff @@
## ign-math6 #313 +/- ##
==========================================
Coverage 99.65% 99.65%
==========================================
Files 67 67
Lines 6360 6360
==========================================
Hits 6338 6338
Misses 22 22 Continue to review full report at Codecov.
|
/// \brief Compute sphere volume | ||
/// \param[in] _radius Sphere radius | ||
/// \return sphere volume | ||
float SphereVolume(const float _radius) | ||
{ | ||
return IGN_SPHERE_VOLUME(_radius); | ||
} | ||
|
||
/// \brief Compute cylinder volume | ||
/// \param[in] _r Cylinder base radius | ||
/// \param[in] _l Cylinder length | ||
/// \return cylinder volume | ||
float CylinderVolume(const float _r, const float _l) | ||
{ | ||
return IGN_CYLINDER_VOLUME(_r, _l); | ||
} | ||
|
||
/// \brief Compute box volume | ||
/// \param[in] _x X length | ||
/// \param[in] _y Y length | ||
/// \param[in] _z Z length | ||
/// \return box volume | ||
float BoxVolume(const float _x, const float _y, const float _z) | ||
{ | ||
return IGN_BOX_VOLUME(_x, _y, _z); | ||
} | ||
|
||
/// \brief Compute box volume from a vector | ||
/// \param[in] _v Vector3d that contains the box's dimensions. | ||
/// \return box volume from a vector | ||
float BoxVolumeV(const ignition::math::Vector3d &_v) | ||
{ | ||
return IGN_BOX_VOLUME_V(_v); | ||
} |
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.
I intend on replacing these macros with constexpr
functions in main
, just a thought when we are forward porting.
This pull request has been mentioned on Gazebo Community. There might be relevant details there: https://community.gazebosim.org/t/new-ignition-releases-2022-03-01-citadel-edifice-fortress/1313/1 |
Signed-off-by: ahcorde [email protected]
🎉 New feature
Summary
This PR creates a Helpers Pybind11 interface
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.