mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-06 10:07:47 +08:00
Added Ground truth import GPS format. Alignement between estimated and ground truth poses is done with SVD.
This commit is contained in:
@@ -33,6 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <pcl/registration/icp.h>
|
||||
#include <pcl/registration/transformation_estimation_2D.h>
|
||||
#include <pcl/registration/transformation_estimation_svd.h>
|
||||
#include <pcl/sample_consensus/sac_model_registration.h>
|
||||
#include <pcl/sample_consensus/ransac.h>
|
||||
#include <rtabmap/utilite/ULogger.h>
|
||||
@@ -43,6 +44,19 @@ namespace rtabmap
|
||||
namespace util3d
|
||||
{
|
||||
|
||||
// Get transform from cloud2 to cloud1
|
||||
Transform transformFromXYZCorrespondencesSVD(
|
||||
const pcl::PointCloud<pcl::PointXYZ> & cloud1,
|
||||
const pcl::PointCloud<pcl::PointXYZ> & cloud2)
|
||||
{
|
||||
pcl::registration::TransformationEstimationSVD<pcl::PointXYZ, pcl::PointXYZ> svd;
|
||||
|
||||
// Perform the alignment
|
||||
Eigen::Matrix4f matrix;
|
||||
svd.estimateRigidTransformation(cloud1, cloud2, matrix);
|
||||
return Transform::fromEigen4f(matrix);
|
||||
}
|
||||
|
||||
// Get transform from cloud2 to cloud1
|
||||
Transform transformFromXYZCorrespondences(
|
||||
const pcl::PointCloud<pcl::PointXYZ>::ConstPtr & cloud1,
|
||||
|
||||
Reference in New Issue
Block a user