Open3D (C++ API)  0.17.0+e892d5b
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 
16 namespace open3d {
17 using io::RGBDSensorConfig;
18 namespace t {
19 namespace io {
20 
22 class RGBDSensor {
23 public:
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
filament::Texture::InternalFormat format
Definition: FilamentResourceManager.cpp:195
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 std::string ToString() const
Text Description.
Definition: RGBDSensor.h:81
virtual const RGBDVideoMetadata & GetMetadata() const =0
Get const reference to the metadata of the RGBD video capture.
virtual bool StartCapture(bool start_record=false)=0
RGBD video metadata.
Definition: RGBDVideoMetadata.h:26
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample uint64_t
Definition: K4aPlugin.cpp:343
Definition: PinholeCameraIntrinsic.cpp:16