-
Notifications
You must be signed in to change notification settings - Fork 70
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
Enhance MeshcatVisualizer to support base frame in load_model method #1229
Conversation
This PR is required for: ami-iit/robot-log-visualizer#93 |
I have just a double on the name. At the moment we only support |
base_frame_index = self.model[model_name].getFrameIndex(base_frame) | ||
self.model[model_name].computeFullTreeTraversal(self.traversal[model_name], base_frame_index) |
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.
Should we handle somehow the case in which base_frame
(or base_link
, see the other comment) is not a valid name?
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!
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 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.
@GiulioRomualdi I may be missing something, but it does not seem that 08b75f2 handles the case in which base_link
is not a valid name?
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.
My fault : d1d688d
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.
Actually I got
if base_link_index == idyn.LINK_INVALID_INDEX:
AttributeError: module 'idyntree.bindings' has no attribute 'LINK_INVALID_INDEX'
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 was wondering if LINK_INVALID_INDEX
is exported in python given: https://github.com/search?q=repo%3Arobotology%2Fidyntree%20LINK_INVALID_INDEX&type=code
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.
Strange, it seems exposed at least on MATLAB:
nargoutchk(0,1) |
-1
, see idyntree/src/model/src/Indices.cpp
Line 9 in 83bd07a
LinkIndex LINK_INVALID_INDEX = -1; |
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.
or check if it is smaller than 0.
Co-authored-by: Silvio Traversaro <[email protected]>
Co-authored-by: Silvio Traversaro <[email protected]>
See #1229 (comment) . |
Thanks! |
Can i squash? |
Sure! |
I released this change in iDynTree 13.3.0 : https://github.com/robotology/idyntree/releases/tag/v13.3.0 . |
This pull request includes modifications to the
bindings/python/visualize/meshcat_visualizer.py
file to enhance theload_model
method by adding support for an optionalbase_frame
parameter. This change allows for more flexible model loading by specifying a base frame for the model's traversal computation.