37 #include "rtabmap/core/Version.h" 39 #include <pcl/pcl_config.h> 42 #if __linux__ && __i386__ && __cplusplus >= 201103L 43 #warning "Openni driver is not available on i386 when building with c++11 support" 45 #define RTABMAP_OPENNI 46 #include <pcl/io/openni_camera/openni_depth_image.h> 47 #include <pcl/io/openni_camera/openni_image.h> 51 #include <boost/signals2/connection.hpp> 67 class Freenect2Device;
68 class SyncMultiFrameListener;
88 struct rs2_intrinsics;
89 struct rs2_extrinsics;
111 static bool available();
117 const Transform & localTransform = Transform::getIdentity());
119 #ifdef RTABMAP_OPENNI 126 virtual bool init(
const std::string & calibrationFolder =
".",
const std::string & cameraName =
"");
127 virtual bool isCalibrated()
const;
128 virtual std::string getSerial()
const;
152 static bool available();
157 const Transform & localTransform = Transform::getIdentity());
160 virtual bool init(
const std::string & calibrationFolder =
".",
const std::string & cameraName =
"");
161 virtual bool isCalibrated()
const;
181 static bool available();
182 static bool exposureGainAvailable();
183 enum Type {kTypeColorDepth, kTypeIRDepth, kTypeIR};
187 Type type = kTypeColorDepth,
189 const Transform & localTransform = Transform::getIdentity());
192 virtual bool init(
const std::string & calibrationFolder =
".",
const std::string & cameraName =
"");
193 virtual bool isCalibrated()
const;
194 virtual std::string getSerial()
const;
196 bool setAutoWhiteBalance(
bool enabled);
197 bool setAutoExposure(
bool enabled);
198 bool setExposure(
int value);
199 bool setGain(
int value);
200 bool setMirroring(
bool enabled);
201 void setOpenNI2StampsAndIDsUsed(
bool used);
202 void setIRDepthShift(
int horizontal,
int vertical);
208 #ifdef RTABMAP_OPENNI2 210 openni::Device * _device;
211 openni::VideoStream * _color;
212 openni::VideoStream * _depth;
215 std::string _deviceId;
216 bool _openNI2StampsAndIDsUsed;
227 class FreenectDevice;
233 static bool available();
234 enum Type {kTypeColorDepth, kTypeIRDepth};
239 Type type = kTypeColorDepth,
240 float imageRate=0.0
f,
241 const Transform & localTransform = Transform::getIdentity());
244 virtual bool init(
const std::string & calibrationFolder =
".",
const std::string & cameraName =
"");
245 virtual bool isCalibrated()
const;
246 virtual std::string getSerial()
const;
252 #ifdef RTABMAP_FREENECT 256 FreenectDevice * freenectDevice_;
269 static bool available();
283 Type type = kTypeDepth2ColorSD,
284 float imageRate=0.0f,
285 const Transform & localTransform = Transform::getIdentity(),
286 float minDepth = 0.3f,
287 float maxDepth = 12.0f,
288 bool bilateralFiltering =
true,
289 bool edgeAwareFiltering =
true,
290 bool noiseFiltering =
true,
291 const std::string & pipelineName =
"");
294 virtual bool init(
const std::string & calibrationFolder =
".",
const std::string & cameraName =
"");
295 virtual bool isCalibrated()
const;
296 virtual std::string getSerial()
const;
302 #ifdef RTABMAP_FREENECT2 306 libfreenect2::Freenect2 * freenect2_;
307 libfreenect2::Freenect2Device *dev_;
308 libfreenect2::SyncMultiFrameListener * listener_;
309 libfreenect2::Registration * reg_;
310 float minKinect2Depth_;
311 float maxKinect2Depth_;
312 bool bilateralFiltering_;
313 bool edgeAwareFiltering_;
314 bool noiseFiltering_;
315 std::string pipelineName_;
327 static bool available();
336 static const int cDepthWidth = 512;
337 static const int cDepthHeight = 424;
338 static const int cColorWidth = 1920;
339 static const int cColorHeight = 1080;
344 Type type = kTypeDepth2ColorSD,
345 float imageRate = 0.0f,
346 const Transform & localTransform = Transform::getIdentity());
349 virtual bool init(
const std::string & calibrationFolder =
".",
const std::string & cameraName =
"");
350 virtual bool isCalibrated()
const;
351 virtual std::string getSerial()
const;
376 class slam_event_handler;
381 static bool available();
390 bool computeOdometry =
false,
392 const Transform & localTransform = Transform::getIdentity());
395 void setDepthScaledToRGBSize(
bool enabled);
397 virtual bool init(
const std::string & calibrationFolder =
".",
const std::string & cameraName =
"");
398 virtual bool isCalibrated()
const;
399 virtual std::string getSerial()
const;
400 virtual bool odomProvided()
const;
406 #ifdef RTABMAP_REALSENSE 412 bool computeOdometry_;
413 bool depthScaledToRGBSize_;
416 std::vector<int> rsRectificationTable_;
419 rs::slam::slam * slam_;
422 std::map<double, std::pair<cv::Mat, cv::Mat> > bufferedFrames_;
423 std::pair<cv::Mat, cv::Mat> lastSyncFrames_;
431 class slam_event_handler;
436 static bool available();
441 const std::string & deviceId =
"",
443 const Transform & localTransform = Transform::getIdentity());
446 virtual bool init(
const std::string & calibrationFolder =
".",
const std::string & cameraName =
"");
447 virtual bool isCalibrated()
const;
448 virtual std::string getSerial()
const;
451 void setEmitterEnabled(
bool enabled);
452 void setIRDepthFormat(
bool enabled);
458 #ifdef RTABMAP_REALSENSE2 461 std::string deviceId_;
462 rs2::syncer * syncer_;
463 float depth_scale_meters_;
464 rs2_intrinsics * depthIntrinsics_;
465 rs2_intrinsics * rgbIntrinsics_;
466 rs2_extrinsics * depthToRGBExtrinsics_;
467 cv::Mat depthBuffer_;
471 bool emitterEnabled_;
485 static bool available();
489 const std::string & pathRGBImages,
490 const std::string & pathDepthImages,
491 float depthScaleFactor = 1.0
f,
492 float imageRate=0.0
f,
493 const Transform & localTransform = Transform::getIdentity());
496 virtual bool init(
const std::string & calibrationFolder =
".",
const std::string & cameraName =
"");
497 virtual bool isCalibrated()
const;
498 virtual std::string getSerial()
const;
500 virtual void setStartIndex(
int index) {CameraImages::setStartIndex(index);cameraDepth_.setStartIndex(index);}
struct _freenect_device freenect_device
CameraImages cameraDepth_
cv::VideoCapture _capture
struct IMultiSourceFrameReader IMultiSourceFrameReader
virtual void setStartIndex(int index)
struct IKinectSensor IKinectSensor
boost::signals2::connection connection_
struct _DepthSpacePoint DepthSpacePoint
struct _freenect_context freenect_context
struct tagRGBQUAD RGBQUAD
virtual std::string getSerial() const
struct ICoordinateMapper ICoordinateMapper
pcl::Grabber * interface_
struct _ColorSpacePoint ColorSpacePoint