ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
AzureKinectSensor.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <memory>
11 
12 #include "io/sensor/RGBDSensor.h"
14 
15 struct _k4a_capture_t; // typedef _k4a_capture_t* k4a_capture_t;
16 struct _k4a_device_t; // typedef _k4a_device_t* k4a_device_t;
17 struct _k4a_transformation_t; // typedef _k4a_transformation_t*
18  // k4a_transformation_t;
19 
20 namespace cloudViewer {
21 namespace geometry {
22 class RGBDImage;
23 class Image;
24 } // namespace geometry
25 
26 namespace io {
27 
28 // Avoid including AzureKinectRecorder.h
29 class AzureKinectRecorder;
30 
34 class AzureKinectSensor : public RGBDSensor {
35 public:
37  AzureKinectSensor(const AzureKinectSensorConfig& sensor_config);
39 
40  bool Connect(size_t sensor_index) override;
41  void Disconnect();
42  std::shared_ptr<geometry::RGBDImage> CaptureFrame(
43  bool enable_align_depth_to_color) const override;
44 
45  static bool PrintFirmware(_k4a_device_t* device);
47  static bool ListDevices();
48  static std::shared_ptr<geometry::RGBDImage> DecompressCapture(
49  _k4a_capture_t* capture, _k4a_transformation_t* transformation);
50 
51 protected:
52  _k4a_capture_t* CaptureRawFrame() const;
53 
55  _k4a_transformation_t* transform_depth_to_color_;
56  _k4a_device_t* device_;
57  int timeout_;
58 
59  friend class AzureKinectRecorder;
60 };
61 
62 } // namespace io
63 } // namespace cloudViewer
static bool PrintFirmware(_k4a_device_t *device)
AzureKinectSensorConfig sensor_config_
static bool ListDevices()
List available Azure Kinect devices.
bool Connect(size_t sensor_index) override
std::shared_ptr< geometry::RGBDImage > CaptureFrame(bool enable_align_depth_to_color) const override
AzureKinectSensor(const AzureKinectSensorConfig &sensor_config)
Default Constructor.
static std::shared_ptr< geometry::RGBDImage > DecompressCapture(_k4a_capture_t *capture, _k4a_transformation_t *transformation)
_k4a_capture_t * CaptureRawFrame() const
_k4a_transformation_t * transform_depth_to_color_
Generic file read and write utility for python interface.