-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathorbSlam.cpp
More file actions
60 lines (49 loc) · 1.68 KB
/
orbSlam.cpp
File metadata and controls
60 lines (49 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
* @file :orbSlam.cpp
* @brief :C语言接口
* @details :This is the detail description.
* @date :2023/05/06 16:18:55
* @author :cuixingxing(cuixingxing150@gmail.com)
* @version :1.0
*
* @copyright Copyright (c) 2023
*
*/
#include "orbSlam.h"
#include "HDMapping.h"
#include "opencvAPI.h"
#include "constructWorldMap_types.h"
#include "rt_nonfinite.h"
#include "coder_array.h"
#include <iostream>
#include <fstream>
#include "opencv2/opencv.hpp"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct HDMappingWrapper {
buildMapping::HDMapping* HDMapping;
// 定义输入输出参数
buildMapping::struct0_T inputArgs;
buildMapping::struct1_T inputOutputStruct;
} HDMappingWrapper;
static HDMappingWrapper obj;
HDMappingWrapper* InitInstance(const char* allDataFolder) {
obj.inputOutputStruct.isBuildMap = true;
obj.inputOutputStruct.buildMapStopFrame = 1118; // 此处应当对应用户“建图结束”按钮响应
return &obj;
}
void buildMap(HDMappingWrapper* pOrbSlamHandle, cv::Mat& bevImage) {
assert(bevImage.rows == 480 && bevImage.cols == 640 && bevImage.channels() == 1);
convertCVToMatrix(bevImage, bevImage.rows, bevImage.cols, bevImage.channels(), pOrbSlamHandle->inputArgs.undistortImage);
// 建图
pOrbSlamHandle->HDMapping->constructWorldMap(&(pOrbSlamHandle->inputArgs), &(pOrbSlamHandle->inputOutputStruct));
// cv::Mat HDMapImg;
// convertToMat(inputOutputStruct.HDmap.bigImg.data(), inputOutputStruct.HDmap.bigImg.size(0), inputOutputStruct.HDmap.bigImg.size(1), 1, HDMapImg);
}
void UnInitHDMapping(HDMappingWrapper* pOrbSlamHandle) {
delete pOrbSlamHandle;
}
#ifdef __cplusplus
};
#endif