robot-log-visualizer icon indicating copy to clipboard operation
robot-log-visualizer copied to clipboard

Use PyQtGraph to plot data

Open Giulero opened this issue 9 months ago • 4 comments

This PR introduces the use of PyQtGraph to plot the data. Ideally, this can be used in place of matplotlib for faster execution and might be used for real-time logging, see #80.

Screenshot from 2025-04-14 17-12-20

New functionality:

  • robot_log_visualizer/plotter/pyqtgraph_viewer_canvas.py: Added a new class PyQtGraphViewerCanvas to visualize data with PyQtGraph. This class includes methods for initializing the canvas, updating plots, handling mouse clicks for annotations, and controlling animation.

Enhancements to existing functionality:

  • robot_log_visualizer/plotter/color_palette.py: Added a __call__ method to the ColorPalette class, allowing it to be used as a callable for retrieving colors by index.

Giulero avatar Apr 14 '25 15:04 Giulero

I guess we need to add pyqtgraph to the dependencies in https://github.com/ami-iit/robot-log-visualizer/blob/1a61360411a0100529c8011c8d9fb6273f62bbe4/setup.cfg#L42 ?

traversaro avatar Apr 14 '25 15:04 traversaro

I guess we need to add pyqtgraph to the dependencies in https://github.com/ami-iit/robot-log-visualizer/blob/1a61360411a0100529c8011c8d9fb6273f62bbe4/setup.cfg#L42 ?

Yes! In the future, we can also move to the toml configuration

GiulioRomualdi avatar Apr 14 '25 20:04 GiulioRomualdi

For now in 1772740 i substituted the MaplotlibViewerCanvas with the PyQtGraphViewerCanvas, but with could think of a logic that allows the user to choose one or another.

Giulero avatar Apr 15 '25 08:04 Giulero

For now in 1772740 i substituted the MaplotlibViewerCanvas with the PyQtGraphViewerCanvas, but with could think of a logic that allows the user to choose one or another.

Giulero avatar Apr 15 '25 08:04 Giulero

We can try to work on this and see if we can merge by few days

GiulioRomualdi avatar Jun 27 '25 11:06 GiulioRomualdi

I noticed that while clicking on the point in the dataset just the label is shown and not the circle

GiulioRomualdi avatar Jul 08 '25 14:07 GiulioRomualdi

@traversaro when this Will be merge (hopefully) we need to add a new dependency in the superbuild. Do you think Is problematic? How can we handle this?

GiulioRomualdi avatar Jul 08 '25 15:07 GiulioRomualdi

@traversaro when this Will be merge (hopefully) we need to add a new dependency in the superbuild. Do you think Is problematic? How can we handle this?

It seems available in conda-forge https://anaconda.org/conda-forge/pyqtgraph and apt https://repology.org/project/python:pyqtgraph/versions, so I think we are good to go.

traversaro avatar Jul 08 '25 15:07 traversaro