{"id":35269345,"url":"https://github.com/abhishekprajapatt/slamcore","last_synced_at":"2026-04-29T23:32:19.151Z","repository":{"id":328587497,"uuid":"1115911355","full_name":"abhishekprajapatt/slamcore","owner":"abhishekprajapatt","description":"🗺️ slamcore - A lightweight, production-grade simultaneous localization and mapping (SLAM) system designed for ROS2 (Humble/Iron) with comprehensive support for multi-sensor fusion, loop closure detection, and real-time map building.","archived":false,"fork":false,"pushed_at":"2025-12-14T06:05:52.000Z","size":49,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-16T08:07:38.092Z","etag":null,"topics":["cmake","cpp","python","shell"],"latest_commit_sha":null,"homepage":"https://github.com/abhishekprajapatt/slamcore","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abhishekprajapatt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-13T20:03:27.000Z","updated_at":"2025-12-14T07:07:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/abhishekprajapatt/slamcore","commit_stats":null,"previous_names":["abhishekprajapatt/slamcore"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/abhishekprajapatt/slamcore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhishekprajapatt%2Fslamcore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhishekprajapatt%2Fslamcore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhishekprajapatt%2Fslamcore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhishekprajapatt%2Fslamcore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abhishekprajapatt","download_url":"https://codeload.github.com/abhishekprajapatt/slamcore/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhishekprajapatt%2Fslamcore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32448399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"ssl_error","status_checked_at":"2026-04-29T22:10:49.234Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmake","cpp","python","shell"],"created_at":"2025-12-30T11:53:27.988Z","updated_at":"2026-04-29T23:32:19.146Z","avatar_url":"https://github.com/abhishekprajapatt.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Slamcore (ROS2): Multi-Sensor SLAM System\n\nA lightweight, production-grade simultaneous localization and mapping (SLAM) system designed for ROS2 (Humble/Iron) with comprehensive support for multi-sensor fusion, loop closure detection, and real-time map building.\n\n## Overview\n\nSlamcore implements a complete SLAM pipeline combining LiDAR odometry, visual odometry, and IMU preintegration through a loosely-coupled multi-sensor architecture. The system performs real-time pose graph optimization to maintain consistency and detect loop closures for trajectory refinement. Designed for simulation-first validation, it provides benchmarking tools for evaluation against public datasets like KITTI and TUM RGB-D.\n\n## Architecture\n\n### Front-End Processing\n\n- **LiDAR Odometry**: Scan-to-scan registration via iterative closest point (ICP) with configurable convergence parameters\n- **Visual Odometry**: Feature detection, matching, and motion estimation using essential matrix decomposition\n- **IMU Preintegration**: Continuous acceleration and angular velocity integration with bias estimation\n\n### Back-End Optimization\n\n- **Pose Graph Construction**: Incremental frame nodes with odometry constraints\n- **Loop Closure Detection**: Descriptor-based similarity matching with configurable thresholds\n- **Optimization**: g2o-based pose graph optimization with local bundle adjustment\n- **Robust Kernels**: Huber kernel weighting for loop closure constraints\n\n### Mapping \u0026 Visualization\n\n- **2D Occupancy Grid**: Voxel-based environment representation\n- **3D Point Cloud**: Accumulation and downsampling for sparse map representation\n- **Real-Time Publishing**: Continuous map updates at configurable frequencies\n- **RViz2 Integration**: Full visualization support for trajectories, maps, and constraints\n\n## System Requirements\n\n### Build Dependencies\n\n- **OS**: Ubuntu 20.04 (Focal) or later\n- **ROS2**: Humble or Iron\n- **Compiler**: GCC 9+ or Clang 10+ with C++20 support\n- **Build System**: CMake 3.20+, colcon\n\n### Runtime Dependencies\n\n- Gazebo Harmonic (for simulation)\n- OpenCV 4.5+\n- PCL 1.12+\n- Eigen3\n- g2o\n- yaml-cpp\n- TF2\n\n### Hardware (Minimal)\n\n- 4GB RAM\n- 2-core CPU (real-time performance on 8+ cores)\n- No GPU required (optional for acceleration)\n\n## Installation \u0026 Build\n\n### 1. Clone Repository\n\n```bash\nmkdir -p ~/slamcore_ws/src\ncd ~/slamcore_ws/src\ngit clone https://github.com/abhishekprajapatt/slamcore.git\ncd slamcore\n```\n\n### 2. Install Dependencies\n\n```bash\nsudo apt update\nsudo apt install -y \\\n  ros-humble-desktop \\\n  ros-humble-gazebo-ros-pkgs \\\n  ros-humble-image-transport \\\n  libopencv-dev \\\n  libpcl-dev \\\n  libeigen3-dev \\\n  libyaml-cpp-dev \\\n  libopenscenegraph-dev\n```\n\nFor g2o:\n\n```bash\nsudo apt install -y libeigen3-dev libsuitesparse-dev qtdeps\ngit clone https://github.com/RainerKuemmerl/g2o.git\ncd g2o \u0026\u0026 mkdir build \u0026\u0026 cd build\ncmake .. \u0026\u0026 make -j4\nsudo make install\n```\n\n### 3. Build Slamcore\n\n```bash\ncd ~/slamcore_ws\ncolcon build --symlink-install\nsource install/setup.bash\n```\n\nOr use the convenience script:\n\n```bash\ncd ~/slamcore_ws/src/slamcore\nbash scripts/build.sh\nsource ../../install/setup.bash\n```\n\n## Quick Start: Gazebo Simulation\n\n### 1. Launch Simulation Environment\n\n```bash\nros2 launch slamcore gazebo_slam.launch.py gui:=true\n```\n\nThis launches:\n\n- Gazebo with slam_world environment (bounded room with obstacles)\n- Differential-drive robot with LiDAR, camera, and IMU\n- All SLAM processing nodes (frontend, backend, mapping)\n\n### 2. Launch Visualization\n\nIn another terminal:\n\n```bash\nsource install/setup.bash\nros2 launch slamcore rviz.launch.py\n```\n\n### 3. Command Robot Motion\n\nPublish velocity commands to drive the robot and observe SLAM in action:\n\n```bash\nros2 topic pub /cmd_vel geometry_msgs/msg/Twist \\\n  '{linear: {x: 0.5, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.1}}'\n```\n\n### 4. Monitor Output\n\n- **RViz2**: Displays map, trajectory, odometry, and point cloud\n- **Terminal**: Node logs show frontend processing, loop closures, optimization iterations\n\n## Dataset Evaluation\n\n### KITTI Sequence Evaluation\n\n```bash\nsource install/setup.bash\n\npython3 scripts/benchmark_kitti.py kitti-sequence /path/to/kitti 0 --output-dir results/\n\nros2 bag play /path/to/kitti/00.bag\n\npython3 scripts/evaluate_trajectory.py results/estimated_trajectory.csv \\\n  /path/to/kitti/poses/00.txt --output-dir results/benchmarks\n```\n\n### TUM RGB-D Evaluation\n\n```bash\nros2 bag play /path/to/tum/rgbd_dataset_freiburg3_long_office_household.bag\n\npython3 scripts/evaluate_trajectory.py results/trajectory.csv \\\n  /path/to/tum/groundtruth.txt --output-dir results/benchmarks\n```\n\n### Format for EVO Tool\n\n```bash\npython3 scripts/evaluate_trajectory.py trajectory.csv ground_truth.txt \\\n  --format-for-evo trajectory_evo.tum\nevo_traj tum trajectory_evo.tum --plot\n```\n\n## Configuration\n\nEdit `config/params.yaml` to customize system behavior:\n\n```yaml\nsensor_fusion:\n  lidar_weight: 1.0 # LiDAR contribution weight\n  camera_weight: 1.0 # Camera contribution weight\n  imu_weight: 0.5 # IMU contribution weight\n\nfrontend:\n  lidar_max_range: 30.0 # LiDAR maximum range (m)\n  icp_max_iterations: 50 # ICP max iterations per scan\n  icp_fitness_threshold: 0.01 # ICP convergence tolerance\n\n  camera_enable: true\n  optical_flow_max_features: 200\n\nbackend:\n  optimization_frequency: 5.0 # Pose graph optimization rate (Hz)\n  g2o_iterations: 20 # G2O solver iterations\n\nloop_closure:\n  enabled: true\n  min_score: 0.7 # Loop detection confidence threshold\n  min_keyframe_separation: 10 # Minimum frames between loop constraints\n\nmapping:\n  grid_resolution: 0.1 # Occupancy grid cell size (m)\n  grid_max_range: 20.0 # Maximum range for map updates\n  publish_frequency: 2.0 # Map publishing rate (Hz)\n```\n\n## ROS2 Topics\n\n### Inputs\n\n| Topic                 | Message Type           | Description                 |\n| --------------------- | ---------------------- | --------------------------- |\n| `/scan`               | sensor_msgs/LaserScan  | 2D LiDAR scans              |\n| `/camera/image_raw`   | sensor_msgs/Image      | RGB/Grayscale camera images |\n| `/camera/camera_info` | sensor_msgs/CameraInfo | Camera calibration          |\n| `/imu/data`           | sensor_msgs/Imu        | Inertial measurement unit   |\n\n### Outputs\n\n| Topic                 | Message Type            | Description                       |\n| --------------------- | ----------------------- | --------------------------------- |\n| `/odometry/lidar`     | nav_msgs/Odometry       | Front-end LiDAR odometry          |\n| `/odometry/visual`    | nav_msgs/Odometry       | Front-end visual odometry         |\n| `/odometry/filtered`  | nav_msgs/Odometry       | Fused odometry estimate           |\n| `/odometry/optimized` | nav_msgs/Odometry       | Backend-optimized odometry        |\n| `/map`                | nav_msgs/OccupancyGrid  | 2D occupancy grid map             |\n| `/map_cloud`          | sensor_msgs/PointCloud2 | 3D point cloud map                |\n| `/loop_closure_edges` | geometry_msgs/PoseArray | Detected loop closure constraints |\n\n## Nodes\n\n| Node              | Executable               | Function                        |\n| ----------------- | ------------------------ | ------------------------------- |\n| Lidar Odometry    | `lidar_odometry_node`    | Scan-to-scan registration       |\n| Visual Odometry   | `visual_odometry_node`   | Feature-based motion estimation |\n| IMU Integration   | `imu_integration_node`   | Sensor preintegration           |\n| Loop Closure      | `loop_closure_node`      | Loop constraint detection       |\n| Backend Optimizer | `backend_optimizer_node` | Pose graph optimization         |\n| Map Builder       | `map_builder_node`       | Occupancy grid and point cloud  |\n\n## Benchmark Results\n\n### Gazebo Simulation (slam_world)\n\n- **Robot Path**: 50m loop trajectory\n- **Processing**: Real-time on 4-core CPU\n- **Loop Closure**: Detected at ~90% confidence\n- **Map Coverage**: 97% of simulated environment\n\n### KITTI Sequence 00 (Reference)\n\n- **Trajectory Length**: 3.7 km\n- **APE (Mean)**: ~0.15 m\n- **RPE (Mean)**: ~0.05 m / 100m\n- **Runtime**: 0.3x real-time (depends on optimization frequency)\n\n**Note**: Exact results depend on parameter tuning, sensor noise, and hardware. These are representative values.\n\n## Code Structure\n\n```\nslamcore/\n├── include/slamcore/slam.hpp          # Core class definitions\n├── src/\n│   ├── frontend_lidar.cpp             # LiDAR odometry\n│   ├── frontend_visual.cpp            # Visual odometry\n│   ├── imu_integration.cpp            # IMU processing\n│   ├── backend_optimizer.cpp          # Pose graph optimization\n│   ├── loop_closure.cpp               # Loop closure detection\n│   ├── map_builder.cpp                # Map construction\n│   ├── frame.cpp                      # Frame data structure\n│   └── nodes/                         # ROS2 node implementations\n├── launch/\n│   ├── gazebo_slam.launch.py          # Full simulation launch\n│   └── rviz.launch.py                 # Visualization launch\n├── config/\n│   ├── params.yaml                    # System parameters\n│   └── rviz_config.rviz               # RViz configuration\n├── worlds/slam_world.sdf              # Gazebo environment\n├── models/slam_robot.urdf.xacro       # Robot URDF\n├── scripts/\n│   ├── benchmark_kitti.py             # Dataset utilities\n│   ├── evaluate_trajectory.py         # Trajectory evaluation\n│   ├── build.sh                       # Build script\n│   └── run_demo.sh                    # Demo launcher\n├── tests/\n│   └── test_frame.cpp                 # Unit tests\n├── CMakeLists.txt                     # Build configuration\n├── package.xml                        # ROS2 package metadata\n├── LICENSE                            # MIT License\n└── README.md                          # This file\n```\n\n## Core Algorithms\n\n### Frontend: Scan Matching\n\n- Algorithm: Iterative Closest Point (ICP) with Euclidean distance\n- Convergence: Fitness threshold on point cloud alignment error\n- Frequency: On every LiDAR scan (~10 Hz)\n\n### Frontend: Visual Odometry\n\n- Features: ORB descriptors (fast, rotation-invariant)\n- Matching: Brute-force descriptor matching with RANSAC\n- Motion: Essential matrix decomposition for R,t estimation\n- Frequency: On every image (~30 Hz)\n\n### Backend: Pose Graph Optimization\n\n- Solver: g2o with Levenberg-Marquardt optimization\n- Variables: SE(3) poses for each keyframe\n- Constraints: Odometry edges + loop closure edges\n- Robustness: Huber kernel for outlier rejection\n\n### Loop Closure: Descriptor Matching\n\n- Method: Similarity-based candidate selection\n- Descriptor: ORB features from camera images\n- Verification: Ransac-based pose refinement\n- Minimum Separation: Configurable temporal gap\n\n## Limitations \u0026 Future Work\n\n### Current Limitations\n\n- **Simulation-Only**: Designed for Gazebo validation; real hardware integration requires sensor drivers\n- **Single-Robot**: No multi-robot support\n- **No Real-Time Guarantees**: Processing time scales with environment complexity and loop closure frequency\n- **Limited Loop Closure**: Descriptor-based approach; no global localization\n- **No Relocalization**: Cannot recover from tracking loss\n\n### Planned Features\n\n- 3D LiDAR support (point cloud registration)\n- Place recognition with bag-of-words\n- IMU-camera-LiDAR tightly-coupled fusion\n- Octomap support for 3D volumetric mapping\n- ROS2 humble → Iron migration validation\n- Distributed multi-robot variants\n\n## Performance Tuning\n\n### For Speed\n\n1. Reduce `icp_max_iterations` (e.g., 20)\n2. Increase `icp_fitness_threshold` (e.g., 0.05)\n3. Decrease `optimization_frequency` (e.g., 2 Hz)\n4. Enable keyframe selection (not yet implemented)\n\n### For Accuracy\n\n1. Increase `icp_max_iterations` (e.g., 100)\n2. Decrease `icp_fitness_threshold` (e.g., 0.001)\n3. Increase `optimization_frequency` (e.g., 10 Hz)\n4. Lower `loop_closure_min_score` (e.g., 0.6)\n\n## Testing\n\n### Unit Tests\n\n```bash\ncolcon test --packages-select slamcore\n```\n\n### Integration Tests (Manual)\n\n1. Launch `gazebo_slam.launch.py`\n2. Publish motion commands\n3. Verify `/odometry/*` topics output\n4. Check `/map` for occupancy grid updates\n\n## Contributing\n\nContributions are welcome. Please ensure:\n\n- Code compiles cleanly with `-Wall -Wextra -Wpedantic`\n- Follow existing naming conventions (snake_case functions, PascalCase classes)\n- Add tests for new functionality\n- Update parameters in `config/params.yaml` for new tunable parameters\n\n## Citation\n\nIf you use Slamcore in research, please cite:\n\n```\n@software{slamcore2025,\n  title={Slamcore: Multi-Sensor SLAM for ROS2},\n  author={Abhishek Prajapatt},\n  year={2025},\nurl={https://github.com/abhishekprajapatt/slamcore}\n```\n\n## License\n\nMIT License – See LICENSE file for details.\n\n## Support \u0026 Issues\n\nFor bug reports and feature requests, visit the [GitHub Issues](https://github.com/abhishekprajapatt/slamcore/issues) page.\n\n## Related Work\n\n- **ORB-SLAM2/3**: Feature-based visual SLAM (closed-source reference)\n- **LOAM**: LiDAR-only SLAM with local-to-global optimization\n- **iSAM2**: Incremental smoothing and mapping (g2o foundation)\n- **Cartographer**: Multi-sensor SLAM by Google\n- **LIO-SAM**: Tightly-coupled LiDAR-Inertial odometry\n\n---\n\nBuilt with ❤️ for the robotics community. Star this repo if it helps your research!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhishekprajapatt%2Fslamcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhishekprajapatt%2Fslamcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhishekprajapatt%2Fslamcore/lists"}