Is there a way to load the saved PCD file to rgbdslam for later use? What I am trying to do is create a map, and then later come along and locate my position/orientation within the map.
Update: I am able to load a pointcloud into a pointcloud_type for use in rgbdslam but I'm not sure how or where to add it to the graph. I have a call to setPointCloud(cloud, transform) but it isn't working correctly, as it was a shot in the dark. Below is a snippit of code, this method is set up in graph_manager.cpp, and is called from qtcv when the menu option is clicked and a file is selected. I know that it is correctly loading the file because the ROS_INFO call works and says that it is loading points.
void GraphManager::loadCloudsFromFile(QString filename){
string * printableFileName = new string(qPrintable(filename));
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGB>);
if(pcl::io::loadPCDFile<pcl::PointXYZRGB>(*printableFileName, *cloud) == -1)
{
ROS_ERROR("Couldn't read file %s", printableFileName->c_str());
return;
}
ROS_INFO("Loaded %d, data points from %s", cloud->width * cloud->height, printableFileName->c_str());
pointcloud_type * cloud2 = new pointcloud_type(*cloud);
//sensor_msgs::PointCloud2 cloud2;
//pcl::toROSMsg(*cloud, cloud2);
latest_transform_ = QMatrix4x4();
Q_EMIT(setPointCloud(cloud2, latest_transform_));
}
Originally posted by drew212 on ROS Answers with karma: 57 on 2011-11-08
Post score: 0
Original comments
Comment by lguodongustc on 2014-05-15:
Hi , I want to fuse the RGBD-SLAM to multi-robots, and i have the similar problem, have you implemented it?