VOD-SLAM 复现 AirDos 复现

VOD-SLAM 复现

参考:https://www.mianshigee.com/project/halajun-VDO_SLAM/
下载:

git clone https://github.com/halajun/VDO_SLAM.git VDO-SLAM

CSparse 库安装

sudo apt-get install libsuitesparse-dev

解决:fatal error: opencv2/xfeatures2d.hpp: No such file or directory
把Frame.cc里面的
xfeatures2d.hpp改为features2d.hpp

// #include问题
直接注释掉,把函数换为下面的函数

cv::Mat readFlowFile(const std::string& fileName) {
    cv::Mat flow;
    std::ifstream file(fileName, std::ios::binary);
    if (!file.is_open()) {
        std::cerr << "Failed to open file: " << fileName << std::endl;
        return flow;
    }
    int tag;
    file.read((char*) &tag, sizeof(int));
    int width, height;
    file.read((char*) &width, sizeof(int));
    file.read((char*) &height, sizeof(int));
    flow.create(height, width, CV_32FC2);

    for (int i = 0; i < height; ++i) {
        for (int j = 0; j < width; ++j) {
            float f[2];
            file.read((char*) f, sizeof(float) * 2);
            // float* data = flo.ptr<float>(i, j);
            flow.at<cv::Vec2f>(i, j) = cv::Vec2f(f[0], f[1]);
        }
    }
    file.close();
    return flow;
}

AirDos 复现

下载:

git clone https://github.com/haleqiu/AirDOS.git

把ORB-SLAM2的ORBvoc.txt移动到VOcabulary中

编译

./build.sh

运行
按照对应文件的要求
例如:

./Examples/Stereo/stereo_kitti Vocabulary/ORBvoc.txt Examples/Stereo/KITTI00-02.yaml /media/ql/u1/Dataset/KITTI/dataset/sequences/00 ./Results/00.txt

你可能感兴趣的:(VSLAM,代码复现,python)