-
Notifications
You must be signed in to change notification settings - Fork 68
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
Adding methods for handling primitive shapes to MeshcatVisualizer #1117
Adding methods for handling primitive shapes to MeshcatVisualizer #1117
Conversation
bool setSphere(const std::string &name, | ||
const iDynTree::Position &position, | ||
const double radius, | ||
const iDynTree::VectorFixSize<3> &color); | ||
|
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.
In theory, you should implement two functions. One for loading a sphere and one for set it in space.
Following what is done in MeshcatVisualizer
(python version) you may have
for loading a sphere and
for setting its pose
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.
Moreover I would implement also the version with Span
and MatrixView
const std::string msg = "world_T_base needs to be a 4x4 matrix. Provided a " | ||
+ std::to_string(world_T_base.rows()) + "x" | ||
+ std::to_string(world_T_base.cols()) + " matrix."; | ||
const std::string msg = "world_T_base needs to be a 4x4 matrix. Provided a " + std::to_string(world_T_base.rows()) + "x" + std::to_string(world_T_base.cols()) + " matrix."; |
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 would avoid having so long lines in the code
bool setPrimitiveGeometryTransform(const iDynTree::Transform &world_T_geometry, | ||
const std::string &geometryName); | ||
|
||
bool setPrimitiveGeometryTransform(const iDynTree::MatrixView<const double> &world_T_geometry, | ||
const std::string &geometryName); |
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.
Can you add the documentation?
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.
It is available with the last commit 09cdd73. I added 1 comment for both implementations. Do I have to duplicate it?
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 think yes since they are rendered by doxygen to generate the documentation
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 think yes since they are rendered by doxygen to generate the documentation
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.
There is also a way for Doxygen to automatically insert the doc of another method, but for sure the easiest fix is to duplicate.
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.
With this commit 798df73 everything should be settled. Let me know if any other edit is required @GiulioRomualdi @traversaro.
…rimitiveGeometryTransform methods
…ylinder, loadBox, loadEllipsoid
@GiulioRomualdi is this ok for you? |
Yes! 🟢 flag for me! |
Ok, I updated the PR title to reflect its current content. cc @G-Cervettini |
Adding methods to MeshcatVisualizer.cpp wrapper of meshcat-cpp to draw basic geometries.