Skip to content

Commit 13a9751

Browse files
committed
自定义相机更新
1 parent 250e01f commit 13a9751

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

example/CustomCam/cus_cam.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,18 @@ void CustomCam::Stop() {
2424
void CustomCam::Receive(void *handle, const std::string &name) {
2525
Messenger &messenger = Messenger::GetInstance();
2626
while (is_running) {
27+
// 1. 初始化相机数据
2728
CamData cam_data;
29+
// 2. 读取相机同步时间戳
2830
if (params.find(name) != params.end()) {
2931
if (uint64_t time; GET_LAST_TRIGGER_STATUS(params[name], time)) {
3032
cam_data.time_stamp_us = time;
3133
}
3234
}
35+
// 3. 读取相机图像
36+
cam_data.name = name;
3337
cam_data.image = GMat();
38+
// 4. 发布相机数据
3439
messenger.PubStruct(name,&cam_data,sizeof(cam_data));
3540
std::this_thread::sleep_for(std::chrono::milliseconds{1});
3641
}

0 commit comments

Comments
 (0)