Open3D (C++ API)  0.16.1
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-2021 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
40namespace rs2 {
41class config;
42class pipeline_profile;
43} // namespace rs2
44
45namespace open3d {
46using io::RGBDSensorConfig;
47namespace t {
48namespace io {
49
82public:
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
102public:
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;
122 std::unordered_map<std::string, std::set<std::string>> valid_configs;
123};
124
125} // namespace io
126} // namespace t
127} // namespace open3d
Open3DScene::LightingProfile profile
Definition: O3DVisualizer.cpp:288
Definition: RGBDSensorConfig.h:34
RGBD video metadata.
Definition: RGBDVideoMetadata.h:45
Definition: RealSenseSensorConfig.h:81
static Json::Value GetMetadataJson(const rs2::pipeline_profile &profile)
Get metadata for a streaming RealSense camera or bag file.
Definition: RealSenseSensorConfig.cpp:243
RealSenseSensorConfig()
Default constructor, default configs will be used.
Definition: RealSenseSensorConfig.cpp:162
bool ConvertFromJsonValue(const Json::Value &value) override
Definition: RealSenseSensorConfig.cpp:179
static std::pair< core::Dtype, uint8_t > get_dtype_channels(int rs2_format_enum)
Definition: RealSenseSensorConfig.cpp:136
std::unordered_map< std::string, std::string > config_
Definition: RealSenseSensorConfig.h:111
static void GetPixelDtypes(const rs2::pipeline_profile &profile, RGBDVideoMetadata &metadata)
Definition: RealSenseSensorConfig.cpp:223
rs2::config ConvertToNativeConfig() const
Convert to RealSense config.
Definition: RealSenseSensorConfig.cpp:186
bool ConvertToJsonValue(Json::Value &value) const override
Definition: RealSenseSensorConfig.cpp:172
Definition: PinholeCameraIntrinsic.cpp:35
Definition: RealSenseSensor.h:36
Definition: RealSenseSensorConfig.h:117
std::unordered_map< std::string, std::set< std::string > > valid_configs
Definition: RealSenseSensorConfig.h:122
std::string name
Definition: RealSenseSensorConfig.h:119
std::string serial
Device serial number.
Definition: RealSenseSensorConfig.h:118