How mit-spark/kimera-vio works
Main Components
• Sensors & Data Input: Indicate two primary sensor inputs—cameras (Stereo/Mono) and IMU. Show that raw sensor data is first ingested by one or more DataProvider modules.
• DataProvider Module: Include components such as EurocDataProvider, KittiDataProvider, and specialized modules for stereo, mono, or RGBD data. Represent the role of this component in pre-processing and interfacing raw sensor data with the remaining pipeline.
• Frontend Processing:
• Feature Detection & Optical Flow: Highlight modules for feature detection (including the adaptive non-max suppression portion found under “feature-detector”) and optical-flow computation.
• Vision-IMU Frontend: Show modules like MonoVisionImuFrontend, StereoVisionImuFrontend, and RgbdVisionImuFrontend which combine visual measurements and inertial data.
• Tracker & Undistorter: Represent related components (e.g., Tracker, UndistorterRectifier) that work in the image-processing chain.
• Inertial (IMU) Frontend: Represent the “imu-frontend” module that processes IMU data separately before (or in parallel with) fusion.
• Pipeline Integration:
• Pipeline Modules: Illustrate how data flows from the various frontends into unified pipelines. There are distinct pipelines such as MonoImuPipeline, StereoImuPipeline, and RgbdImuPipeline that aggregate the pre-processed data.
• Queue Synchronizer: Since the pipeline must coordinate inputs (image, IMU, etc.), include a representation of queues and synchronizers as depicted by the log outputs (e.g., “stereo_frontend_input_queue”).
• Backend Optimization:
• Regular VIO Backend: Include the backend components that handle the optimization (as found under “backend”), factor graph management, and modules dedicated to regularization.
• Loop Closure Detector: Represent modules responsible for loop closure detection as an optional but significant sub-system.
• Initialization & Calibration: Separate the “initial” module components (i.e., InitializationBackend, CrossCorrTimeAligner, OnlineGravityAlignment) that manage system initialization and sensor calibration.
• Mesh & 3D Reconstruction: Show the mesh-related modules (under “mesh”) that construct 3D representations and possibly optimize them.
• Visualization & Logging:
• Visualizer: Represent the visual output modules (such as OpenCvDisplay, PangolinDisplay, Visualizer3D) that provide realtime feedback.
• Logger: Include a logging subsystem that records runtime data, as seen in the detailed logging provided in the README.
• Parameter & Configuration Management:
• YAML Parameters: Utilize the “params” folder to indicate that a range of YAML configurations are used (for Backend, Frontend, IMU, cameras, etc.).
• Gflags: Note that runtime parameters are also managed via Gflags (as described in the README). Represent these as configuration inputs into modules.
Relationships and Interactions
• Synchronization & Queues: Emphasize that the system design includes asynchronous processing using named queues between modules (for example between the DataProvider and Frontend, and between Frontend and Backend).
Architectural Patterns and Design Principles
• Modular, Layered Architecture: Emphasize the separation of concerns between data ingestion, processing, optimization, and visualization.
• Plugin & Factory Design: Many modules (e.g., different VIO backends or frontend detectors) are instantiated via factories (as evidenced by files like “VioBackendFactory.h” and “MesherFactory.h”).
• Real-Time Processing: Highlight that modules communicate via well-defined interfaces and queues to provide sequential or parallel processing (as noted in the “parallel_run” flag and unit testing details).
Putting It All Together—Step-by-Step
1. Two main sensor blocks labeled “Cameras (stereo/mono)” and “IMU”.
3. From DataProvider, split the flow into:
• “Frontend Processing” (showing sub-modules for feature detection, optical flow, and image preprocessing).
• “IMU Frontend” (processing inertial data).
4. Merge these flows into the “Pipeline Module” block:
• Inside this block, illustrate the synchronization mechanism (queues and synchronizers).
5. Unified pipeline to the “Backend” block:
• Inside the Backend, detail the “Regular VIO Backend”, and include a side-branch for “Loop Closure Detection” or graph optimization (using Kimera-RPGO).
• “Mesh & 3D Reconstruction Module” for optional 3D mapping.
• “Visualizer & Logger” blocks that provide user feedback and data logging.
8. Optionally, include external “Dependencies & Libraries” such as GTSAM, OpenCV, and others that support underlying functionalities.