Ask Your Question

Visualize or plot Float32MultiArray data field

asked 2019-04-25 08:06:23 -0500

marinePhD gravatar image

Similar to this question, is there a way to plot the data field of a Float32MultiArray message type? I'm trying to show the FFT of a signal in real-time and I can't seem to find a straightforward method of implementing the visualization I've tried Plot juggler, rqt_plot amd rqt_multiplot and they don't seem to have the functionality

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2019-04-25 08:45:21 -0500

mgruhler gravatar image

updated 2019-04-25 08:45:48 -0500

This is due the the *MultiArray data types being quite ambiguous. As you have to / can specify the MultiArrayLayout, you can put rather arbitrary data in there. The docs give an example for encoding an image using this data type. So there is no straightforward way to implement a visualization of this.

Also, all the tools you mention actually work on single value data and plot respective time series. Even though you can configure rqt_multiplot a little bit more, I don't think you are able to do that with this kind of message easily.

You'd have to create your own specific plotting display, I guess.

edit flag offensive delete link more


This is what I've come across as well. Looks like Ill have to write something it seems. Thanks.

marinePhD gravatar image marinePhD  ( 2019-04-25 09:28:18 -0500 )edit

answered 2020-11-09 12:47:06 -0500

flynneva gravatar image

for anyone else who ends up here.....I did a hacky solution to this problem of visualizing uint16 multiarray topics by adding it to the already established graph_rviz_plugin.

it was relatively straight forward, and could be enhanced with the other multi-array types as well IF your use case is similiar to mine where the multi-array was only one dimension, and I wanted to just use the size of the multi-array as the x-axis.

edit flag offensive delete link more



This looks quite good actually. I basically ended up converting my data to an image using opencv and then using an image topic to view it in Rviz. I'll see if I can play around with this and let you know how I get on. My use-case is quite similar. x axis is basically each FFT bin while y axis is the amplitude of each frequency bin

marinePhD gravatar image marinePhD  ( 2020-11-09 13:13:10 -0500 )edit

i dont have a float32multiarray topic to test on but I cleaned up my code a bit and tried adding in the other multiarray types. go ahead and try it out and let me know how it goes.

flynneva gravatar image flynneva  ( 2020-11-09 23:18:53 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2019-04-25 08:06:23 -0500

Seen: 531 times

Last updated: Nov 09 '20