如何放 置
Python
Python
1pipeline = dai.Pipeline()
2sync = pipeline.create(dai.node.Sync)输入与输出
消息同步
depthai.node.Sync.setSyncThreshold 和 depthai.node.Sync.setSyncAttempts 方法进行配置。更多信息请参见 参考部分。同步逻辑

使用示例
Python
Python
1pipeline = dai.Pipeline()
2sync = pipeline.create(dai.node.Sync)
3
4# 配置时间戳对齐的阈值
5sync.setSyncThreshold(timedelta(milliseconds=50))
6
7# 配置需要同步的输入
8camRgb.video.link(sync.inputs["input1"])
9stereo.depth.link(sync.inputs["input2"])
10
11sync.out.link(xout.input)
12# ...功能示例
- Sync - 同步两个或多个数据流。
- 解复用同步的脚本输出 - 使用 Sync 节点同步来自 Script 节点的多个输出,然后使用 MessageDemux 进行解复用。
参考
class
dai::node::Sync
variable
InputMap inputs
A map of inputs
variable
Output out
Output message of type MessageGroup
function
void setSyncThreshold(std::chrono::nanoseconds syncThreshold)Set the maximal interval between messages in the group
Parameters
- syncThreshold: Maximal interval between messages in the group
function
void setSyncAttempts(int syncAttempts)Set the number of attempts to get the specified max interval between messages in the group
Parameters
- syncAttempts: Number of attempts to get the specified max interval between messages in the group:
- if syncAttempts = 0 then the node sends a message as soon at the group is filled
- if syncAttempts > 0 then the node will make syncAttemts attempts to synchronize before sending out a message
- if syncAttempts = -1 (default) then the node will only send a message if successfully synchronized
function
void setProcessor(ProcessorType type)Specify on which processor the node should run. RVC2 only.
Parameters
- type: Processor type - Leon CSS or Leon MSS
function
ProcessorType getProcessor()Get on which processor the node should run
Returns
Processor type - Leon CSS or Leon MSS
function
void setTimestampSource(TimestampSource source)Specify the timestamp source
function
TimestampSource getTimestampSource()Get the timestamp source
function
std::chrono::nanoseconds getSyncThreshold()Gets the maximal interval between messages in the group in milliseconds
function
int getSyncAttempts()Gets the number of sync attempts
function
void setRunOnHost(bool runOnHost)Specify whether to run on host or device By default, the node will run on device.
function
bool runOnHost()Check if the node is set to run on host
function
void run()inline function
DeviceNodeCRTP()inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)enum
SyncProperties::TimestampSource TimestampSource
需要帮助?
请前往 OAKChina 官网 获取技术支持或解答您的任何疑问。