mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 09:30:25 +08:00
RegistrationICP: fixed local scan transform issue
This commit is contained in:
@@ -1705,7 +1705,7 @@ void DatabaseViewer::view3DLaserScans()
|
||||
{
|
||||
scan = util3d::downsample(scan, downsamplingStepSize);
|
||||
}
|
||||
cloud = util3d::laserScanToPointCloud(scan);
|
||||
cloud = util3d::laserScanToPointCloud(scan, data.laserScanInfo().localTransform());
|
||||
|
||||
if(cloud->size())
|
||||
{
|
||||
@@ -1947,7 +1947,7 @@ void DatabaseViewer::generate3DLaserScans()
|
||||
{
|
||||
scan = util3d::downsample(scan, downsamplingStepSize);
|
||||
}
|
||||
cloud = util3d::laserScanToPointCloud(scan);
|
||||
cloud = util3d::laserScanToPointCloud(scan, data.laserScanInfo().localTransform());
|
||||
|
||||
if(cloud->size())
|
||||
{
|
||||
@@ -3280,7 +3280,7 @@ void DatabaseViewer::updateConstraintView(
|
||||
data.uncompressDataConst(0, 0, &scan, 0);
|
||||
if(!scan.empty())
|
||||
{
|
||||
pcl::PointCloud<pcl::PointXYZ>::Ptr scanCloud = util3d::laserScanToPointCloud(scan);
|
||||
pcl::PointCloud<pcl::PointXYZ>::Ptr scanCloud = util3d::laserScanToPointCloud(scan, data.laserScanInfo().localTransform());
|
||||
if(assembledScans->size() == 0)
|
||||
{
|
||||
assembledScans = util3d::transformPointCloud(scanCloud, iter->second);
|
||||
|
||||
@@ -402,6 +402,7 @@ std::map<int, pcl::PointCloud<pcl::PointNormal>::Ptr> ExportScansDialog::getScan
|
||||
scan = util3d::downsample(scan, _ui->spinBox_decimation->value());
|
||||
}
|
||||
}
|
||||
scan = util3d::transformLaserScan(scan, s.sensorData().laserScanInfo().localTransform());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1036,7 +1036,7 @@ void MainWindow::processOdometry(const rtabmap::OdometryEvent & odom, bool dataI
|
||||
}
|
||||
|
||||
pcl::PointCloud<pcl::PointNormal>::Ptr cloud;
|
||||
cloud = util3d::laserScanToPointCloudNormal(scan, odom.data().laserScanInfo().localTransform()*pose);
|
||||
cloud = util3d::laserScanToPointCloudNormal(scan, pose*odom.data().laserScanInfo().localTransform());
|
||||
if(_preferencesDialog->getCloudVoxelSizeScan(1) > 0.0)
|
||||
{
|
||||
cloud = util3d::voxelize(cloud, _preferencesDialog->getCloudVoxelSizeScan(1));
|
||||
@@ -2700,7 +2700,11 @@ void MainWindow::createAndAddScanToMap(int nodeId, const Transform & pose, int m
|
||||
//reconvert the voxelized cloud
|
||||
scan = util3d::laserScanFromPointCloud(*cloud);
|
||||
}
|
||||
_createdScans.insert(std::make_pair(nodeId, scan));
|
||||
else
|
||||
{
|
||||
scan = util3d::transformLaserScan(scan, iter->sensorData().laserScanInfo().localTransform());
|
||||
}
|
||||
_createdScans.insert(std::make_pair(nodeId, scan)); // keep scan in base_link frame
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2725,16 +2729,13 @@ void MainWindow::createAndAddScanToMap(int nodeId, const Transform & pose, int m
|
||||
if(_preferencesDialog->getCloudVoxelSizeScan(0) > 0.0)
|
||||
{
|
||||
//reconvert the voxelized cloud
|
||||
if(scan.channels() == 2)
|
||||
{
|
||||
scan = util3d::laserScan2dFromPointCloud(*cloud);
|
||||
}
|
||||
else
|
||||
{
|
||||
scan = util3d::laserScanFromPointCloud(*cloud);
|
||||
}
|
||||
scan = util3d::laserScanFromPointCloud(*cloud);
|
||||
}
|
||||
_createdScans.insert(std::make_pair(nodeId, scan));
|
||||
else
|
||||
{
|
||||
scan = util3d::transformLaserScan(scan, iter->sensorData().laserScanInfo().localTransform());
|
||||
}
|
||||
_createdScans.insert(std::make_pair(nodeId, scan)); // keep scan in base_link frame
|
||||
}
|
||||
}
|
||||
_cloudViewer->setCloudOpacity(scanName, _preferencesDialog->getScanOpacity(0));
|
||||
|
||||
Reference in New Issue
Block a user