Skip to content

Commit 19249f1

Browse files
authored
Sync and demux docs update (#978)
* Fixing typos * Update message_group.rst
1 parent 1599e19 commit 19249f1

File tree

3 files changed

+48
-29
lines changed

3 files changed

+48
-29
lines changed

docs/source/components/messages/message_group.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
MessageGroup
22
============
33

4-
The MessageGroup message type is a versatile container used in DepthAI pipelines to group together a map of arbitrary DepthAI messages. It serves as the primary output of the :ref:`Sync` node, effectively synchronizing various input streams, and acts as the input to the :ref:`Demux` node for subsequent disaggregation and processing.
4+
The MessageGroup message type is a versatile container used in DepthAI pipelines to group together a map of arbitrary DepthAI messages. It serves as the primary output of the :ref:`Sync` node, effectively synchronizing various input streams, and acts as the input to the :ref:`MessageDemux` node for subsequent disaggregation and processing.
55

66
Creating MessageGroup
77
#####################

docs/source/components/nodes/demux.rst renamed to docs/source/components/nodes/message_demux.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Demux
2-
=====
1+
MessageDemux
2+
============
33

44

5-
The Demux (Demultiplexer) node is used to separate a `MessageGroup` into individual outputs. It currently serves as way to demultiplex the output of :ref:`Sync` node.
5+
The MessageDemux (Demultiplexer) node is used to separate a :ref:`MessageGroup` into individual outputs. It currently serves as way to demultiplex the output of :ref:`Sync` node.
66

77
How to Place It
88
###############
@@ -28,7 +28,7 @@ Inputs and Outputs
2828
┌───────────────────┐
2929
input │ │
3030
──────────────►│ │
31-
Demux │ output1
31+
MessageDemux │ output1
3232
│ ├───────────►
3333
│ │ output2
3434
│ ├───────────►
@@ -43,7 +43,7 @@ Inputs and Outputs
4343
Usage
4444
#####
4545

46-
The Demux node is particularly useful for handling different types of data coming from a single source.
46+
The MessageDemux node is particularly useful for handling different types of data coming from a single source.
4747
For example, when the :ref:`Sync` node is used to synchronize the outputs of multiple nodes, the output of the Sync node is a :ref:`MessageGroup` containing all the messages from the synchronized nodes. The Demux node can be used to separate the messages into individual streams.
4848

4949
.. tabs::

docs/source/components/nodes/sync_node.rst

Lines changed: 42 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,22 @@ Sync
22
====
33

44
The Sync node is used for synchronizing multiple input streams based on their timestamps. It outputs a grouped message containing synchronized frames from the input streams.
5-
The output message is a :ref:`MessageGroup` containing synchronized messages from all the input streams. These can be demultiplexed using the :ref:`Demux` node.
5+
The output message is a :ref:`MessageGroup` containing synchronized messages from all the input streams. These can be demultiplexed using the :ref:`MessageDemux` node.
66

7-
How to Use
8-
##########
7+
How to Place it
8+
###############
99

1010
.. tabs::
1111

1212
.. code-tab:: py
1313

1414
pipeline = dai.Pipeline()
15-
sync = pipeline.create(dai.node.MessageDemux)
16-
17-
# Configure threshold for timestamp alignment
18-
sync.setSyncThreshold(timedelta(milliseconds=50))
19-
20-
# Configure inputs to be synchronized
21-
sync.inputs["input1"]
22-
sync.inputs["input2"]
23-
24-
# ...
15+
sync = pipeline.create(dai.node.Sync)
2516

2617
.. code-tab:: c++
2718

2819
dai::Pipeline pipeline;
29-
auto sync = pipeline.create<dai::node::MessageDemux>();
30-
31-
// Configure threshold for timestamp alignment
32-
sync->setSyncThreshold(std::chrono::milliseconds(50));
33-
34-
// Configure inputs to be synchronized
35-
sync->inputs["input1"];
36-
sync->inputs["input2"];
37-
38-
// ...
20+
auto sync = pipeline.create<dai::node::Sync>();
3921

4022

4123
Inputs and Outputs
@@ -65,6 +47,43 @@ Message Synchronization
6547
The Sync node aligns incoming messages based on their timestamps. The synchronization criteria and behavior can be configured using the :code:`depthai.node.Sync.setSyncThreshold` and :code:`depthai.node.Sync.setSyncAttempts` method. More info in the :ref:`API Reference <reference>`.
6648

6749

50+
Usage
51+
#####
52+
53+
.. tabs::
54+
55+
.. code-tab:: py
56+
57+
pipeline = dai.Pipeline()
58+
sync = pipeline.create(dai.node.Sync)
59+
60+
# Configure threshold for timestamp alignment
61+
sync.setSyncThreshold(timedelta(milliseconds=50))
62+
63+
# Configure inputs to be synchronized
64+
camRgb.video.link(sync.inputs["input1"])
65+
stereo.depth.link(sync.inputs["input2"])
66+
67+
sync.output.link(xout.input)
68+
# ...
69+
70+
.. code-tab:: c++
71+
72+
dai::Pipeline pipeline;
73+
auto sync = pipeline.create<dai::node::Sync>();
74+
75+
// Configure threshold for timestamp alignment
76+
sync->setSyncThreshold(std::chrono::milliseconds(50));
77+
78+
// Configure inputs to be synchronized
79+
camRgb.video.link(sync->input["input1"]);
80+
stereo.depth.link(sync->input["input2"]);
81+
82+
sync->out.link(xout.input);
83+
// ...
84+
85+
86+
6887
Examples of Functionality
6988
##########################
7089

0 commit comments

Comments
 (0)