From 5a9c9e211e8ee87718a7c107f9d77b76ff659e6b Mon Sep 17 00:00:00 2001 From: Giulio Romualdi Date: Fri, 6 Oct 2023 12:44:27 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Avoid=20to=20return=20an=20error?= =?UTF-8?q?=20if=20the=20model=20is=20not=20correctly=20loaded?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- robot_log_visualizer/ui/gui.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/robot_log_visualizer/ui/gui.py b/robot_log_visualizer/ui/gui.py index 120cbd2..8bb0f16 100644 --- a/robot_log_visualizer/ui/gui.py +++ b/robot_log_visualizer/ui/gui.py @@ -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: @@ -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]