PlotJuggler icon indicating copy to clipboard operation
PlotJuggler copied to clipboard

How to plot custom key value message by key?

Open Rayman opened this issue 2 years ago • 6 comments

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

Rayman avatar May 09 '22 13:05 Rayman

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

facontidavide avatar May 11 '22 07:05 facontidavide

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

Rayman avatar May 11 '22 08:05 Rayman

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

facontidavide avatar May 11 '22 08:05 facontidavide

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!

MaxxWilson avatar Jul 19 '23 23:07 MaxxWilson

@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!

rem821 avatar Jul 26 '23 13:07 rem821

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.

Rayman avatar Jul 28 '23 07:07 Rayman