Skip to content

Commit 291ac64

Browse files
Merge pull request #19 from luxonis/temp-metadata
add temperature metadata on-demand
2 parents 5daf695 + e13d69f commit 291ac64

2 files changed

Lines changed: 18 additions & 11 deletions

File tree

host/core/pipeline/host_pipeline_config.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ bool HostPipelineConfig::initWithJSON(const json &json_obj)
4444
}
4545
}
4646

47-
// if 'meta_d2h' not specified - add it
48-
if (!hasStream("meta_d2h"))
49-
{
50-
streams.emplace_back("meta_d2h");
51-
}
5247

5348
// "depth"
5449
if (json_obj.contains("depth"))

host/py_module/py_bindings.cpp

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,13 +262,7 @@ bool init_device(
262262
}
263263
}
264264

265-
// device support listener
266-
g_device_support_listener = std::unique_ptr<DeviceSupportListener>(new DeviceSupportListener);
267265

268-
g_device_support_listener->observe(
269-
*g_xlink.get(),
270-
c_streams_myriad_to_pc.at("meta_d2h")
271-
);
272266

273267

274268
result = true;
@@ -424,6 +418,8 @@ std::shared_ptr<CNNHostPipeline> create_pipeline(
424418
json_config_obj["ai"]["calc_dist_to_bb"] = config.ai.calc_dist_to_bb;
425419

426420
bool add_disparity_post_processing_color = false;
421+
bool temp_measurement = false;
422+
427423
std::vector<std::string> pipeline_device_streams;
428424

429425
for (const auto &stream : config.streams)
@@ -437,6 +433,10 @@ std::shared_ptr<CNNHostPipeline> create_pipeline(
437433
}
438434
else
439435
{
436+
if (stream.name == "meta_d2h")
437+
{
438+
temp_measurement = true;
439+
}
440440
json obj = { {"name" ,stream.name} };
441441

442442
if (!stream.data_type.empty()) { obj["data_type"] = stream.data_type; };
@@ -658,6 +658,18 @@ std::shared_ptr<CNNHostPipeline> create_pipeline(
658658
break;
659659
}
660660
}
661+
662+
if(temp_measurement)
663+
{
664+
// device support listener
665+
g_device_support_listener = std::unique_ptr<DeviceSupportListener>(new DeviceSupportListener);
666+
667+
g_device_support_listener->observe(
668+
*g_xlink.get(),
669+
c_streams_myriad_to_pc.at("meta_d2h")
670+
);
671+
}
672+
661673
init_ok = true;
662674
std::cout << "depthai: INIT OK!\n";
663675
}

0 commit comments

Comments
 (0)