YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
yarpscope: visualize the numerical content of a port
+ Collaboration diagram for yarpscope: visualize the numerical content of a port:

Description

This simple graphical user interface allows one to visualize on a plot the content of a YARP port. The input port is assumed to contain a single vector of numbers. If you want to plot complex data, i.e. a nested bottle, you might want to check the command yarp split to pre-process the data and subdivide the bottle into multiple vectors.

How to initialize the yarpscope

yarpscope supports two different modes: simple mode (one remote, one graph) and XML mode (multiple remotes, multiple graph).

The following options are common to both modes:

--help Print this help and exit.
--title [string] Title of the window (default "YARP Port Scope")
--x [uint] Initial X position of the window.
--y [uint] Initial Y position of the window.
--dx [uint] Initial width of the window.
--dy [uint] Initial height of the window.
--interval [int] Initial refresh interval in milliseconds. (default = 50ms)

Simple Mode

Simple mode can be used for running yarpscope from the command line, connecting to a single remote and displaying multiple plots on a single graph.

The syntax is

--remote [string] Remote port to connect to.
--carrier [string] YARP Carrier used for connections (default "mcast")
--persistent, Make normal or persistent connections (default persistent)
--no-persistent
--index [...] Index(es) of the vector to plot.
It can be an [uint] or an array of [uint]s
--plot_title [string] Plot title (default = remote)
--min [float] Minimum value for the Y axis (default -100)
--max [float] Maximum value for the Y axis (default 100)
--size [uint] Plot size (Number of samples to plot) (default 201)
--bgcolor [string] Background color.
--color [...] Graph color(s).
Depending on index it must be a [string] or an array of [string]s.
--type [...] Graph type(s). Accepted values are "points", "lines" and "bars" (default = "lines")
Depending on index it must be a [string] or an array of [string]s.
--graph_size [...] Graph size(s) (thickness of the points) (default = 1)
Depending on index it must be a [uint] or an array of [uint]s.

XML Mode

XML mode can be used to start yarpscope by passing an xml that contains the configuration of the window. It can connect to multiple remotes and display one or more graphs in a grid. To invoke XML mode, yarpscope must be started passing the –xml parameter. The file is located using the YARP default policy.

Here is an example of portscope description file in XML format:

<?xml version="1.0" encoding="UTF-8" ?>
<portscope rows="3" columns="3" carrier="mcast">
<plot gridx="0"
gridy="0"
hspan="1"
vspan="1"
title="Plot 00"
size="60"
minval="-100"
maxval="100"
bgcolor="LightSlateGrey">
<graph remote="/icubSim/head/state:o"
index="0"
color="Red"
title="Graph 0"
type="lines"
size="3" />
<graph remote="/icubSim/head/state:o"
index="1"
color="Green"
title="Graph 1"
size="3"
type="points" />
<graph remote="/icubSim/head/state:o"
index="2"
color="Blue"
title="Graph 2"
size="1"
type="bars" />
</plot>
<plot gridx="0"
gridy="1"
hspan="1"
vspan="2"
title="Plot 01"
minval="-100"
maxval="100"
bgcolor="LightGrey">
<graph remote="/icubSim/right_arm/state:o"
index="0"
color="Red"
title="Graph 0"
type="bars" />
<graph remote="/icubSim/right_arm/state:o"
index="1"
color="Green"
title="Graph 1"
type="lines" />
<graph remote="/icubSim/left_arm/state:o"
index="0"
color="Blue"
title="Graph 2"
type="points" />
<graph remote="/icubSim/left_arm/state:o"
index="1"
color="Magenta"
title="Graph 2"
type="points" />
</plot>
<plot gridx="1"
gridy="0"
hspan="2"
vspan="1"
title="Plot 10"
minval="-100"
maxval="100"
bgcolor="Yellow">
<graph remote="/icubSim/right_leg/state:o"
index="0"
color="Red"
title="Graph 0" />
<graph remote="/icubSim/right_leg/state:o"
index="1"
color="Green"
title="Graph 1" />
<graph remote="/icubSim/right_leg/state:o"
index="2"
color="Blue"
title="Graph 2" />
</plot>
<plot gridx="1"
gridy="1"
hspan="2"
vspan="2"
title="Plot 11"
minval="-100"
maxval="100"
bgcolor="Pink">
<graph remote="/icubSim/torso/state:o"
index="0"
color="Red"
title="Graph 0"
type="bars" />
<graph remote="/icubSim/torso/state:o"
index="1"
color="Green"
title="Graph 1"
type="lines" />
<graph remote="/icubSim/torso/state:o"
index="2"
color="Blue"
title="Graph 2"
type="points" />
</plot>
</portscope>

This xml will produce a GUI similar to this:

Details:

<portscope rows="3" columns="3" carrier="mcast">

Now declare a plot:

<plot gridx="0"
gridy="0"
hspan="1"
vspan="1"
title="Plot 00"
size="60"
minval="-100"
maxval="100"
bgcolor="LightSlateGrey">

In each plot you can have one or more graphs:

<graph remote="/icubSim/head/state:o"
index="0"
color="Red"
title="Graph 0"
type="lines"
size="3" />