SensorCapture.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2010-2022, Mathieu Labbe
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, 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 names of its contributors may be used to endorse or promote products
13  derived from this software without specific prior written permission.
14 
15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
19 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26 
27 #pragma once
28 
29 #include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
30 
31 #include <opencv2/highgui/highgui.hpp>
34 #include <set>
35 #include <stack>
36 #include <list>
37 #include <vector>
38 
39 class UDirectory;
40 class UTimer;
41 
42 namespace rtabmap
43 {
44 
49 class RTABMAP_CORE_EXPORT SensorCapture
50 {
51 public:
52  virtual ~SensorCapture();
53  SensorData takeData(SensorCaptureInfo * info = 0);
54 
55  virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "") = 0;
56  virtual std::string getSerial() const = 0;
57  virtual bool odomProvided() const { return false; }
58  virtual bool getPose(double stamp, Transform & pose, cv::Mat & covariance, double maxWaitTime = 0.06) { return false; }
59 
60  //getters
61  float getFrameRate() const {return _frameRate;}
62  const Transform & getLocalTransform() const {return _localTransform;}
63 
64  //setters
65  void setFrameRate(float frameRate) {_frameRate = frameRate;}
66  void setLocalTransform(const Transform & localTransform) {_localTransform= localTransform;}
67 
68  void resetTimer();
69 protected:
76  SensorCapture(float frameRate = 0, const Transform & localTransform = Transform::getIdentity());
77 
81  virtual SensorData captureData(SensorCaptureInfo * info = 0) = 0;
82 
83  int getNextSeqID() {return ++_seq;}
84 
85 private:
86  float _frameRate;
89  int _seq;
90 };
91 
92 
93 } // namespace rtabmap
rtabmap::SensorData
Definition: SensorData.h:51
rtabmap::Transform::getIdentity
static Transform getIdentity()
Definition: Transform.cpp:411
rtabmap::SensorCapture::_localTransform
Transform _localTransform
Definition: SensorCapture.h:87
SensorData.h
rtabmap::SensorCapture::setFrameRate
void setFrameRate(float frameRate)
Definition: SensorCapture.h:65
rtabmap::SensorCapture::getLocalTransform
const Transform & getLocalTransform() const
Definition: SensorCapture.h:62
rtabmap::SensorCapture::_frameRateTimer
UTimer * _frameRateTimer
Definition: SensorCapture.h:88
rtabmap::SensorCaptureInfo
Definition: SensorCaptureInfo.h:36
rtabmap::SensorCapture::odomProvided
virtual bool odomProvided() const
Definition: SensorCapture.h:57
rtabmap::SensorCapture::_frameRate
float _frameRate
Definition: SensorCapture.h:86
info
else if n * info
SensorCaptureInfo.h
rtabmap::SensorCapture
Definition: SensorCapture.h:49
rtabmap_netvlad.init
def init(descriptorDim)
Definition: rtabmap_netvlad.py:30
rtabmap::Transform
Definition: Transform.h:41
rtabmap::SensorCapture::getPose
virtual bool getPose(double stamp, Transform &pose, cv::Mat &covariance, double maxWaitTime=0.06)
Definition: SensorCapture.h:58
UTimer
Definition: UTimer.h:46
rtabmap::SensorCapture::getFrameRate
float getFrameRate() const
Definition: SensorCapture.h:61
rtabmap::SensorCapture::_seq
int _seq
Definition: SensorCapture.h:89
rtabmap::SensorCapture::setLocalTransform
void setLocalTransform(const Transform &localTransform)
Definition: SensorCapture.h:66
rtabmap
Definition: CameraARCore.cpp:35
UDirectory
Definition: UDirectory.h:34
rtabmap::SensorCapture::getNextSeqID
int getNextSeqID()
Definition: SensorCapture.h:83


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:15