Skip to content

Commit c070ba2

Browse files
committed
Add trajectory_point_interface documentation
1 parent 5759fca commit c070ba2

File tree

4 files changed

+135
-3
lines changed

4 files changed

+135
-3
lines changed

doc/architecture/reverse_interface.rst

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,29 @@ meaning:
4141
index meaning
4242
===== =====
4343
0 read timeout in milliseconds. The next read from the socket will use this timeout.
44-
1-6 Current motion target. depending on the control mode, this can be interpreted as joint
45-
positions or velocities or a Cartesian pose.
44+
1-6 Current motion target. depending on the control mode, this can be interpreted as
45+
46+
- joint positions (SERVOJ)
47+
- joint velocities (SPEEDL)
48+
- trajectory instructions (FORWARD)
49+
50+
- field 1: Trajectory control mode(1: TRAJECTORY_MODE_RECEIVE, -1: TRAJECTORY_MODE_CANCEL)
51+
- field 2: Number of trajectory points left to transfer
52+
53+
- Cartesian velocities (SPEEDL)
54+
- Cartesian pose (POSE)
55+
- freedrive instruction (FREEDRIVE)
56+
57+
- field 1: Freedrive mode (1: FREEDRIVE_MODE_START, -1: FREEDRIVE_MODE_STOP)
58+
4659
7 Control mode. Can be either of
60+
4761
- -2: STOPPED
4862
- -1: UNINITIALIZED
4963
- 0: IDLE -- no motion
5064
- 1: SERVOJ -- High-frequent joint position control
5165
- 2: SPEEDJ -- Low-frequent joint velocity control
52-
- 3: FORWARD -- Trajectory interpolation on the robot
66+
- 3: FORWARD -- Trajectory interpolation on the robot, see :ref:`trajectory_point_interface`
5367
- 4: SPEEDL
5468
- 5: POSE
5569
- 6: FREEDRIVE
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.. _trajectory_point_interface:
2+
3+
Trajectory Point Interface
4+
==========================
5+
6+
The ``TrajectoryPointInterface`` allows sending trajectory points to the robot. It is intended to
7+
be used in conjunction with the :ref:`reverse_interface` during trajectory forwarding.
8+
9+
Communication regarding trajectory point execution would usually look like this:
10+
11+
.. figure:: /images/trajectory_interface.svg
12+
:width: 100%
13+
:alt: Trajectory interface
14+
15+
Basically, the ``TrajectoryPointInterface`` transfers the trajectory points from the external
16+
control PC to the robot for execution. Execution isn't started, before a start command is sent via
17+
the ``ReverseInterface``. Once trajectory execution is done (either successful, failed or canceled
18+
externally), the robot will send a response back to the control PC via the trajectory socket.
19+
20+
21+
Communication protocol
22+
----------------------
23+
24+
The ``TrajectoryPointInterface``'s "trajectory_socket" on the robot is expecting 32 bit integer
25+
representations in 21 datafields. The data fields have the following meaning:
26+
27+
.. table:: trajectory_socket message format
28+
:widths: auto
29+
30+
===== =====
31+
index meaning
32+
===== =====
33+
0-5 trajectory point positions (floating point)
34+
6-11 trajectory point velocities (floating point)
35+
12-17 trajectory point accelerations (floating point)
36+
18 trajectory point type (0: JOINT, 1: CARTESIAN, 2: JOINT_SPLINE)
37+
19 trajectory point time (in seconds, floating point)
38+
20 depending on trajectory point type
39+
40+
- JOINT, CARTESIAN: point blend radius (in meters, floating point)
41+
- JOINT_SPLINE: spline type (1: CUBIC, 2: QUINTIC)
42+
===== =====
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<mxfile host="Electron" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/25.0.2 Chrome/128.0.6613.186 Electron/32.2.5 Safari/537.36" version="25.0.2">
2+
<diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">
3+
<mxGraphModel dx="1649" dy="793" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
4+
<root>
5+
<mxCell id="WIyWlLk6GJQsqaUBKTNV-0" />
6+
<mxCell id="WIyWlLk6GJQsqaUBKTNV-1" parent="WIyWlLk6GJQsqaUBKTNV-0" />
7+
<mxCell id="WIyWlLk6GJQsqaUBKTNV-2" value="" style="rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;edgeStyle=orthogonalEdgeStyle;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-3" target="WIyWlLk6GJQsqaUBKTNV-6" edge="1">
8+
<mxGeometry relative="1" as="geometry" />
9+
</mxCell>
10+
<mxCell id="WIyWlLk6GJQsqaUBKTNV-3" value="writeTrajectoryControlMessage(TRAJECTORY_START, number_of_points&lt;span style=&quot;background-color: initial;&quot;&gt;)&lt;/span&gt;" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
11+
<mxGeometry x="55" y="50" width="330" height="50" as="geometry" />
12+
</mxCell>
13+
<mxCell id="WIyWlLk6GJQsqaUBKTNV-4" value="Yes" style="rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;edgeStyle=orthogonalEdgeStyle;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-6" target="0kFuc1mFAYY3ESqruEvN-4" edge="1">
14+
<mxGeometry y="20" relative="1" as="geometry">
15+
<mxPoint as="offset" />
16+
<mxPoint x="220" y="310" as="targetPoint" />
17+
</mxGeometry>
18+
</mxCell>
19+
<mxCell id="0kFuc1mFAYY3ESqruEvN-3" value="No" style="edgeStyle=orthogonalEdgeStyle;shape=connector;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;shadow=0;strokeColor=default;strokeWidth=1;align=center;verticalAlign=middle;fontFamily=Helvetica;fontSize=11;fontColor=default;labelBackgroundColor=none;endArrow=block;endFill=0;endSize=8;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-6" target="0kFuc1mFAYY3ESqruEvN-0">
20+
<mxGeometry x="0.0411" y="10" relative="1" as="geometry">
21+
<mxPoint as="offset" />
22+
</mxGeometry>
23+
</mxCell>
24+
<mxCell id="WIyWlLk6GJQsqaUBKTNV-6" value="All points transferred?" style="rhombus;whiteSpace=wrap;html=1;shadow=0;fontFamily=Helvetica;fontSize=12;align=center;strokeWidth=1;spacing=6;spacingTop=-4;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
25+
<mxGeometry x="170" y="170" width="100" height="80" as="geometry" />
26+
</mxCell>
27+
<mxCell id="0kFuc1mFAYY3ESqruEvN-2" style="edgeStyle=orthogonalEdgeStyle;shape=connector;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shadow=0;strokeColor=default;strokeWidth=1;align=center;verticalAlign=middle;fontFamily=Helvetica;fontSize=11;fontColor=default;labelBackgroundColor=none;endArrow=block;endFill=0;endSize=8;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="0kFuc1mFAYY3ESqruEvN-0" target="WIyWlLk6GJQsqaUBKTNV-6">
28+
<mxGeometry relative="1" as="geometry" />
29+
</mxCell>
30+
<mxCell id="0kFuc1mFAYY3ESqruEvN-0" value="writeTrajectoryPoint() /&lt;div&gt;writeTrajectorySplinePoint()&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
31+
<mxGeometry x="500" y="90" width="160" height="50" as="geometry" />
32+
</mxCell>
33+
<mxCell id="0kFuc1mFAYY3ESqruEvN-12" style="edgeStyle=orthogonalEdgeStyle;shape=connector;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shadow=0;strokeColor=default;strokeWidth=1;align=center;verticalAlign=middle;fontFamily=Helvetica;fontSize=11;fontColor=default;labelBackgroundColor=none;endArrow=block;endFill=0;endSize=8;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="0kFuc1mFAYY3ESqruEvN-4" target="0kFuc1mFAYY3ESqruEvN-11">
34+
<mxGeometry relative="1" as="geometry" />
35+
</mxCell>
36+
<mxCell id="0kFuc1mFAYY3ESqruEvN-4" value="writeTrajectoryControlMessage(TRAJECTORY_NOOP)" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
37+
<mxGeometry x="55" y="300" width="330" height="50" as="geometry" />
38+
</mxCell>
39+
<mxCell id="0kFuc1mFAYY3ESqruEvN-15" style="edgeStyle=orthogonalEdgeStyle;shape=connector;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shadow=0;strokeColor=default;strokeWidth=1;align=center;verticalAlign=middle;fontFamily=Helvetica;fontSize=11;fontColor=default;labelBackgroundColor=none;endArrow=block;endFill=0;endSize=8;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="0kFuc1mFAYY3ESqruEvN-6" target="0kFuc1mFAYY3ESqruEvN-7">
40+
<mxGeometry relative="1" as="geometry" />
41+
</mxCell>
42+
<mxCell id="0kFuc1mFAYY3ESqruEvN-6" value="Trajectory executing on robot" style="rounded=0;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=12;fontColor=default;labelBackgroundColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
43+
<mxGeometry x="805" y="280" width="120" height="225" as="geometry" />
44+
</mxCell>
45+
<mxCell id="0kFuc1mFAYY3ESqruEvN-7" value="send trajectory result" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
46+
<mxGeometry x="700" y="535" width="330" height="50" as="geometry" />
47+
</mxCell>
48+
<mxCell id="0kFuc1mFAYY3ESqruEvN-8" value="" style="endArrow=none;html=1;rounded=0;shadow=0;strokeColor=default;strokeWidth=1;align=center;verticalAlign=middle;fontFamily=Helvetica;fontSize=11;fontColor=default;labelBackgroundColor=none;edgeStyle=orthogonalEdgeStyle;endSize=8;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
49+
<mxGeometry width="50" height="50" relative="1" as="geometry">
50+
<mxPoint x="680" y="590" as="sourcePoint" />
51+
<mxPoint x="680" as="targetPoint" />
52+
</mxGeometry>
53+
</mxCell>
54+
<mxCell id="0kFuc1mFAYY3ESqruEvN-9" value="External Control PC" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontFamily=Helvetica;fontSize=20;fontColor=default;labelBackgroundColor=none;fontStyle=1" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
55+
<mxGeometry x="100" width="250" height="30" as="geometry" />
56+
</mxCell>
57+
<mxCell id="0kFuc1mFAYY3ESqruEvN-10" value="Robot" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontFamily=Helvetica;fontSize=20;fontColor=default;labelBackgroundColor=none;fontStyle=1" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
58+
<mxGeometry x="740" width="250" height="30" as="geometry" />
59+
</mxCell>
60+
<mxCell id="0kFuc1mFAYY3ESqruEvN-14" style="edgeStyle=orthogonalEdgeStyle;shape=connector;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shadow=0;strokeColor=default;strokeWidth=1;align=center;verticalAlign=middle;fontFamily=Helvetica;fontSize=11;fontColor=default;labelBackgroundColor=none;endArrow=block;endFill=0;endSize=8;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="0kFuc1mFAYY3ESqruEvN-11" target="0kFuc1mFAYY3ESqruEvN-13">
61+
<mxGeometry relative="1" as="geometry" />
62+
</mxCell>
63+
<mxCell id="0kFuc1mFAYY3ESqruEvN-11" value="Cancel requested?" style="rhombus;whiteSpace=wrap;html=1;shadow=0;fontFamily=Helvetica;fontSize=12;align=center;strokeWidth=1;spacing=6;spacingTop=-4;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
64+
<mxGeometry x="170" y="400" width="100" height="80" as="geometry" />
65+
</mxCell>
66+
<mxCell id="0kFuc1mFAYY3ESqruEvN-13" value="writeTrajectoryControlMessage(TRAJECTORY_CANCEL)" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
67+
<mxGeometry x="55" y="534.5" width="330" height="50" as="geometry" />
68+
</mxCell>
69+
</root>
70+
</mxGraphModel>
71+
</diagram>
72+
</mxfile>

doc/images/trajectory_interface.svg

Lines changed: 4 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)