Go to the documentation of this file. 1 #include <catch2/catch_all.hpp>
2 #include <catch2/catch_test_macros.hpp>
11 auto buf1Ts = std::chrono::steady_clock::now() + std::chrono::milliseconds(100);
12 auto buf2Ts = std::chrono::steady_clock::now() + std::chrono::milliseconds(200);
13 std::vector<unsigned char> buf1Data = {1, 2, 3};
14 std::vector<unsigned char> buf2Data = {4, 5, 6};
17 buf.setTimestamp(buf1Ts);
18 buf.setData(buf1Data);
25 msgGrp.
add(
"img1", img);
55 xout->setStreamName(
"out");
58 camRgb->isp.link(sync->inputs[
"rgb"]);
59 left->out.link(sync->inputs[
"left"]);
60 right->
out.
link(sync->inputs[
"right"]);
65 bool hasTimedOut =
false;
66 auto msg = q->get(std::chrono::seconds(1), hasTimedOut);
67 REQUIRE(!hasTimedOut);
128 auto buf1Ts = std::chrono::steady_clock::now() + std::chrono::milliseconds(100);
129 auto buf2Ts = std::chrono::steady_clock::now() + std::chrono::milliseconds(150);
138 xin->out.link(xout->input);
150 img1.
setData({6, 7, 8, 9, 10});
155 msgGrp.
add(
"buf1", buf1);
156 msgGrp.
add(
"img1", img1);
164 REQUIRE(out->get<
dai::Buffer>(
"buf1")->
getData() == std::vector<unsigned char>{1, 2, 3, 4, 5});
165 REQUIRE(out->get<
dai::ImgFrame>(
"img1")->
getData() == std::vector<unsigned char>{6, 7, 8, 9, 10});
XLinkOut node. Sends messages over XLink.
Represents the pipeline, set of nodes and connections between them.
void setResolution(Properties::SensorResolution resolution)
Set sensor resolution.
TEST_CASE("Set and get messages")
MonoCamera node. For use with grayscale sensors.
std::vector< std::uint8_t > & getData() const
Get non-owning reference to internal buffer.
ImgFrame & setSize(unsigned int width, unsigned int height)
ColorCamera node. For use with color sensors.
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestamp() const
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestamp(CameraExposureOffset offset) const
Buffer & setTimestamp(std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > timestamp)
std::shared_ptr< DataOutputQueue > getOutputQueue(const std::string &name)
unsigned int getHeight() const
std::shared_ptr< N > create()
void setStreamName(const std::string &name)
void setBoardSocket(CameraBoardSocket boardSocket)
void setResolution(Properties::SensorResolution resolution)
Set sensor resolution.
Base message - buffer of binary data.
ImgFrame & setTimestamp(std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > timestamp)
std::shared_ptr< T > get(const std::string &name)
XLinkIn node. Receives messages over XLink.
std::shared_ptr< DataInputQueue > getInputQueue(const std::string &name)
void link(const Input &in)
void setStreamName(const std::string &name)
void setData(const std::vector< std::uint8_t > &data)
void setBoardSocket(CameraBoardSocket boardSocket)
const typedef std::vector< std::uint8_t > buf
unsigned int getWidth() const
void add(const std::string &name, const std::shared_ptr< ADatatype > &value)
depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:19