Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #pragma once
00029
00030 #include "rtabmap/core/RtabmapExp.h"
00031
00032 #include "rtabmap/core/CameraModel.h"
00033 #include "rtabmap/core/Camera.h"
00034 #include "rtabmap/core/CameraRGB.h"
00035 #include "rtabmap/core/Version.h"
00036 #include <list>
00037
00038 namespace FlyCapture2
00039 {
00040 class Camera;
00041 }
00042
00043 namespace sl
00044 {
00045 class Camera;
00046 }
00047
00048 namespace rtabmap
00049 {
00050
00052
00054 class DC1394Device;
00055
00056 class RTABMAP_EXP CameraStereoDC1394 :
00057 public Camera
00058 {
00059 public:
00060 static bool available();
00061
00062 public:
00063 CameraStereoDC1394( float imageRate=0.0f, const Transform & localTransform = Transform::getIdentity());
00064 virtual ~CameraStereoDC1394();
00065
00066 virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
00067 virtual bool isCalibrated() const;
00068 virtual std::string getSerial() const;
00069
00070 protected:
00071 virtual SensorData captureImage(CameraInfo * info = 0);
00072
00073 private:
00074 #ifdef RTABMAP_DC1394
00075 DC1394Device *device_;
00076 StereoCameraModel stereoModel_;
00077 #endif
00078 };
00079
00081
00083 class RTABMAP_EXP CameraStereoFlyCapture2 :
00084 public Camera
00085 {
00086 public:
00087 static bool available();
00088
00089 public:
00090 CameraStereoFlyCapture2( float imageRate=0.0f, const Transform & localTransform = Transform::getIdentity());
00091 virtual ~CameraStereoFlyCapture2();
00092
00093 virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
00094 virtual bool isCalibrated() const;
00095 virtual std::string getSerial() const;
00096
00097 protected:
00098 virtual SensorData captureImage(CameraInfo * info = 0);
00099
00100 private:
00101 #ifdef RTABMAP_FLYCAPTURE2
00102 FlyCapture2::Camera * camera_;
00103 void * triclopsCtx_;
00104 #endif
00105 };
00106
00108
00110 class RTABMAP_EXP CameraStereoZed :
00111 public Camera
00112 {
00113 public:
00114 static bool available();
00115
00116 public:
00117 CameraStereoZed(
00118 int deviceId,
00119 int resolution = 2,
00120 int quality = 1,
00121 int sensingMode = 0,
00122 int confidenceThr = 100,
00123 bool computeOdometry = false,
00124 float imageRate=0.0f,
00125 const Transform & localTransform = Transform::getIdentity(),
00126 bool selfCalibration = true);
00127 CameraStereoZed(
00128 const std::string & svoFilePath,
00129 int quality = 1,
00130 int sensingMode = 0,
00131 int confidenceThr = 100,
00132 bool computeOdometry = false,
00133 float imageRate=0.0f,
00134 const Transform & localTransform = Transform::getIdentity(),
00135 bool selfCalibration = true);
00136 virtual ~CameraStereoZed();
00137
00138 virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
00139 virtual bool isCalibrated() const;
00140 virtual std::string getSerial() const;
00141 virtual bool odomProvided() const;
00142
00143 protected:
00144 virtual SensorData captureImage(CameraInfo * info = 0);
00145
00146 private:
00147 #ifdef RTABMAP_ZED
00148 sl::Camera * zed_;
00149 StereoCameraModel stereoModel_;
00150 CameraVideo::Source src_;
00151 int usbDevice_;
00152 std::string svoFilePath_;
00153 int resolution_;
00154 int quality_;
00155 bool selfCalibration_;
00156 int sensingMode_;
00157 int confidenceThr_;
00158 bool computeOdometry_;
00159 bool lost_;
00160 #endif
00161 };
00162
00164
00166 class CameraImages;
00167 class RTABMAP_EXP CameraStereoImages :
00168 public CameraImages
00169 {
00170 public:
00171 static bool available();
00172
00173 public:
00174 CameraStereoImages(
00175 const std::string & pathLeftImages,
00176 const std::string & pathRightImages,
00177 bool rectifyImages = false,
00178 float imageRate=0.0f,
00179 const Transform & localTransform = Transform::getIdentity());
00180 CameraStereoImages(
00181 const std::string & pathLeftRightImages,
00182 bool rectifyImages = false,
00183 float imageRate=0.0f,
00184 const Transform & localTransform = Transform::getIdentity());
00185 virtual ~CameraStereoImages();
00186
00187 virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
00188 virtual bool isCalibrated() const;
00189 virtual std::string getSerial() const;
00190
00191 virtual void setStartIndex(int index) {CameraImages::setStartIndex(index);camera2_->setStartIndex(index);}
00192
00193 protected:
00194 virtual SensorData captureImage(CameraInfo * info = 0);
00195
00196 private:
00197 CameraImages * camera2_;
00198 StereoCameraModel stereoModel_;
00199 };
00200
00201
00203
00205 class CameraImages;
00206 class RTABMAP_EXP CameraStereoVideo :
00207 public Camera
00208 {
00209 public:
00210 static bool available();
00211
00212 public:
00213 CameraStereoVideo(
00214 const std::string & pathSideBySide,
00215 bool rectifyImages = false,
00216 float imageRate=0.0f,
00217 const Transform & localTransform = Transform::getIdentity());
00218 CameraStereoVideo(
00219 const std::string & pathLeft,
00220 const std::string & pathRight,
00221 bool rectifyImages = false,
00222 float imageRate=0.0f,
00223 const Transform & localTransform = Transform::getIdentity());
00224 CameraStereoVideo(
00225 int device,
00226 bool rectifyImages = false,
00227 float imageRate = 0.0f,
00228 const Transform & localTransform = Transform::getIdentity());
00229 CameraStereoVideo(
00230 int deviceLeft,
00231 int deviceRight,
00232 bool rectifyImages = false,
00233 float imageRate = 0.0f,
00234 const Transform & localTransform = Transform::getIdentity());
00235 virtual ~CameraStereoVideo();
00236
00237 virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
00238 virtual bool isCalibrated() const;
00239 virtual std::string getSerial() const;
00240
00241 protected:
00242 virtual SensorData captureImage(CameraInfo * info = 0);
00243
00244 private:
00245 cv::VideoCapture capture_;
00246 cv::VideoCapture capture2_;
00247 std::string path_;
00248 std::string path2_;
00249 bool rectifyImages_;
00250 StereoCameraModel stereoModel_;
00251 std::string cameraName_;
00252 CameraVideo::Source src_;
00253 int usbDevice_;
00254 int usbDevice2_;
00255 };
00256
00257 }