RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
rtabmap::SensorEvent Class Reference

Event class for sensor data communication in RTAB-Map's event system. More...

#include <SensorEvent.h>

Inheritance diagram for rtabmap::SensorEvent:
Collaboration diagram for rtabmap::SensorEvent:

Public Types

enum  Code { kCodeData , kCodeNoMoreImages }
 Event codes for SensorEvent. More...
 

Public Member Functions

 SensorEvent (const cv::Mat &image, int seq=0, double stamp=0.0, const std::string &cameraName=std::string())
 Constructor from a single image.
 
 SensorEvent ()
 Constructor for end-of-stream event.
 
 SensorEvent (const SensorData &data)
 Constructor from SensorData.
 
 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.
 
const SensorDatadata () const
 Returns the sensor data contained in this event.
 
const std::string & cameraName () const
 Returns the camera name.
 
const SensorCaptureInfoinfo () const
 Returns the sensor capture information.
 
virtual ~SensorEvent ()
 Virtual destructor.
 
virtual std::string getClassName () const
 Returns the class name for event identification.
 
- Public Member Functions inherited from UEvent
int getCode () const
 

Additional Inherited Members

- Protected Member Functions inherited from UEvent
 UEvent (int code=0)
 

Detailed Description

Event class for sensor data communication in RTAB-Map's event system.

SensorEvent is an event class that extends UEvent and is used to communicate sensor data (images, depth, laser scans, etc.) through RTAB-Map's event-driven architecture. It is typically posted by sensor capture threads and handled by event handlers (e.g., RtabmapThread, DataRecorder, CalibrationDialog).

The class supports two event codes:

  • kCodeData: Indicates that new sensor data is available
  • kCodeNoMoreImages: Indicates that the sensor stream has ended (end of file, camera disconnected, etc.)

SensorEvent carries:

  • SensorData: The actual sensor data (images, depth, scans, camera models, etc.)
  • SensorCaptureInfo: Metadata about the capture (camera name, timing information, odometry pose, etc.)
Note
This class is part of RTAB-Map's event system. Handlers should check the event code and class name before processing the event.
See also
UEvent
SensorData
SensorCaptureInfo
UEventsHandler
UEventsManager

Definition at line 63 of file SensorEvent.h.

Member Enumeration Documentation

◆ Code

Event codes for SensorEvent.

Enumerator
kCodeData 

Event code indicating new sensor data is available.

kCodeNoMoreImages 

Event code indicating the sensor stream has ended.

Definition at line 71 of file SensorEvent.h.

Constructor & Destructor Documentation

◆ SensorEvent() [1/5]

rtabmap::SensorEvent::SensorEvent ( const cv::Mat &  image,
int  seq = 0,
double  stamp = 0.0,
const std::string &  cameraName = std::string() 
)
inline

Constructor from a single image.

Creates a SensorEvent with kCodeData containing a single image. This is a convenience constructor for simple image-only sensor data.

Parameters
imageThe image to include in the sensor data
seqSequence number (default: 0)
stampTimestamp in seconds (default: 0.0)
cameraNameOptional camera name identifier (default: empty)

Definition at line 88 of file SensorEvent.h.

◆ SensorEvent() [2/5]

rtabmap::SensorEvent::SensorEvent ( )
inline

Constructor for end-of-stream event.

Creates a SensorEvent with kCodeNoMoreImages to signal that the sensor stream has ended (e.g., end of file, camera disconnected).

Note
This constructor does not include any sensor data.

Definition at line 103 of file SensorEvent.h.

◆ SensorEvent() [3/5]

rtabmap::SensorEvent::SensorEvent ( const SensorData data)
inline

Constructor from SensorData.

Creates a SensorEvent with kCodeData containing the provided SensorData.

Parameters
dataThe sensor data to include in the event

Definition at line 115 of file SensorEvent.h.

◆ SensorEvent() [4/5]

rtabmap::SensorEvent::SensorEvent ( const SensorData data,
const std::string &  cameraName 
)
inline

Constructor from SensorData with camera name.

Creates a SensorEvent with kCodeData containing the provided SensorData and camera name.

Parameters
dataThe sensor data to include in the event
cameraNameCamera name identifier

Definition at line 130 of file SensorEvent.h.

◆ SensorEvent() [5/5]

rtabmap::SensorEvent::SensorEvent ( const SensorData data,
const SensorCaptureInfo sensorCaptureInfo 
)
inline

Constructor from SensorData with full capture info.

Creates a SensorEvent with kCodeData containing the provided SensorData and complete sensor capture information (camera name, timing, odometry, etc.).

Parameters
dataThe sensor data to include in the event
sensorCaptureInfoComplete sensor capture information

Definition at line 146 of file SensorEvent.h.

◆ ~SensorEvent()

virtual rtabmap::SensorEvent::~SensorEvent ( )
inlinevirtual

Virtual destructor.

Definition at line 185 of file SensorEvent.h.

Member Function Documentation

◆ data()

const SensorData & rtabmap::SensorEvent::data ( ) const
inline

Returns the sensor data contained in this event.

Returns the SensorData object containing images, depth, laser scans, camera models, and other sensor information.

Returns
Const reference to the sensor data

Definition at line 161 of file SensorEvent.h.

◆ cameraName()

const std::string & rtabmap::SensorEvent::cameraName ( ) const
inline

Returns the camera name.

Returns the camera name identifier from the sensor capture info.

Returns
Const reference to the camera name string

Definition at line 170 of file SensorEvent.h.

◆ info()

const SensorCaptureInfo & rtabmap::SensorEvent::info ( ) const
inline

Returns the sensor capture information.

Returns the complete sensor capture information including camera name, timing information, odometry pose, covariance, and other metadata.

Returns
Const reference to the sensor capture info

Definition at line 180 of file SensorEvent.h.

◆ getClassName()

virtual std::string rtabmap::SensorEvent::getClassName ( ) const
inlinevirtual

Returns the class name for event identification.

Returns "SensorEvent" to allow event handlers to identify this event type.

Returns
Class name string "SensorEvent"

Implements UEvent.

Definition at line 194 of file SensorEvent.h.


The documentation for this class was generated from the following file: