$ show datawhalechina/smoothly-vslam
This repository is an educational tutorial implementation of a stereo visual SLAM (Simultaneous Localization and Mapping) system, based on the classic feature-point method (ORB/GFTT) with optical flow tracking, PnP pose estimation, and local bundle adjustment using g2o. It is structured as a modular C++ library (libmyslam.so) with components for frontend, backend, map management, camera model, dataset reading, and Pangolin-based 3D visualization. The primary entry point is a CLI application that processes KITTI stereo sequences to estimate camera trajectory and sparse 3D map points. While the code demonstrates solid software engineering practices such as threading, singletons, and factory methods, it is not production-ready: it lacks loop closure, map persistence, and comprehensive testing. The repository serves as a hands-on companion to the 'Visual SLAM: From Theory to Practice' textbook, with documentation and chapter-wise code examples. External dependencies include OpenCV, Eigen, Sophus, g2o, Pangolin, and Glog, with version-specific requirements that may cause compatibility issues on modern systems.
The LLM identified 2 files worth highlighting for reuse:
The Camera class encapsulates a pinhole stereo camera model with intrinsic parameters (fx, fy, cx, cy, baseline) and provides methods for pixel-to-camera, camera-to-world, and world-to-camera coordinate transformations. It is self-contained, depends only on Eigen and Sophus, and can be extracted and reused in any project requiring a calibrated stereo camera model. The implementation is clean and follows a straightforward interface.
This header provides a lightweight triangulation function using Singular Value Decomposition (SVD) to compute 3D points from two camera poses and corresponding normalized coordinates. It also includes a utility to convert Eigen vectors to cv::KeyPoint format. The functions are small, dependency-free (only Eigen and OpenCV), and implement a fundamental computer vision operation that can be reused in any multi-view geometry project.