mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
fixed voxelize assertion with c++ rgbd mapping example
This commit is contained in:
@@ -428,7 +428,7 @@ void DBDriverSqlite3::disconnectDatabaseQuery(bool save, const std::string & out
|
|||||||
}
|
}
|
||||||
if(outputFile.empty())
|
if(outputFile.empty())
|
||||||
{
|
{
|
||||||
UERROR("Database was initialized with an empty url (in memory). To save it "
|
UERROR("Database was initialized with an empty url (in memory). To save it, "
|
||||||
"the output url should not be empty. The database is thus closed without being saved!");
|
"the output url should not be empty. The database is thus closed without being saved!");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <pcl/io/pcd_io.h>
|
#include <pcl/io/pcd_io.h>
|
||||||
#include <pcl/io/ply_io.h>
|
#include <pcl/io/ply_io.h>
|
||||||
|
#include <pcl/filters/filter.h>
|
||||||
|
|
||||||
#include "MapBuilder.h"
|
#include "MapBuilder.h"
|
||||||
|
|
||||||
@@ -216,8 +217,14 @@ int main(int argc, char * argv[])
|
|||||||
node.sensorData(),
|
node.sensorData(),
|
||||||
4, // image decimation before creating the clouds
|
4, // image decimation before creating the clouds
|
||||||
4.0f, // maximum depth of the cloud
|
4.0f, // maximum depth of the cloud
|
||||||
0.01f); // Voxel grid filtering
|
0.0f);
|
||||||
*cloud += *util3d::transformPointCloud(tmp, iter->second); // transform the point cloud to its pose
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr tmpNoNaN(new pcl::PointCloud<pcl::PointXYZRGB>);
|
||||||
|
std::vector<int> index;
|
||||||
|
pcl::removeNaNFromPointCloud(*tmp, *tmpNoNaN, index);
|
||||||
|
if(!tmpNoNaN->empty())
|
||||||
|
{
|
||||||
|
*cloud += *util3d::transformPointCloud(tmpNoNaN, iter->second); // transform the point cloud to its pose
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(cloud->size())
|
if(cloud->size())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user