mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
Fixed null pointer error
This commit is contained in:
@@ -142,12 +142,12 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr groundCloud(new pcl::PointCloud<pcl::PointXYZ>);
|
pcl::PointCloud<pcl::PointXYZ>::Ptr groundCloud(new pcl::PointCloud<pcl::PointXYZ>);
|
||||||
if(groundPub_.getNumSubscribers() && ground->size())
|
if(groundPub_.getNumSubscribers() && ground.get() && ground->size())
|
||||||
{
|
{
|
||||||
pcl::copyPointCloud(*cloud, *ground, *groundCloud);
|
pcl::copyPointCloud(*cloud, *ground, *groundCloud);
|
||||||
}
|
}
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr obstaclesCloud(new pcl::PointCloud<pcl::PointXYZ>);
|
pcl::PointCloud<pcl::PointXYZ>::Ptr obstaclesCloud(new pcl::PointCloud<pcl::PointXYZ>);
|
||||||
if(obstaclesPub_.getNumSubscribers() && obstacles->size())
|
if(obstaclesPub_.getNumSubscribers() && obstacles.get() && obstacles->size())
|
||||||
{
|
{
|
||||||
pcl::copyPointCloud(*cloud, *obstacles, *obstaclesCloud);
|
pcl::copyPointCloud(*cloud, *obstacles, *obstaclesCloud);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user