Communication visualization

3 views
Skip to first unread message

loganpevans

unread,
Feb 9, 2014, 3:05:41 PM2/9/14
to palouse...@googlegroups.com
It would be useful to have some visual insight into robosub communication. My expectation is that this graphing will be assigned to a senior design student.

== Outline of graphing project ==
I can think of several ways the graph the data. Some of the views would be more useful than others.

The basic coding task would be to take a log file and then extract (timestamp, value) pairs for each distinct "module_name" type.

=== Time series ===
Using matplotlib, we can create graphs where time is on one axis and a measurement value is on the other axis. It is possible to stack the graph for, say, datafeed/raw/depth above the graph for datafeed/filtered/depth. Using such a view, it would be possible to see how well a Kalman filter is smoothing out measurement noise. matplotlib has a nice feature where you can zoom in on a region on one graph and the x-axis for all linked graphs will similarly zoom.

A point where this type of graph would be particularly useful is with tuning the fuzzy logic controllers. As humans, we can look at a sanitized sensor reading and determine that that the sub is "too high in the water, but not by much" or that the sub "is way too close to the surface". It can be tedious to do a proper fuzzy logic controller tuning if we can't easily see what the fuzzy logic controller is thinking.

=== Module dependencies ===
This should be a half-hour project. We have a "listen" key in the settings file. This key specifies that module X depends on module Y in some way. In graph terms, there is an arc from module Y to module X.

Using pygraphviz, we could generate a quick graph that shows these dependencies.

=== Latency histograms ===
I would imagine that if we plot an empirical distribution for how much time it takes for a signal to be read from the microcontroller until the response motor value is sent to the microcontroller, we would have a nice bell curve. The shape could be drastically different. It might be that 10% of all communications happen within a few milliseconds while 90% take half a second. This type of data could tell us whether we need to redesign the grapevine.

Using matplotlib, all we need is a collection of time values. If we were to parse through a log file and guess that whenever we see, say, a depth reading, that we are "starting" a stopwatch. When we see the next microcontroller message that specifies the raw motor values, we "stop" the stopwatch. Repeat the process for a few thousand such loops. We could even modify src/datafeed/raw/depth/mock.py so that it has a reasonably high interval between fake depth measurements so that we don't incorrectly associate events. (Note: this mock sensor reading is currently only in the branch user/LoganEvans-structure).

=== Data conversion scatterplot ===
Many of our modules have the general format of converting an input value to a related output value. Admittedly, most of our modules take into account more than just a single input. However, it would be interesting to create a plot that shows the conversion done between two modules.

For this, we can again use matplotlib. If we can match a logged value with module X with a logged value from module Y (the matching would probably be to look for the first message from module Y that occurs after module X as long as that message occurs within half a second), then we can submit this data to a matplotlib.scatter.

One area where this would be useful is to confirm that our fuzzy logic fuzzifier is working correctly.

James Irwin

unread,
Feb 10, 2014, 11:45:49 AM2/10/14
to palouse...@googlegroups.com
I think this is a great idea, it will provide an easy way to gauge the performance/effectiveness of different algorithms across the board.
Reply all
Reply to author
Forward
0 new messages