此页面由 AI 自动翻译。查看英文原版
最后更新

本页目录

  • 创建 MessageGroup
  • 参考
Claude CodeCodexCursor
Luxonis 智能体工具包为你常用的编程智能体加载 Luxonis 上下文与技能,更快地基于 OAK 开发应用。
安装工具包

MessageGroup

最后更新
MessageGroup 消息类型是 DepthAI 管道中使用的多功能容器,用于将任意 DepthAI 消息映射分组在一起。它作为 Sync 节点的主要输出,可根据时间戳有效同步各种输入流,并作为 MessageDemux 节点的输入,用于后续的分解和处理。

创建 MessageGroup

MessageGroup 可以由 Sync 节点根据不同来源的消息时间戳自动创建和分组。或者,它也可以在主机应用程序中或在 Script 节点中手动构建,以创建 DepthAI 消息的自定义分组。

参考

class

dai::MessageGroup

#include MessageGroup.hpp
variable
std::map< std::string, std::shared_ptr< ADatatype > > group
function
~MessageGroup()
function
std::shared_ptr< ADatatype > operator[](const std::string & name)
Group.
inline function
std::shared_ptr< T > get(const std::string & name)
inline function
std::shared_ptr< ADatatype > get(const std::string & name)
function
void add(const std::string & name, const std::shared_ptr< ADatatype > & value)
function
std::map< std::string, std::shared_ptr< ADatatype > >::iterator begin()
function
std::map< std::string, std::shared_ptr< ADatatype > >::iterator end()
function
bool isSynced(int64_t thresholdNs)
True if all messages in the group are in the interval
Parameters
  • thresholdNs: Maximal interval between messages
function
int64_t getIntervalNs()
Retrieves interval between the first and the last message in the group, measured with the timestamp source that produced the group.
inline function
SyncProperties::TimestampSource getTimestampSource()
Get the timestamp source this group was synced with.
inline function
void setTimestampSource(SyncProperties::TimestampSource source)
Set the timestamp source this group was synced with. Used by the host Sync node; groups received from a device keep the DEVICE default.
function
int64_t getNumMessages()
function
std::vector< std::string > getMessageNames()
Gets the names of messages in the group
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(MessageGroup, group, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, Buffer::sequenceNum)

需要帮助?

请访问讨论论坛以获取技术支持或您可能有的任何其他问题。