0
$\begingroup$

Rosanswers logo

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?

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Hi, this isn't possible with RGBDSLAM at the moment (and I currently have no plans to add this feature). To implement this, in addition to the point cloud, you would also need to store the belonging feature descriptors and their 2d/3d locations. Further the graph would need to be saved (there is a function for that in hogman/g2o).

So in fact, one would need to implent saving and restoring of the Node class.

While the principle is easy, this would be a lot of programming work, and since I don't have time for it, I guess it will not be done. Anyone willing to volunteer is welcome to contact me for details.


Originally posted by Felix Endres with karma: 6468 on 2011-11-16

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by Felix Endres on 2011-11-18:
Yes, sure. Since this board is only for questions, I'll answer your email.

Comment by drew212 on 2011-11-18:
I would be interested in taking a look at the work required, would you care to help me going about doing this? I've been working with RGBDSlam but don't know how things exactly work, but I do have a rough idea.

$\endgroup$
0
$\begingroup$

Rosanswers logo

This question was already addressed under how to save a point cloud.

The pcd_to_pointcloud node from the pcl_ros package can publish data previously saved in a PCD.

If you need more details or examples, please post another comment.


Originally posted by joq with karma: 25443 on 2011-11-08

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by joq on 2011-11-11:
I can't help you with the internals of RGBDSlam. Maybe one of those developers will answer.

Comment by drew212 on 2011-11-11:
Thanks for the udpate. Maybe I'm missing something but I'm not sure how this helps since I already have a point cloud inside a function I added to RGBDSlam. The function is in graph_manager.cpp now I need to add it to the graph, but idk how. Do I add it to optimizer_ or graph_? How?

Comment by drew212 on 2011-11-10:
Ok, now I can successfully load the file, but how do I get that data into rgbdslam so I can continue creating the map? I vaguely understand how rgbdslam works under the hood and I'm not sure how to add the point cloud back in.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.