Re: Export pose for every frame?

Posted by Timofejev on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Export-pose-for-every-frame-tp750p4332.html

matlabbe wrote
Hi,

See Edit -> Advanced -> "Export Poses..." menu.

cheers
Hi Mathieu, I assume this option is no longer present in the current rtabmap? Not a big deal, but could you confirm something about the way camera poses stored in the database?

I am trying to reconstruct the map created by rtabmap in another program. I also use the PCLVisualizer and I am extracting images and poses data straight from the database created by Rtabmap. I am able to successfully retrieve the pose 3x4 matrix, however when I try to project clouds in the scene, the clouds are not aligned. It looks like some rotation axes are switched, but I cannot find the place in code where you change the coordinate system in PCLVisualizer - so I assume you also use the default one.

What I do is:

1) read the pose blob from the database file
2) convert it to a float 3x4 matrix. The data after the conversion is the same that is shown in the Rtabmap Database Viewer, so this step works fine
3) append a 0 0 0 1 row to the matrix
4) read rgb and depth for the same ID and create a point cloud
5) transform the point cloud by the 4x4 matrix from 3) by using pcl::transformPointCloud:
    Eigen::Matrix<double,4,4> T;
    cv::cv2eigen(transform, T);
    PointCloud::Ptr cloud(new PointCloud);
    pcl::transformPointCloud(*tmp, *cloud, T);

This approach works with the dataset "7 scenes" if I read the images from and poses from files. But for data produced by Rtabmap I cannot get the clouds properly aligned to each other.