RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
CameraOrbbecSDK.h
1/*
2Copyright (c) 2010-2025, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, are permitted provided that the following conditions are met:
7 * Redistributions of source code must retain the above copyright
8 notice, this list of conditions and the following disclaimer.
9 * Redistributions in binary form must reproduce the above copyright
10 notice, this list of conditions and the following disclaimer in the
11 documentation and/or other materials provided with the distribution.
12 * Neither the name of the Universite de Sherbrooke nor the
13 names of its contributors may be used to endorse or promote products
14 derived from this software without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*/
27
28#pragma once
29
30#include "rtabmap/core/CameraModel.h"
31#include "rtabmap/core/Camera.h"
32#include "rtabmap/core/Version.h"
33
34#ifdef RTABMAP_ORBBEC_SDK
35namespace ob
36{
37 class Pipeline;
38 class Align;
39}
40#endif
41
42namespace rtabmap
43{
44
45class RTABMAP_CORE_EXPORT CameraOrbbecSDK :
46 public Camera
47{
48public:
49 static bool available();
50
51public:
52 // deviceId can be either an index (e.g., "0"), an UID (e.g, "2-1-2" or "gmsl-1") or a serial ("AAA6454S")
54 std::string deviceId = "",
55 unsigned int colorWidth = 800,
56 unsigned int colorHeight = 600,
57 unsigned int depthWidth = 800,
58 unsigned int depthHeight = 600,
59 float imageRate = 0.0f,
60 const Transform & localTransform = Transform::getIdentity());
61 virtual ~CameraOrbbecSDK();
62
63 virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
64 virtual bool isCalibrated() const;
65 virtual std::string getSerial() const;
66
67 void close();
68
69 // Should be set before initializing
70 void enableColorRectification(bool enabled);
71 void enableImu(bool enabled);
72
73 void enableDepthMM(bool enabled);
74
75protected:
76 virtual SensorData captureImage(SensorCaptureInfo * info = 0);
77
78private:
79
80#ifdef RTABMAP_ORBBEC_SDK
81 std::string deviceId_;
82 unsigned int colorWidth_;
83 unsigned int colorHeight_;
84 unsigned int depthWidth_;
85 unsigned int depthHeight_;
86 ob::Pipeline * pipeline_;
87 ob::Pipeline * imuPipeline_;
88 ob::Align * alignFilter_;
89 CameraModel model_;
90 Transform imuLocalTransform_;
91 bool imuLocalTransformInitialized_;
92 uint64_t lastAccStamp_;
93 uint64_t lastImageStamp_;
94 bool globalTimestampAvailable_;
95 bool rectifyColor_;
96 bool convertDepthToMM_;
97 bool imuPublished_;
98 std::map<double, cv::Vec6f> imuBuffer_;
99 UMutex imuMutex_;
100#endif
101
102};
103
104
105} // namespace rtabmap
Represents a pinhole camera model containing intrinsic and extrinsic parameters, used for projection,...
Definition CameraModel.h:53
virtual bool init(const std::string &calibrationFolder=".", const std::string &cameraName="")
Initializes the sensor.
virtual std::string getSerial() const
Returns the sensor's serial number or unique identifier.
Metadata structure for sensor data capture and processing.
Container class for all sensor data captured at a specific time.
Definition SensorData.h:97
Represents a 3D rigid body transformation (rotation + translation).
Definition Transform.h:53