Trace lines
3 minute read
A trace line draws the path a point has taken: where the tool of a robot went, live, as it moves. The line follows a position from your application and can show a second value along the way, for example the speed, as colour or line width.
This line follows the tool pose of a robot, gets thicker and redder when the tool moves faster, and can be cleared or paused from two parameters:
"traceLine": {
"name": "toolPath",
"lineWidth": 1,
"numPoints": 1000,
"links": [
{ "axis": "position", "link": "root/ManipulatorControl/manipulatorToolPoseActual" },
{ "axis": "clear", "link": "root/UserParameters/GUI/tracelineClear" },
{ "axis": "pause", "link": "root/UserParameters/GUI/tracelinePause" },
{
"axis": "width", "link": "root/ManipulatorControl/autoMotionGenerator/cartVelocities",
"magnitude": { "start": 0, "length": 3 }, "gain": 100, "offset": 1
},
{
"axis": "color", "link": "root/ManipulatorControl/autoMotionGenerator/cartVelocities",
"magnitude": { "start": 0, "length": 3 }, "min": 0, "max": 0.15, "colorMap": "heat"
}
]
}
traceLine is one line, or a list of lines that are each drawn and controlled on their own: the tool paths of two robots, for example.
Line settings
| Field | What it does | Default |
|---|---|---|
name |
The name of the line in the scene. An entry in objects can address it by this name |
traceline |
color |
The colour of the line, as a CSS colour such as "#ff0000" or "rgb(100,0,100)", when there is no color link |
#283449, a dark blue-grey |
lineWidth |
The width in pixels. Browsers draw 1 pixel unless the line has a width link |
1 |
tolerance |
How far, in m along x, y or z, the point must move before a new point is added | 0.001 |
numPoints |
The most points the line keeps. The oldest points go first | 1000 |
links |
Where the points come from, and what changes the line |
For a line that is thicker than 1 pixel but does not change width, add a width link with a fixed "value": 1.
Links
A trace line link works like an object link, with these axes:
axis |
What it does |
|---|---|
x, y, z |
One coordinate of the point, in m |
position, pose |
x, y and z from three elements, starting at channel. The orientation of a pose is not used |
clear |
While the value is true, the line is empty. It starts again from the current position when the value is false |
pause |
While the value is true, no points are added. The line continues after the pause, with a gap |
width |
Multiplies lineWidth for each new segment: 1 draws lineWidth, 2 twice as thick |
color |
Colours each new segment by the value, on a colour scale from min to max |
Segments keep the width and colour they got when they were drawn, so the line shows the history: fast parts of the path stay red after the tool has slowed down.
Colour by value
A color link maps its value to a colour:
| Field | What it does | Default |
|---|---|---|
min |
The value at the low end of the scale. Lower values get the first colour | 0 |
max |
The value at the high end. Higher values get the last colour | 1 |
colorMap |
The scale: heat, viridis, inferno, grayscale, or a list of two or more CSS colours from low to high, such as ["#0000ff", "#ffffff", "#ff0000"] |
heat |
heat runs from dark blue through blue, cyan, green, yellow and red to dark red. viridis and inferno change brightness evenly, so they also read well for colour-blind viewers and in print. grayscale runs from black to white.
To colour by speed, link the velocities and use magnitude, so the line shows the length of the velocity vector, not one of its elements. See Vector lengths.