Open3D (C++ API)  0.12.0
RealSenseSensorConfig.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // The MIT License (MIT)
5 //
6 // Copyright (c) 2018 www.open3d.org
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to deal
10 // in the Software without restriction, including without limitation the rights
11 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 // copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // The above copyright notice and this permission notice shall be included in
16 // all copies or substantial portions of the Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 // IN THE SOFTWARE.
25 // ----------------------------------------------------------------------------
26 
27 #pragma once
28 
29 #include <set>
30 #include <string>
31 #include <unordered_map>
32 #include <utility>
33 
34 #include "open3d/core/Dtype.h"
38 
39 // Forward declarations
40 namespace rs2 {
41 class config;
42 class pipeline_profile;
43 } // namespace rs2
44 
45 namespace open3d {
46 using io::RGBDSensorConfig;
47 namespace t {
48 namespace io {
49 
82 public:
87  const std::unordered_map<std::string, std::string> &config);
88  bool ConvertToJsonValue(Json::Value &value) const override;
89  bool ConvertFromJsonValue(const Json::Value &value) override;
90 
92  rs2::config ConvertToNativeConfig() const;
93 
95  static Json::Value GetMetadataJson(const rs2::pipeline_profile &profile);
96 
99  static void GetPixelDtypes(const rs2::pipeline_profile &profile,
100  RGBDVideoMetadata &metadata);
101 
102 public:
106  static std::pair<core::Dtype, uint8_t> get_dtype_channels(
107  int rs2_format_enum);
108 
109  // To avoid including RealSense or json header, config is stored in a
110  // map
111  std::unordered_map<std::string, std::string> config_;
112 };
113 
118  std::string serial;
119  std::string name;
120  std::unordered_map<std::string, std::set<std::string>> valid_configs;
123 };
124 
125 } // namespace io
126 } // namespace t
127 } // namespace open3d
Definition: RealSenseSensorConfig.h:117
Definition: RealSenseSensor.h:36
std::unordered_map< std::string, std::string > config_
Definition: RealSenseSensorConfig.h:111
RGBD video metadata.
Definition: RGBDVideoMetadata.h:45
Definition: RealSenseSensorConfig.h:81
Definition: PinholeCameraIntrinsic.cpp:35
std::string serial
Device serial number.
Definition: RealSenseSensorConfig.h:118
std::string name
Definition: RealSenseSensorConfig.h:119
Open3DScene::LightingProfile profile
Definition: O3DVisualizer.cpp:278
Definition: RGBDSensorConfig.h:34