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

Extend the possibility to load mat files with a name that is different from "robot_logger_device" #37

Closed Nicogene closed 2 years ago

Nicogene commented 2 years ago

At this moment if the mat file has a different name from robot_logger_device (actually the root variable has a different name) the visualizer fails to load the data:

  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 75, in open_mat_file
    joint_ref = f["robot_logger_device"]["description_list"]
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "/home/ngenesio/.local/lib/python3.8/site-packages/h5py/_hl/group.py", line 305, in __getitem__
    oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5o.pyx", line 190, in h5py.h5o.open
KeyError: "Unable to open object (object 'robot_logger_device' doesn't exist)"
[2]+  Done                    gazebo  (wd: ~/icub-tech-iit/ergocub-gazebo-simulations/build)
(wd now: ~/icub-tech-iit/ergocub-gazebo-simulations/build/telemetry_data)

It would be nice to have the possibility to use also different variables' names.