RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
CameraStereoZed.h
1/*
2Copyright (c) 2010-2016, 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/StereoCameraModel.h"
31#include "rtabmap/core/camera/CameraVideo.h"
32#include "rtabmap/core/Version.h"
33
34namespace sl
35{
36class Camera;
37}
38
39namespace rtabmap
40{
41class ZedIMUThread;
42
43class RTABMAP_CORE_EXPORT CameraStereoZed :
44 public Camera
45{
46public:
47 static bool available();
48 static int sdkVersion();
49public:
51 int deviceId,
52 int resolution = -1, // -1 = AUTO, 0=HD4K 1=QHDPLUS 2=HD2K 3=HD1536 4=HD1080 5=HD1200 6=HD720 7=SVGA 8=VGA 9=XVGA 10=TXVGA
53 int quality = 1, // 0=NONE, 1=PERFORMANCE, 2=QUALITY, 3=ULTRA, 4=NEURAL_LIGHT, 5=NEURAL, 6=NEURAL_ULTRA
54 int sensingMode = 0,// 0=STANDARD, 1=FILL
55 int confidenceThr = 100,
56 bool computeOdometry = false,
57 float imageRate=0.0f,
58 const Transform & localTransform = Transform::getIdentity(),
59 bool selfCalibration = true,
60 bool odomForce3DoF = false,
61 int texturenessConfidenceThr = 90); // introduced with ZED SDK 3
63 const std::string & svoFilePath,
64 int quality = 1, // 0=NONE, 1=PERFORMANCE, 2=QUALITY, 3=ULTRA, 4=NEURAL_LIGHT, 5=NEURAL, 6=NEURAL_ULTRA
65 int sensingMode = 0,// 0=STANDARD, 1=FILL
66 int confidenceThr = 100,
67 bool computeOdometry = false,
68 float imageRate=0.0f,
69 const Transform & localTransform = Transform::getIdentity(),
70 bool selfCalibration = true,
71 bool odomForce3DoF = false,
72 int texturenessConfidenceThr = 90); // introduced with ZED SDK 3
73 virtual ~CameraStereoZed();
74
75 virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
76 virtual bool isCalibrated() const;
77 virtual std::string getSerial() const;
78 virtual bool odomProvided() const;
79 virtual bool getPose(double stamp, Transform & pose, cv::Mat & covariance, double maxWaitTime = 0.0);
80
81 void postInterIMUPublic(const IMU & imu, double stamp);
82 void setRightGrayScale(bool enabled = true);
83
91 static std::string getNeuralModelWarning(int quality);
92
93protected:
94 virtual SensorData captureImage(SensorCaptureInfo * info = 0);
95
96private:
97#ifdef RTABMAP_ZED
98 sl::Camera * zed_;
99 StereoCameraModel stereoModel_;
100 Transform imuLocalTransform_;
101 CameraVideo::Source src_;
102 int usbDevice_;
103 std::string svoFilePath_;
104 int resolution_;
105 int quality_;
106 bool selfCalibration_;
107 int sensingMode_;
108 int confidenceThr_;
109 int texturenessConfidenceThr_; // introduced with ZED SDK 3
110 bool computeOdometry_;
111 bool lost_;
112 bool force3DoF_;
113 bool rightGrayScale_;
114 ZedIMUThread * imuPublishingThread_;
115#endif
116};
117
118
119} // namespace rtabmap
virtual bool getPose(double stamp, Transform &pose, cv::Mat &covariance, double maxWaitTime=0.0)
Gets the sensor's pose estimate at a specific timestamp.
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.
static std::string getNeuralModelWarning(int quality)
virtual bool odomProvided() const
Checks if the sensor provides odometry poses.
Inertial measurement sample (ROS sensor_msgs/Imu-like fields).
Definition IMU.h:57
Metadata structure for sensor data capture and processing.
Container class for all sensor data captured at a specific time.
Definition SensorData.h:97
A class representing a calibrated stereo camera system.
Represents a 3D rigid body transformation (rotation + translation).
Definition Transform.h:53