代码之家  ›  专栏  ›  技术社区  ›  MIRMIX

基于TUM RGB-D基准的基于位姿图的ElasticFusion Slam算法

  •  1
  • MIRMIX  · 技术社区  · 7 年前

    TUM RGB-D SLAM Dataset and Benchmark “.klg”

    enter image description here

    现在我想通过已经构建的轨迹信息构建三维重建。 “.freibrug” 并通过ElasticFusion将其转换为所需的格式。我只是通过将时间戳乘以1000000,将时间戳从秒改为微秒 "," 而不是 “”空格

    /path_to_EF/./ElasticFusion -l /path_to_data/rgbd_dataset_freiburg1_desk/test2.klg -p /path_to_data/rgbd_dataset_freiburg1_desk/modified_freiburg.txt
    

    我希望得到相同的点云。但我在给定数据下得到的结果与预期相差甚远。

    enter image description here

    正如你们所见,它的精度和重建水平远不如前一次运行。 我对轨迹没有问题。下图显示,我从上一次运行中检索到的轨迹接近TUM RGB-D基准提供的地面实况数据。

    enter image description here

    好的建议和回答将不胜感激。

    2 回复  |  直到 7 年前
        1
  •  0
  •   nickhei1201    3 年前

    我成功地用轨迹文件运行了代码 (时间戳应为整数,并用空格分隔所有参数) 修改 ElasticFusion/GUI/src/Tools/GroundTruthOdometry.cpp

    void GroundTruthOdometry::loadTrajectory(const std::string & filename)
    {
        std::ifstream file;
        std::string line;
        file.open(filename.c_str());
        while (!file.eof())
        {
            unsigned long long int utime;
            float x, y, z, qx, qy, qz, qw;
            std::getline(file, line);
            int n = sscanf(line.c_str(), "%llu %f %f %f %f %f %f %f", &utime, &x, &y, &z, &qx, &qy, &qz, &qw);
    
            if(file.eof())
                break;
    
            assert(n == 8);
    
            Eigen::Quaternionf q(qw, qx, qy, qz);
            Eigen::Vector3f t(x, y, z);
    
            Eigen::Isometry3f T;
            T.setIdentity();
            T.pretranslate(t).rotate(q);
            camera_trajectory[utime] = T;
        }
    }
    
    Eigen::Matrix4f GroundTruthOdometry::getTransformation(uint64_t timestamp)
    {
        Eigen::Matrix4f pose = Eigen::Matrix4f::Identity();
    
        if(last_utime != 0)
        {
            std::map<uint64_t, Eigen::Isometry3f>::const_iterator it = camera_trajectory.find(last_utime);
            if (it == camera_trajectory.end())
            {
                last_utime = timestamp;
                return pose;
            }
    
    
            pose = camera_trajectory[timestamp].matrix();
        }
        else
        {
            std::map<uint64_t, Eigen::Isometry3f>::const_iterator it = camera_trajectory.find(timestamp);
            Eigen::Isometry3f ident = it->second;
            pose = Eigen::Matrix4f::Identity();
            camera_trajectory[last_utime] = ident;
        }
    
        last_utime = timestamp;
    
        return pose;
    }
    

        2
  •  -1
  •   MIRMIX    7 年前

    我做了三次扫描:从左到右,从下到上,从后到前。我观察到,思想轨迹文件似乎是正确的,建设是错误的。当我在x轴上移动相机时,在EF上它在z轴上移动,其他的情况类似。我试图手动找到转换矩阵。我将此转换应用于平移和旋转。之后它开始工作。