I just updated my GLIM docker with latest push to support intensity and after I installed extensiosn with the aim to test Scan Context.
Installation was quite an emotional rollercoster but finally got it to compile.
Since the last update modifies the point format some small modifications are required in the cpp in SRC aswell as in Thirparty folders.
Once normals & time are added this xyz format would also require to be updated
// === REQUIRED CHANGES TO COMPILE WITH CURRENT SCAN CONTEXT ===
//
// 1) Scan Context now requires pcl::PointXYZI (intensity)
// makeAndSaveScancontextAndKeys() no longer accepts pcl::PointXYZ.
// Intensity is NOT used by Scan Context, but the type is required.
//
// BEFORE:
// pcl::PointCloud<pcl::PointXYZ> cloud;
// sc->makeAndSaveScancontextAndKeys(cloud);
//
// AFTER:
pcl::PointCloud<pcl::PointXYZ> cloud;
cloud.resize(frame->size());
for (int i = 0; i < frame->size(); i++) {
cloud.at(i).getVector4fMap() = frame->points[i].cast<float>();
}
pcl::PointCloud<pcl::PointXYZI> cloud_i;
pcl::copyPointCloud(cloud, cloud_i); // XYZ -> XYZI (intensity = 0)
sc->makeAndSaveScancontextAndKeys(cloud_i);
// 2) SC_DIST_THRES is now read-only / const
// This line must be removed or it will not compile.
//
// REMOVED:
// sc->SC_DIST_THRES = 0.2;
// 3) Fix warning: non-void function without return (xy2theta)
float xy2theta(const float& _x, const float& _y) {
if (_x >= 0 && _y >= 0)
return (180 / M_PI) * atan(_y / _x);
if (_x < 0 && _y >= 0)
return 180 - ((180 / M_PI) * atan(_y / (-_x)));
if (_x < 0 && _y < 0)
return 180 + ((180 / M_PI) * atan(_y / _x));
if (_x >= 0 && _y < 0)
return 360 - ((180 / M_PI) * atan((-_y) / _x));
return 0.0f; // safety return
}
1) In your own source: `src/glim_ext/scan_context_loop_detector.cpp`
- Convert pcl::PointXYZ -> pcl::PointXYZI before calling
`makeAndSaveScancontextAndKeys()`
- Remove the line setting `SC_DIST_THRES` (now read-only)
2) In third-party ScanContext: `thirdparty/scancontext/cpp/module/Scancontext/Scancontext.cpp`
- Add a `return` in `xy2theta()` to fix "control reaches end of non-void function" warning
I did so guided by Copilot so beware of that, but so far it seems to detect loops but since my overlap are minimal seems that is not working good enough.
I just updated my GLIM docker with latest push to support intensity and after I installed extensiosn with the aim to test Scan Context.
Installation was quite an emotional rollercoster but finally got it to compile.
Since the last update modifies the point format some small modifications are required in the cpp in SRC aswell as in Thirparty folders.
Once normals & time are added this xyz format would also require to be updated
I did so guided by Copilot so beware of that, but so far it seems to detect loops but since my overlap are minimal seems that is not working good enough.