ROS Answers: Open Source Q&A Forum - RSS feedhttps://answers.ros.org/questions/Open source question and answer forum written in Python and DjangoenROS Answers is licensed under Creative Commons Attribution 3.0Wed, 08 May 2013 21:52:45 -0500Concatenating relative transformations to obtain a global transformationhttps://answers.ros.org/question/62436/concatenating-relative-transformations-to-obtain-a-global-transformation/Hi guys,
I am trying to implement a visual odometry system that matches features viewed by sequential frames and calculating the rigid body transformation between the corresponding points using RANSAC. I am successfully obtaining the ransac transformation that aligns the points obtained by the two frames. The relative transformation is of type `Eigen::Matrix4f relative_transformation `. I would like to concatenate (sum up) all the relative transformation in order to obtain a global transformation. I don't think I am doing it correctly:
//class attributes
Eigen::Matrix4f global_transformation== Eigen::Matrix4f::Identity(4,4);;
Eigen::Matrix4f relative_transformation;
tf::Transform transform;
void process(){
relative_transformation=calculate_ransac_relative_transformation();
global_transformation = global_transformation*relative_transformation;
Eigen::Matrix4d global_transformation_(global_transformation.cast<double>());
Eigen::Affine3d affine(global_transformation_);
tf::TransformEigenToTF(affine, transform);
static tf::TransformBroadcaster br;
br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "/odom", "Global_transformation"));
}
When viewing the transformation in RVIZ, it keeps jumping around even if the camera is not moving. Any idea what I am doing wrong?
Any help would be much appreciated.
Thanks,
Khalid
K_YousifWed, 08 May 2013 21:52:45 -0500https://answers.ros.org/question/62436/