facontidavide / PlotJuggler

The Time Series Visualization Tool that you deserve.
https://www.plotjuggler.io
Mozilla Public License 2.0
4.48k stars 626 forks source link

How to plot custom key value message by key? #644

Open Rayman opened 2 years ago

Rayman commented 2 years ago

Thanks you for PlotJuggler!

Problem description

I have a custom message with a key value structure. How can I plot the value of a single key? I know this is possible for certain messages (e.g. diagnostic_msgs/DiagnosticStatus). Can I write a plugin/lua script for this?

Steps to reproduce (important)

The message looks something like this

rosmsg show msgs/SignalArray
msgs/Signal[] signals
  string name
  float64 value

Plotjuggler at the moment is able to plot specific field numbers. But this is not very useful in my use case. I want to plot by key. signal_plotjuggler

facontidavide commented 2 years ago

The best way to solve this isadding your own parser to the ROS plugin. Unfortunately, this means that you need to modify and recompile that plugin

Rayman commented 2 years ago

Thanks. I was hoping I could write a plugin for that or some reactive script.

In the meantime I found plotjuggler_msgs/DataPoints, so I could also write a conversion node to prepare the data for plotting

facontidavide commented 2 years ago

now that you mention it, I need to check if a reactive script can be used here. I will come back to you with some ideas

MaxxWilson commented 1 year ago

Hello @facontidavide!

Is there any update on if this is possible using Reactive Scripts, or if it is still necessary to modify the plotjuggler-ros-plugins source?

Thanks!

rem821 commented 1 year ago

@facontidavide I would be interested in this too, though my use-case is a bit different - I have a custom msg that contains a string and a float. Would it be possible to create a filter in a custom time series only lets through floats that come in a message with a specific string? Right now custom time series don't accept strings at all as the additional source and also it is enforced that each function call returns a value.

Thanks!

Rayman commented 1 year ago

I wrote a conversion node that converts from our message to plotjuggler_msgs/DataPoints and that works. I would be interested if there was a simpler way.

maracuya-robotics commented 1 month ago

Looks like this is a duplicate of #286, or at least related to it.