RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
SensorEvent.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/SensorCaptureInfo.h>
31#include <rtabmap/utilite/UEvent.h>
32#include "rtabmap/core/SensorData.h"
33
34namespace rtabmap
35{
36
64 public UEvent
65{
66public:
75
76public:
88 SensorEvent(const cv::Mat & image, int seq=0, double stamp = 0.0, const std::string & cameraName = std::string()) :
90 data_(image, seq, stamp)
91 {
92 sensorCaptureInfo_.cameraName = cameraName;
93 }
94
107
117 data_(data)
118 {
119 }
120
130 SensorEvent(const SensorData & data, const std::string & cameraName) :
132 data_(data)
133 {
134 sensorCaptureInfo_.cameraName = cameraName;
135 }
136
146 SensorEvent(const SensorData & data, const SensorCaptureInfo & sensorCaptureInfo) :
148 data_(data),
149 sensorCaptureInfo_(sensorCaptureInfo)
150 {
151 }
152
161 const SensorData & data() const {return data_;}
162
170 const std::string & cameraName() const {return sensorCaptureInfo_.cameraName;}
171
180 const SensorCaptureInfo & info() const {return sensorCaptureInfo_;}
181
185 virtual ~SensorEvent() {}
186
194 virtual std::string getClassName() const {return std::string("SensorEvent");}
195
196private:
197 SensorData data_;
198 SensorCaptureInfo sensorCaptureInfo_;
199};
200
207RTABMAP_DEPRECATED typedef SensorEvent CameraEvent;
208
209} // namespace rtabmap
Metadata structure for sensor data capture and processing.
std::string cameraName
Camera/sensor name identifier.
Container class for all sensor data captured at a specific time.
Definition SensorData.h:97
Event class for sensor data communication in RTAB-Map's event system.
Definition SensorEvent.h:65
const SensorData & data() const
Returns the sensor data contained in this event.
SensorEvent(const SensorData &data, const std::string &cameraName)
Constructor from SensorData with camera name.
SensorEvent(const SensorData &data, const SensorCaptureInfo &sensorCaptureInfo)
Constructor from SensorData with full capture info.
virtual ~SensorEvent()
Virtual destructor.
SensorEvent(const SensorData &data)
Constructor from SensorData.
virtual std::string getClassName() const
Returns the class name for event identification.
const SensorCaptureInfo & info() const
Returns the sensor capture information.
Code
Event codes for SensorEvent.
Definition SensorEvent.h:71
@ kCodeNoMoreImages
Event code indicating the sensor stream has ended.
Definition SensorEvent.h:73
@ kCodeData
Event code indicating new sensor data is available.
Definition SensorEvent.h:72
SensorEvent(const cv::Mat &image, int seq=0, double stamp=0.0, const std::string &cameraName=std::string())
Constructor from a single image.
Definition SensorEvent.h:88
const std::string & cameraName() const
Returns the camera name.
SensorEvent()
Constructor for end-of-stream event.
RTABMAP_DEPRECATED typedef SensorEvent CameraEvent
Backward compatibility typedef.