We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 250e01f commit 13a9751Copy full SHA for 13a9751
1 file changed
example/CustomCam/cus_cam.cpp
@@ -24,13 +24,18 @@ void CustomCam::Stop() {
24
void CustomCam::Receive(void *handle, const std::string &name) {
25
Messenger &messenger = Messenger::GetInstance();
26
while (is_running) {
27
+ // 1. 初始化相机数据
28
CamData cam_data;
29
+ // 2. 读取相机同步时间戳
30
if (params.find(name) != params.end()) {
31
if (uint64_t time; GET_LAST_TRIGGER_STATUS(params[name], time)) {
32
cam_data.time_stamp_us = time;
33
}
34
35
+ // 3. 读取相机图像
36
+ cam_data.name = name;
37
cam_data.image = GMat();
38
+ // 4. 发布相机数据
39
messenger.PubStruct(name,&cam_data,sizeof(cam_data));
40
std::this_thread::sleep_for(std::chrono::milliseconds{1});
41
0 commit comments