Skip to content

Commit

Permalink
🐛 Avoid to return an error if the model is not correctly loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
GiulioRomualdi committed Oct 6, 2023
1 parent 83060a8 commit 5a9c9e2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions robot_log_visualizer/ui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ def plotTabBar_currentChanged(self, index):
# select the item in the tree from the path
item = self.ui.variableTreeWidget.topLevelItem(0)
for subpath in path[1:-1]:

# find the item given its name
for child_id in range(item.childCount()):
if item.child(child_id).text(0) == subpath:
Expand Down Expand Up @@ -558,17 +557,14 @@ def __load_mat_file(self, file_name):
if not self.meshcat_provider.load_model(
self.signal_provider.joints_name, self.signal_provider.robot_name
):
# if not loaded we print an error but we continue
msg = "Unable to load the model: "
if self.meshcat_provider.custom_model_path:
msg = msg + self.meshcat_provider.custom_model_path
else:
msg = msg + self.signal_provider.robot_name

self.logger.write_to_log(
"Unable to load the model from: "
+ self.meshcat_provider.custom_model_path
)
return
self.logger.write_to_log(msg)

# populate tree
root = list(self.signal_provider.data.keys())[0]
Expand Down

0 comments on commit 5a9c9e2

Please sign in to comment.