mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 09:30:25 +08:00
Fixed create2DMap assert on 32FC2 when subscribing 2D scans with intensity. LaserScan: fixed assert when angle_min > angle_max (with angle_increment < 0)
This commit is contained in:
@@ -299,8 +299,7 @@ void LaserScan::init(
|
||||
// 2D scan
|
||||
is2D = true;
|
||||
UASSERT(rangeMax>rangeMin);
|
||||
UASSERT(angleMax>angleMin);
|
||||
UASSERT(angleIncrement != 0.0f);
|
||||
UASSERT((angleIncrement>0 && angleMax>angleMin) || (angleIncrement<0 && angleMax<angleMin));
|
||||
maxPoints_ = std::ceil((angleMax - angleMin) / angleIncrement)+1;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -286,8 +286,8 @@ void OccupancyGrid::createLocalMap(
|
||||
cv::Mat & emptyCells,
|
||||
cv::Point3f & viewPoint) const
|
||||
{
|
||||
UDEBUG("scan format=%d, occupancyFromDepth_=%d normalsSegmentation_=%d grid3D_=%d",
|
||||
node.sensorData().laserScanRaw().isEmpty()?0:node.sensorData().laserScanRaw().format(), occupancyFromDepth_?1:0, normalsSegmentation_?1:0, grid3D_?1:0);
|
||||
UDEBUG("scan format=%s, occupancyFromDepth_=%d normalsSegmentation_=%d grid3D_=%d",
|
||||
node.sensorData().laserScanRaw().isEmpty()?"NA":node.sensorData().laserScanRaw().formatName().c_str(), occupancyFromDepth_?1:0, normalsSegmentation_?1:0, grid3D_?1:0);
|
||||
|
||||
if((node.sensorData().laserScanRaw().is2d()) && !occupancyFromDepth_)
|
||||
{
|
||||
@@ -407,7 +407,7 @@ void OccupancyGrid::createLocalMap(
|
||||
const Transform & t = node.sensorData().stereoCameraModel().localTransform();
|
||||
viewPoint = cv::Point3f(t.x(), t.y(), t.z());
|
||||
}
|
||||
createLocalMap(LaserScan(util3d::laserScanFromPointCloud(*cloud, indices), 0, 0.0f, LaserScan::kXYZRGB), node.getPose(), groundCells, obstacleCells, emptyCells, viewPoint);
|
||||
createLocalMap(LaserScan(util3d::laserScanFromPointCloud(*cloud, indices), 0, 0.0f), node.getPose(), groundCells, obstacleCells, emptyCells, viewPoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ void occupancy2DFromLaserScan(
|
||||
}
|
||||
else
|
||||
{
|
||||
scanNoHit = scanHitIn;
|
||||
scanNoHit = scanHit;
|
||||
}
|
||||
|
||||
std::map<int, Transform> poses;
|
||||
|
||||
Reference in New Issue
Block a user