<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Tools</categorytree>
__TOC__

== Real Time Plotter ==

The <tt>plotter</tt> (in <tt>sw/logalizer/</tt>) is a facility to plot real time data broadcasted on the Paparazzi network bus. Main features:
* Drag&Drop from the <tt>messages</tt> window of any field
* Multi-curves, constant curves
* Configurable update delay and memory size
* Basic scaling mechanism

===First Try===

Launch a simulation with a <tt>messages</tt> window (for example the '''Versatile Sim''' session provided as an example) from the [[Paparazzi_Center|Paparazzi Center]] or launch manually a <tt>messages</tt> window with
 <tt>sw/ground_segment/tmtc/messages -c ground</tt>
from a shell.
Launch the plotter with (or configure it in your [[Paparazzi_Center|session]])
 <tt>sw/logalizer/plotter</tt>
From the <tt>messages</tt> window, select the field '''pos_x''' in the '''NAVIGATION''' message and drop it on the Plotter. Do the same with '''pos_y''', you should get something similar to

[[Image:Plotter.png|Plotter pos_x pos_y]]

Delete the '''pos_y''' curve by selecting it in the '''Curves''' menu and drop the '''desired_x''' from the '''DESIRED''' message:

[[Image:Plotter_desired_x.png|Plotter pos_x pos_y]]

It is also possible to draw curves with different scales in the same window. Delete both curves and '''Reset''' (or open a new plotter from the '''File''' menu) and drop '''desired_altitude''' from the '''DESIRED''' message. Enter '''0.01''' (to convert cm into m) in the '''Scale''' entry box and drop '''alt''' from '''GPS''' message. Change the desired altitude from the [[GCS]] ('''+30m''') to observe the behaviour of the altitude controller:

[[Image:plotter_desired_alt.png|Plotter pos_x pos_y]]

An offset can be added to the scaling. For example a scale value of "1.8+32" translates degrees Celsius into degrees Fahrenheit.

If available, the '''alt_unit_coef''' attribute of the message (see [[DevGuide/Communications]]) is used to scale and translate the values.

Running plots are listed in the '''Curves''' menu from which it is possible to:
* Delete the curve;
* Enable the '''Discrete''' behaviour where no interpolation is shown between actual data points;
* Monitor the average and the standard deviation of the plotted values.

===Options===

The <tt>-c</tt> option allows to start the plotter with some given curves. The desired curve is specified with a colon separated string: <tt>sender:class:message:field</tt> (where <tt>sender</tt> is the id of the author of the message, for example the id of an aircraft). For example
 <tt>sw/logalizer/plotter -c 7:telemetry:BAT:voltage</tt>
A scale factor can also be specified (separated with one more colon):
 <tt>sw/logalizer/plotter -c *:telemetry:GPS:alt:0.01 -c *:telemetry:DESIRED:desired_altitude</tt>
Combined with the <tt>-n</tt> option which opens a new window, you can fill your screen with curves (here to monitor the altitude, pitch and roll control):
 <tt>sw/logalizer/plotter -c *:telemetry:GPS:alt:0.01 -c *:telemetry:DESIRED:altitude
                       -n -c *:telemetry:ATTITUDE:theta:57.3 -c *:telemetry:DESIRED:pitch:57.3
                       -n -c *:telemetry:ATTITUDE:phi:57.3 -c *:telemetry:DESIRED:roll:57.3</tt>
Options <tt>-t</tt> and <tt>-g</tt> give the opportunity to label the window (the last one if option <tt>-n</tt> is used) with a title and specify a geometry (à la X):
 <tt>sw/logalizer/plotter -c *:telemetry:GPS:alt:0.01 -c *:telemetry:DESIRED:altitude -t altitude -g 800x200+0+0
                       -n -c *:telemetry:ATTITUDE:theta:57.3 -c *:telemetry:DESIRED:pitch:57.3 -t theta -g 400x200+0+200
                       -n -c *:telemetry:ATTITUDE:phi:57.3 -c *:telemetry:DESIRED:roll:57.3 -t phi -g 400x200+400+200</tt>

Options <tt>-m</tt> and <tt>-u</tt> allows to change the default memory size (100) and update time (0.5s).

===Pause===

The display update can be '''Suspend'''ed while the data are still stored: no disctoninuity on a '''Restart'''. The data update
can also be '''Stop'''ed while the display is active (e.g. resizable). These features are available from the '''File''' menu or via keyboard accelerators.

===More Tuning===

A constant curve can be added by entering a float value in the '''Constant''' box.

The update time can be set with the slider; it should be smaller than the period of the faster data you want to plot.

The number of points of each curve can be set from 10 to 1000.

After disabling the auto scale mode, minimum and maximum displayed values can be manually set.

[[Category:Tools]] [[Category:User_Documentation]]