icp_odometry: auto set scan_cloud_max_points if received cloud is organized (we know full dimension)

This commit is contained in:
matlabbe
2019-03-14 19:12:56 -04:00
parent 627b6e78bd
commit 6bd420bc54
2 changed files with 13 additions and 5 deletions
+7 -1
View File
@@ -291,7 +291,13 @@ private:
ROS_ERROR("TF of received scan cloud at time %fs is not set, aborting rtabmap update.", cloudMsg->header.stamp.toSec());
return;
}
if(scanCloudMaxPoints_ == 0 && cloudMsg->height > 1)
{
scanCloudMaxPoints_ = cloudMsg->height * cloudMsg->width;
NODELET_WARN("IcpOdometry: \"scan_cloud_max_points\" is not set but input "
"cloud is not dense, for convenience it will be set to %d (%dx%d)",
scanCloudMaxPoints_, cloudMsg->width, cloudMsg->height);
}
int maxLaserScans = scanCloudMaxPoints_;
if(containNormals)
{