ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

RGBDSlam load saved files

asked 2011-11-08 01:37:59 -0600

drew212 gravatar image

updated 2014-01-28 17:10:44 -0600

ngrennan gravatar image

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_));
}
edit retag flag offensive close merge delete

Comments

Hi , I want to fuse the RGBD-SLAM to multi-robots, and i have the similar problem, have you implemented it?

lguodongustc gravatar image lguodongustc  ( 2014-05-15 04:18:03 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
3

answered 2011-11-16 03:10:32 -0600

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.

edit flag offensive delete link more

Comments

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.
drew212 gravatar image drew212  ( 2011-11-17 23:39:44 -0600 )edit
Yes, sure. Since this board is only for questions, I'll answer your email.
Felix Endres gravatar image Felix Endres  ( 2011-11-18 01:04:54 -0600 )edit
2

answered 2011-11-08 06:06:01 -0600

joq gravatar image

updated 2011-11-10 09:39:47 -0600

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.

edit flag offensive delete link more

Comments

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.
drew212 gravatar image drew212  ( 2011-11-09 23:56:35 -0600 )edit
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?
drew212 gravatar image drew212  ( 2011-11-11 00:19:15 -0600 )edit
I can't help you with the internals of RGBDSlam. Maybe one of those developers will answer.
joq gravatar image joq  ( 2011-11-11 09:05:01 -0600 )edit

Question Tools

Stats

Asked: 2011-11-08 01:37:59 -0600

Seen: 1,132 times

Last updated: Nov 16 '11