Skip to content
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

Merged
merged 6 commits into from
Feb 11, 2025
6 changes: 3 additions & 3 deletions bindings/python/visualize/meshcat_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ def load_model_from_file(

self.load_model(model=model_loader.model(), model_name=model_name, color=color)

def load_model(self, model: idyn.Model, base_frame = None, model_name="iDynTree", color=None):
def load_model(self, model: idyn.Model, base_link = None, model_name="iDynTree", color=None):

# check if the model already exist
if self.__model_exists(model_name):
Expand All @@ -636,8 +636,8 @@ def load_model(self, model: idyn.Model, base_frame = None, model_name="iDynTree"
if base_frame is None:
GiulioRomualdi marked this conversation as resolved.
Show resolved Hide resolved
self.model[model_name].computeFullTreeTraversal(self.traversal[model_name])
else:
base_frame_index = self.model[model_name].getFrameIndex(base_frame)
self.model[model_name].computeFullTreeTraversal(self.traversal[model_name], base_frame_index)
base_link_index = self.model[model_name].getFrameIndex(base_link)
GiulioRomualdi marked this conversation as resolved.
Show resolved Hide resolved
self.model[model_name].computeFullTreeTraversal(self.traversal[model_name], base_link_index)

self.link_pos[model_name].resize(self.model[model_name])

Expand Down
Loading