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

Represents 2D or 3D laser scan data with support for multiple point data formats. More...

#include <LaserScan.h>

Public Types

enum  Format {
  kUnknown =0 , kXY =1 , kXYI =2 , kXYNormal =3 ,
  kXYINormal =4 , kXYZ =5 , kXYZI =6 , kXYZRGB =7 ,
  kXYZNormal =8 , kXYZINormal =9 , kXYZRGBNormal =10 , kXYZIT =11 ,
  kXYZIRT =12
}
 Enumeration of possible formats for laser scan data. More...
 

Public Member Functions

Constructors
 LaserScan (const LaserScan &data, int maxPoints, float maxRange, const Transform &localTransform=Transform::getIdentity())
 
RTABMAP_DEPRECATED LaserScan (const LaserScan &data, int maxPoints, float maxRange, Format format, const Transform &localTransform=Transform::getIdentity())
 
 LaserScan (const cv::Mat &data, int maxPoints, float maxRange, Format format, const Transform &localTransform=Transform::getIdentity())
 
RTABMAP_DEPRECATED LaserScan (const LaserScan &data, Format format, float minRange, float maxRange, float angleMin, float angleMax, float angleIncrement, const Transform &localTransform=Transform::getIdentity())
 
 LaserScan (const LaserScan &data, float minRange, float maxRange, float angleMin, float angleMax, float angleIncrement, const Transform &localTransform=Transform::getIdentity())
 
 LaserScan (const cv::Mat &data, Format format, float minRange, float maxRange, float angleMin, float angleMax, float angleIncrement, const Transform &localTransform=Transform::getIdentity())
 
Accessors
const cv::Mat & data () const
 
Format format () const
 
std::string formatName () const
 
int channels () const
 
int maxPoints () const
 
float rangeMin () const
 
float rangeMax () const
 
float angleMin () const
 
float angleMax () const
 
float angleIncrement () const
 
void setLocalTransform (const Transform &t)
 
Transform localTransform () const
 
Status and Format Checks
bool empty () const
 
bool isEmpty () const
 
int size () const
 
int dataType () const
 
bool is2d () const
 
bool hasNormals () const
 
bool hasRGB () const
 
bool hasIntensity () const
 
bool hasTime () const
 
bool hasRing () const
 
bool isCompressed () const
 True if the scan is stored compressed (single-row CV_8UC1 blob) instead of raw points.
 
bool isOrganized () const
 
LaserScan clone () const
 
LaserScan densify () const
 
Operations
int getIntensityOffset () const
 
int getRGBOffset () const
 
int getNormalsOffset () const
 
int getRingOffset () const
 
int getTimeOffset () const
 
float & field (unsigned int pointIndex, unsigned int channelOffset)
 Access a specific field value of a point.
 
void clear ()
 Clear the scan data.
 
LaserScanoperator+= (const LaserScan &)
 Concatenate scan's data (localTransform is ignored).
 
LaserScan operator+ (const LaserScan &)
 Concatenate scan's data (localTransform is ignored).
 

Static Public Member Functions

Static Utility Functions
static std::string formatName (const Format &format)
 
static int channels (const Format &format)
 
static bool isScan2d (const Format &format)
 
static bool isScanHasNormals (const Format &format)
 
static bool isScanHasRGB (const Format &format)
 
static bool isScanHasIntensity (const Format &format)
 
static bool isScanHasTime (const Format &format)
 
static bool isScanHasRing (const Format &format)
 
static float packRGB (unsigned char r, unsigned char g, unsigned char b)
 
static void unpackRGB (float rgb, unsigned char &r, unsigned char &g, unsigned char &b)
 
static LaserScan backwardCompatibility (const cv::Mat &oldScanFormat, int maxPoints=0, int maxRange=0, const Transform &localTransform=Transform::getIdentity())
 Converts legacy scan format to a LaserScan object.
 
static LaserScan backwardCompatibility (const cv::Mat &oldScanFormat, float minRange, float maxRange, float angleMin, float angleMax, float angleInc, const Transform &localTransform=Transform::getIdentity())
 Converts legacy scan format with additional metadata to a LaserScan.
 

Detailed Description

Represents 2D or 3D laser scan data with support for multiple point data formats.

The LaserScan class stores structured laser scan data used in SLAM, mapping, and perception. It supports various formats including point coordinates, intensity, normals, RGB colors, and timestamps. Utility methods are provided for format checking, cloning, and combining scans.

Definition at line 45 of file LaserScan.h.

Member Enumeration Documentation

◆ Format

Enumeration of possible formats for laser scan data.

These values represent different combinations of point attributes that can be stored in a laser scan. The format determines how each point in the scan is structured.

Enumerator
kUnknown 

Unknown format.

kXY 

2D points with X and Y coordinates.

kXYI 

2D points with X, Y and intensity.

kXYNormal 

2D points with X, Y and normal vectors.

kXYINormal 

2D points with X, Y, intensity and normal vectors.

kXYZ 

3D points with X, Y and Z coordinates.

kXYZI 

3D points with X, Y, Z and intensity.

kXYZRGB 

3D points with X, Y, Z and RGB color.

kXYZNormal 

3D points with X, Y, Z and normal vectors.

kXYZINormal 

3D points with X, Y, Z, intensity and normal vectors.

kXYZRGBNormal 

3D points with X, Y, Z, RGB color and normal vectors.

kXYZIT 

3D points with X, Y, Z, intensity and time.

kXYZIRT 

3D points with X, Y, Z, intensity, ring and time.

Definition at line 55 of file LaserScan.h.

Constructor & Destructor Documentation

◆ LaserScan() [1/2]

RTABMAP_DEPRECATED rtabmap::LaserScan::LaserScan ( const LaserScan data,
int  maxPoints,
float  maxRange,
Format  format,
const Transform localTransform = Transform::getIdentity() 
)
Deprecated:
Use constructor without format argument.

◆ LaserScan() [2/2]

RTABMAP_DEPRECATED rtabmap::LaserScan::LaserScan ( const LaserScan data,
Format  format,
float  minRange,
float  maxRange,
float  angleMin,
float  angleMax,
float  angleIncrement,
const Transform localTransform = Transform::getIdentity() 
)
Deprecated:
Use constructor without format argument.

Member Function Documentation

◆ data()

const cv::Mat & rtabmap::LaserScan::data ( ) const
inline

Definition at line 156 of file LaserScan.h.

◆ format()

Format rtabmap::LaserScan::format ( ) const
inline

Definition at line 157 of file LaserScan.h.

◆ formatName()

std::string rtabmap::LaserScan::formatName ( ) const
inline

Definition at line 158 of file LaserScan.h.

◆ channels()

int rtabmap::LaserScan::channels ( ) const
inline

Definition at line 159 of file LaserScan.h.

◆ maxPoints()

int rtabmap::LaserScan::maxPoints ( ) const
inline

Definition at line 160 of file LaserScan.h.

◆ rangeMin()

float rtabmap::LaserScan::rangeMin ( ) const
inline

Definition at line 161 of file LaserScan.h.

◆ rangeMax()

float rtabmap::LaserScan::rangeMax ( ) const
inline

Definition at line 162 of file LaserScan.h.

◆ angleMin()

float rtabmap::LaserScan::angleMin ( ) const
inline

Definition at line 163 of file LaserScan.h.

◆ angleMax()

float rtabmap::LaserScan::angleMax ( ) const
inline

Definition at line 164 of file LaserScan.h.

◆ angleIncrement()

float rtabmap::LaserScan::angleIncrement ( ) const
inline

Definition at line 165 of file LaserScan.h.

◆ setLocalTransform()

void rtabmap::LaserScan::setLocalTransform ( const Transform t)
inline

Definition at line 166 of file LaserScan.h.

◆ localTransform()

Transform rtabmap::LaserScan::localTransform ( ) const
inline

Definition at line 167 of file LaserScan.h.

◆ empty()

bool rtabmap::LaserScan::empty ( ) const
inline

Definition at line 172 of file LaserScan.h.

◆ isEmpty()

bool rtabmap::LaserScan::isEmpty ( ) const
inline

Definition at line 173 of file LaserScan.h.

◆ size()

int rtabmap::LaserScan::size ( ) const
inline

Definition at line 174 of file LaserScan.h.

◆ dataType()

int rtabmap::LaserScan::dataType ( ) const
inline

Definition at line 175 of file LaserScan.h.

◆ is2d()

bool rtabmap::LaserScan::is2d ( ) const
inline

Definition at line 176 of file LaserScan.h.

◆ hasNormals()

bool rtabmap::LaserScan::hasNormals ( ) const
inline

Definition at line 177 of file LaserScan.h.

◆ hasRGB()

bool rtabmap::LaserScan::hasRGB ( ) const
inline

Definition at line 178 of file LaserScan.h.

◆ hasIntensity()

bool rtabmap::LaserScan::hasIntensity ( ) const
inline

Definition at line 179 of file LaserScan.h.

◆ hasTime()

bool rtabmap::LaserScan::hasTime ( ) const
inline

Definition at line 180 of file LaserScan.h.

◆ hasRing()

bool rtabmap::LaserScan::hasRing ( ) const
inline

Definition at line 181 of file LaserScan.h.

◆ isCompressed()

bool rtabmap::LaserScan::isCompressed ( ) const
inline

True if the scan is stored compressed (single-row CV_8UC1 blob) instead of raw points.

Definition at line 183 of file LaserScan.h.

◆ isOrganized()

bool rtabmap::LaserScan::isOrganized ( ) const
inline

Definition at line 184 of file LaserScan.h.

◆ getIntensityOffset()

int rtabmap::LaserScan::getIntensityOffset ( ) const
inline

Definition at line 191 of file LaserScan.h.

◆ getRGBOffset()

int rtabmap::LaserScan::getRGBOffset ( ) const
inline

Definition at line 192 of file LaserScan.h.

◆ getNormalsOffset()

int rtabmap::LaserScan::getNormalsOffset ( ) const
inline

Definition at line 193 of file LaserScan.h.

◆ getRingOffset()

int rtabmap::LaserScan::getRingOffset ( ) const
inline

Definition at line 194 of file LaserScan.h.

◆ getTimeOffset()

int rtabmap::LaserScan::getTimeOffset ( ) const
inline

Definition at line 195 of file LaserScan.h.

◆ field()

float & rtabmap::LaserScan::field ( unsigned int  pointIndex,
unsigned int  channelOffset 
)

Access a specific field value of a point.

Parameters
pointIndexIndex of the point.
channelOffsetChannel offset to access (e.g., 0=X, 1=Y, 2=Z if 2D, for other fields, use corresponding getter functions).
Returns
Reference to the field value.
See also
getIntensityOffset() getRGBOffset() getNormalsOffset() getTimeOffset()

◆ clear()

void rtabmap::LaserScan::clear ( )
inline

Clear the scan data.

Definition at line 209 of file LaserScan.h.


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