rtabmap odometryBOW

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

rtabmap odometryBOW

JaneLee
Hi~
  I was reading the odometryBOW code, I find newSignature word3d is set relative to base_link  frame, while the localmap_ is set relative to odom frame. I found that the odometry method here eventually used the eigen::umeyama() function, but the input parameters should be set relative to odom frame to compute the transform. I also found the commented code,listed below:
// transform new words in local map referential
//inliers2 = util3d::transformPointCloud<pcl::PointXYZ>(inliers2, this->getPose());
Could you please explain it in details? Thank you!
Reply | Threaded
Open this post in threaded view
|

Re: rtabmap odometryBOW

matlabbe
Administrator
The referred comment is not in the recent versions anymore, but the same way is still done. Here is the old code referred (v0.8.3):
[...]

// transform new words in local map referential
//inliers2 = util3d::transformPointCloud<pcl::PointXYZ>(inliers2, this->getPose());

// the transform returned is global odometry pose, not incremental one
std::vector<int> inliersV;
transform = util3d::transformFromXYZCorrespondences(
	inliers2,
	inliers1,
	this->getInlierDistance(),
	this->getIterations(),
	this->getRefineIterations()>0, 3.0, this->getRefineIterations(),
	&inliersV,
	&variance);

inliers = (int)inliersV.size();
if(!transform.isNull())
{
	// make it incremental
	transform = this->getPose().inverse() * transform;

[...]

We don't have to transform the inliers2 in the odom frame, the returned transform returns the actual pose of the camera in odom frame. To make the transform incremental (transform between the last and the new camera pose), this is done on this line:
transform = this->getPose().inverse() * transform;

For example, if we transform the inliers2 cloud in odom frame before computing the transform, we have directly the transform between old pose and new pose (don't need to make it incremental). The computation cost of the first method imply only a transform multiplication and avoid the prior transformation of the all points of inliers2.
Reply | Threaded
Open this post in threaded view
|

Re: rtabmap odometryBOW

JaneLee
Thank you~I found the problem lies in that I don't clearly know the visual odometry theory. The umeyama() function compute two clouds transfomation in the sam frame, it can also be applied to different frames. If one cloud is set relative to the odom frame, the second cloud is set relative to camera frame, the result is the transform of the second cloud in odom frame!