Open3D (C++ API)  0.17.0
RealSenseSensorConfig.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <set>
11 #include <string>
12 #include <unordered_map>
13 #include <utility>
14 
15 #include "open3d/core/Dtype.h"
19 
20 // Forward declarations
21 namespace rs2 {
22 class config;
23 class pipeline_profile;
24 } // namespace rs2
25 
26 namespace open3d {
27 using io::RGBDSensorConfig;
28 namespace t {
29 namespace io {
30 
63 public:
68  const std::unordered_map<std::string, std::string> &config);
69  bool ConvertToJsonValue(Json::Value &value) const override;
70  bool ConvertFromJsonValue(const Json::Value &value) override;
71 
73  rs2::config ConvertToNativeConfig() const;
74 
76  static Json::Value GetMetadataJson(const rs2::pipeline_profile &profile);
77 
80  static void GetPixelDtypes(const rs2::pipeline_profile &profile,
81  RGBDVideoMetadata &metadata);
82 
83 public:
87  static std::pair<core::Dtype, uint8_t> get_dtype_channels(
88  int rs2_format_enum);
89 
90  // To avoid including RealSense or json header, config is stored in a
91  // map
92  std::unordered_map<std::string, std::string> config_;
93 };
94 
99  std::string serial;
100  std::string name;
103  std::unordered_map<std::string, std::set<std::string>> valid_configs;
104 };
105 
106 } // namespace io
107 } // namespace t
108 } // namespace open3d
Open3DScene::LightingProfile profile
Definition: O3DVisualizer.cpp:269
Definition: RGBDSensorConfig.h:15
RGBD video metadata.
Definition: RGBDVideoMetadata.h:26
Definition: RealSenseSensorConfig.h:62
static Json::Value GetMetadataJson(const rs2::pipeline_profile &profile)
Get metadata for a streaming RealSense camera or bag file.
Definition: RealSenseSensorConfig.cpp:224
RealSenseSensorConfig()
Default constructor, default configs will be used.
Definition: RealSenseSensorConfig.cpp:143
bool ConvertFromJsonValue(const Json::Value &value) override
Definition: RealSenseSensorConfig.cpp:160
static std::pair< core::Dtype, uint8_t > get_dtype_channels(int rs2_format_enum)
Definition: RealSenseSensorConfig.cpp:117
std::unordered_map< std::string, std::string > config_
Definition: RealSenseSensorConfig.h:92
static void GetPixelDtypes(const rs2::pipeline_profile &profile, RGBDVideoMetadata &metadata)
Definition: RealSenseSensorConfig.cpp:204
rs2::config ConvertToNativeConfig() const
Convert to RealSense config.
Definition: RealSenseSensorConfig.cpp:167
bool ConvertToJsonValue(Json::Value &value) const override
Definition: RealSenseSensorConfig.cpp:153
Definition: PinholeCameraIntrinsic.cpp:16
Definition: RealSenseSensor.h:17
Definition: RealSenseSensorConfig.h:98
std::unordered_map< std::string, std::set< std::string > > valid_configs
Definition: RealSenseSensorConfig.h:103
std::string name
Definition: RealSenseSensorConfig.h:100
std::string serial
Device serial number.
Definition: RealSenseSensorConfig.h:99