Open3D (C++ API)  0.17.0
Loading...
Searching...
No Matches
RGBDSensor.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 <string>
11
15
16namespace open3d {
17using io::RGBDSensorConfig;
18namespace t {
19namespace io {
20
23public:
26 virtual ~RGBDSensor() {}
27
44 virtual bool InitSensor(const RGBDSensorConfig &sensor_config,
45 size_t sensor_index = 0,
46 const std::string &filename = "") = 0;
47
50 virtual bool StartCapture(bool start_record = false) = 0;
51
53 virtual void PauseRecord() = 0;
54
57 virtual void ResumeRecord() = 0;
58
66 bool wait = true, bool align_depth_to_color = true) = 0;
67
69 virtual uint64_t GetTimestamp() const = 0;
70
72 virtual void StopCapture() = 0;
73
75 virtual const RGBDVideoMetadata &GetMetadata() const = 0;
76
78 virtual std::string GetFilename() const = 0;
79
81 virtual const std::string ToString() const {
82 return fmt::format(
83 "RGBD sensor {} (serial {}){}{}", GetMetadata().device_name_,
84 GetMetadata().serial_number_,
85 GetTimestamp() == 0 ? ""
86 : "\nCapturing video: timestamp (us) = " +
87 std::to_string(GetTimestamp()),
88 GetFilename().empty() ? ""
89 : "\nRecording to file " + GetFilename());
90 }
91};
92
93} // namespace io
94} // namespace t
95} // namespace open3d
Definition RGBDSensorConfig.h:15
RGBDImage A pair of color and depth images.
Definition RGBDImage.h:21
Interface class for control of RGBD cameras.
Definition RGBDSensor.h:22
virtual geometry::RGBDImage CaptureFrame(bool wait=true, bool align_depth_to_color=true)=0
virtual void StopCapture()=0
Stop capturing frames.
virtual void ResumeRecord()=0
virtual std::string GetFilename() const =0
Get filename being written.
virtual ~RGBDSensor()
Definition RGBDSensor.h:26
virtual bool InitSensor(const RGBDSensorConfig &sensor_config, size_t sensor_index=0, const std::string &filename="")=0
virtual void PauseRecord()=0
Pause recording to the file.
virtual uint64_t GetTimestamp() const =0
Get current timestamp (in us).
RGBDSensor()
Default constructor. Initialize with default settings.
Definition RGBDSensor.h:25
virtual const RGBDVideoMetadata & GetMetadata() const =0
Get const reference to the metadata of the RGBD video capture.
virtual const std::string ToString() const
Text Description.
Definition RGBDSensor.h:81
virtual bool StartCapture(bool start_record=false)=0
RGBD video metadata.
Definition RGBDVideoMetadata.h:26
Definition PinholeCameraIntrinsic.cpp:16