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

Fix 57 #65

Merged
merged 2 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions robot_log_visualizer/file_reader/signal_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,18 @@ def __populate_text_logging_data(self, file_object):

# New way to store the struct array in robometry https://github.com/robotology/robometry/pull/175
if text_ref.shape[0] == len(data[key]["timestamps"]):
# If len(value[text[0]].shape) == 2 then the text contains a string, otherwise it is empty
# We need to manually check the shape to handle the case in which the text is empty
data[key]["data"] = [
TextLoggingMsg(
text="".join(chr(c[0]) for c in value[text[0]]),
level="".join(chr(c[0]) for c in value[level[0]]),
)
if len(value[text[0]].shape) == 2
else TextLoggingMsg(
text="",
level="".join(chr(c[0]) for c in value[level[0]]),
)
for text, level in zip(text_ref, level_ref)
]

Expand Down
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