mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +08:00
fixed assert when Odom/AlignWithGround is true and generated cloud is empty
This commit is contained in:
@@ -236,10 +236,10 @@ Transform Odometry::process(SensorData & data, const Transform & guessIn, Odomet
|
|||||||
pcl::IndicesPtr indices(new std::vector<int>);
|
pcl::IndicesPtr indices(new std::vector<int>);
|
||||||
pcl::IndicesPtr ground, obstacles;
|
pcl::IndicesPtr ground, obstacles;
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud = util3d::cloudFromSensorData(data, 1, 0, 0, indices.get());
|
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud = util3d::cloudFromSensorData(data, 1, 0, 0, indices.get());
|
||||||
cloud = util3d::voxelize(cloud, indices, 0.01);
|
|
||||||
bool success = false;
|
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);
|
util3d::segmentObstaclesFromGround<pcl::PointXYZ>(cloud, ground, obstacles, 20, M_PI/4.0f, 0.02, 200, true);
|
||||||
if(ground->size())
|
if(ground->size())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user