Camera.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
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 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 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON 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
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #pragma once
29 
30 #include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
31 
32 #include <opencv2/highgui/highgui.hpp>
35 #include <set>
36 #include <stack>
37 #include <list>
38 #include <vector>
39 
40 class UDirectory;
41 class UTimer;
42 
43 namespace rtabmap
44 {
45 
51 {
52 public:
53  virtual ~Camera();
54  SensorData takeImage(CameraInfo * info = 0);
55 
56  bool initFromFile(const std::string & calibrationPath);
57  virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "") = 0;
58  virtual bool isCalibrated() const = 0;
59  virtual std::string getSerial() const = 0;
60  virtual bool odomProvided() const { return false; }
61  virtual bool getPose(double stamp, Transform & pose, cv::Mat & covariance) { return false; }
62 
63  //getters
64  float getImageRate() const {return _imageRate;}
65  const Transform & getLocalTransform() const {return _localTransform;}
66 
67  //setters
68  void setImageRate(float imageRate) {_imageRate = imageRate;}
69  void setLocalTransform(const Transform & localTransform) {_localTransform= localTransform;}
70 
71  void resetTimer();
72 protected:
79  Camera(float imageRate = 0, const Transform & localTransform = Transform::getIdentity());
80 
84  virtual SensorData captureImage(CameraInfo * info = 0) = 0;
85 
86  int getNextSeqID() {return ++_seq;}
87 
88 private:
89  float _imageRate;
91  cv::Size _targetImageSize;
93  int _seq;
94 };
95 
96 
97 } // namespace rtabmap
Definition: UTimer.h:46
def init(descriptorDim, matchThreshold, iterations, cuda, model_path)
static Transform getIdentity()
Definition: Transform.cpp:401
void setImageRate(float imageRate)
Definition: Camera.h:68
#define RTABMAP_EXP
Definition: RtabmapExp.h:38
virtual bool getPose(double stamp, Transform &pose, cv::Mat &covariance)
Definition: Camera.h:61
Transform _localTransform
Definition: Camera.h:90
const Transform & getLocalTransform() const
Definition: Camera.h:65
float getImageRate() const
Definition: Camera.h:64
UTimer * _frameRateTimer
Definition: Camera.h:92
int getNextSeqID()
Definition: Camera.h:86
float _imageRate
Definition: Camera.h:89
virtual bool odomProvided() const
Definition: Camera.h:60
void setLocalTransform(const Transform &localTransform)
Definition: Camera.h:69
cv::Size _targetImageSize
Definition: Camera.h:91


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Jan 23 2023 03:37:27