ami-iit / robot-log-visualizer

Visualizer to display the data logged with YarpRobotLoggerDevice
BSD 3-Clause "New" or "Revised" License
22 stars 4 forks source link

robot-log-visualizer crashes whe `yarp-robot-name` field is empty #34

Closed Nicogene closed 2 years ago

Nicogene commented 2 years ago

In my .mat file I have:

robot_logger_device = 

  struct with fields:

    description_list: {26×1 cell}
     yarp_robot_name: [1×0 char]
        joints_state: [1×1 struct]

>> robot_logger_device.yarp_robot_name

ans =

  1×0 empty char array

And when I try to load it with robot-log-visualizer I get:

[2758:2825:0406/161520.657265:ERROR:context_group.cc(181)] ContextResult::kFatalFailure: ES3 is blacklisted/disabled/unsupported by driver.
Traceback (most recent call last):
  File "/home/ngenesio/.local/lib/python3.8/site-packages/robot_log_visualizer/ui/gui.py", line 346, in open_mat_file
    self.signal_provider.open_mat_file(file_name)
  File "/home/ngenesio/.local/lib/python3.8/site-packages/robot_log_visualizer/file_reader/signal_provider.py", line 81, in open_mat_file
    self.robot_name = "".join(chr(c[0]) for c in robot_name_ref)
  File "/home/ngenesio/.local/lib/python3.8/site-packages/robot_log_visualizer/file_reader/signal_provider.py", line 81, in <genexpr>
    self.robot_name = "".join(chr(c[0]) for c in robot_name_ref)
IndexError: invalid index to scalar variable.
GiulioRomualdi commented 2 years ago

Fixed in https://github.com/ami-iit/robot-log-visualizer/commit/26a2177c277c5068661aacd64dd6c16389461e1f