fixed assert when Odom/AlignWithGround is true and generated cloud is empty

This commit is contained in:
matlabbe
2017-10-24 11:40:58 +02:00
parent b6f41eecfd
commit 303f315b3e

View File

@@ -236,10 +236,10 @@ Transform Odometry::process(SensorData & data, const Transform & guessIn, Odomet
pcl::IndicesPtr indices(new std::vector<int>);
pcl::IndicesPtr ground, obstacles;
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud = util3d::cloudFromSensorData(data, 1, 0, 0, indices.get());
cloud = util3d::voxelize(cloud, indices, 0.01);
bool success = false;
if(cloud->size())
if(indices->size())
{
cloud = util3d::voxelize(cloud, indices, 0.01);
util3d::segmentObstaclesFromGround<pcl::PointXYZ>(cloud, ground, obstacles, 20, M_PI/4.0f, 0.02, 200, true);
if(ground->size())
{