LaserScan: fixed destination format when source is empty with operator+

This commit is contained in:
matlabbe
2022-01-11 15:32:30 -05:00
parent f69085304e
commit 49353b134c
2 changed files with 2 additions and 1 deletions

View File

@@ -387,7 +387,7 @@ LaserScan LaserScan::operator+(const LaserScan & scan)
{
if(this->empty())
{
dest = LaserScan(scan.data().clone(), 0, 0, this->format());
dest = scan.clone();
}
else
{

View File

@@ -6300,6 +6300,7 @@ void Rtabmap::createGlobalScanMap()
data.uncompressDataConst(0, 0, &scan, 0, 0, 0, 0);
if(!scan.empty())
{
UDEBUG("Adding scan %d (format=%s, points=%d)", iter->first, scan.formatName().c_str(), scan.size());
scan = util3d::transformLaserScan(scan, iter->second*scan.localTransform());
if(_globalScanMap.empty() || _globalScanMap.format() == scan.format())
{