18 #ifndef _DS3D_DATALOADER_REALSENSE_CONFIG__H
19 #define _DS3D_DATALOADER_REALSENSE_CONFIG__H
21 #include <ds3d/common/common.h>
22 #include <ds3d/common/func_utils.h>
24 #include "ds3d/common/hpp/yaml_config.hpp"
26 namespace ds3d {
namespace impl {
namespace realsense {
52 parseConfig(
const std::string& content,
const std::string& path, Config& config)
56 "parse dataloader component content failed");
58 YAML::Node node = YAML::Load(config.compConfig.configBody);
59 auto streams = node[
"streams"];
60 auto framerate = node[
"framerate"];
61 auto alignedImage2Depth = node[
"aligned_image_to_depth"];
65 auto toString = [&]() {
67 for (
auto& i : kValidStreams) {
72 std::vector<std::string> strStreams = streams.as<std::vector<std::string>>();
73 for (
auto& each : strStreams) {
76 "stream must choose from " + toString());
77 config.streams.emplace(each);
81 uint32_t fr = framerate.as<uint32_t>();
82 config.framerate = fr;
84 if (alignedImage2Depth) {
85 config.alignImage2Depth = alignedImage2Depth.as<
bool>();
92 #endif // _DS3D_DATALOADER_REALSENSE_CONFIG__H