Ask Your Question

Does ros have any messages and/or tools for displaying histograms?

asked 2011-05-19 17:10:18 -0500

updated 2011-05-28 05:25:53 -0500

kwc gravatar image

From what I can tell the answer is no. But I didn't want to reproduce anything if it already existed or if there was a clever combination of tools/msgs that I wasn't sharp enough to think up.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-05-19 18:08:18 -0500

I've never come across anything in ROS itself but assuming you've installed the rxtools package (rx stack) then you have matplotlib installed since it's a dependency (used by rxplot) and you can use its pyplot.hist command.

As for how to get the data to plot, there are lots of ways but you're looking for a quick, one-off solution you could use rosh (you probably want to check this page for usage details). It could look something like this though:

# pop up a histogram of the field `bar` from the 
# last 100 messages on the topic `foo`:
import matplotlib.pyplot as plt
import numpy as np
x = np.array([ for m in[:100]])
edit flag offensive delete link more

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: 2011-05-19 17:10:18 -0500

Seen: 1,134 times

Last updated: May 19 '11