{"id":13409625,"url":"https://github.com/koide3/hdl_graph_slam","last_synced_at":"2025-05-15T01:09:42.534Z","repository":{"id":41044962,"uuid":"115905660","full_name":"koide3/hdl_graph_slam","owner":"koide3","description":"3D LIDAR-based Graph SLAM","archived":false,"fork":false,"pushed_at":"2024-07-16T01:39:14.000Z","size":4046,"stargazers_count":2100,"open_issues_count":126,"forks_count":731,"subscribers_count":75,"default_branch":"master","last_synced_at":"2025-04-11T14:17:06.607Z","etag":null,"topics":["hdl-graph-slam","lidar","point-cloud","ros","rslidar","slam","velodyne"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koide3.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}},"created_at":"2018-01-01T07:35:43.000Z","updated_at":"2025-04-09T03:04:17.000Z","dependencies_parsed_at":"2024-06-14T03:29:16.421Z","dependency_job_id":"9da418a1-b755-4044-8e01-64cd641315d2","html_url":"https://github.com/koide3/hdl_graph_slam","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koide3%2Fhdl_graph_slam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koide3%2Fhdl_graph_slam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koide3%2Fhdl_graph_slam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koide3%2Fhdl_graph_slam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koide3","download_url":"https://codeload.github.com/koide3/hdl_graph_slam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254254043,"owners_count":22039792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["hdl-graph-slam","lidar","point-cloud","ros","rslidar","slam","velodyne"],"created_at":"2024-07-30T20:01:02.421Z","updated_at":"2025-05-15T01:09:37.525Z","avatar_url":"https://github.com/koide3.png","language":"C++","funding_links":[],"categories":["Awesome projects","C++","5 Localization and SLAM","4. LIDAR based SLAM","Simultaneous Localization and Mapping","Softwares and Libraries"],"sub_categories":["3.4 High Performance Inference","4.2 Others","Lidar"],"readme":"# New SLAM package is released\n\nA new 3D SLAM package is released: https://github.com/koide3/glim.\n\n# hdl_graph_slam\n***hdl_graph_slam*** is an open source ROS package for real-time 6DOF SLAM using a 3D LIDAR. It is based on 3D Graph SLAM with NDT scan matching-based odometry estimation and loop detection. It also supports several graph constraints, such as GPS, IMU acceleration (gravity vector), IMU orientation (magnetic sensor), and floor plane (detected in a point cloud). We have tested this package with Velodyne (HDL32e, VLP16) and RoboSense (16 channels) sensors in indoor and outdoor environments.\n\n\u003cimg src=\"imgs/hdl_graph_slam.png\" width=\"712pix\" /\u003e\n\n[![Build](https://github.com/koide3/hdl_graph_slam/actions/workflows/build.yml/badge.svg)](https://github.com/koide3/hdl_graph_slam/actions/workflows/build.yml) on melodic \u0026 noetic\n\n## Third-party extensions\n\nSee also the following nice works built upon hdl_graph_slam. Feel free to request to include your work in the list :)\n\n- Multi-Robot Mapping (ROS2) developed by [Andreas Serov](https://github.com/aserbremen) : [aserbremen/Multi-Robot-Graph-SLAM](https://github.com/aserbremen/Multi-Robot-Graph-SLAM)\n- [CURB-SG: Collaborative Dynamic 3D Scene Graphs](http://curb.cs.uni-freiburg.de/) developed by Elias Greve : [robot-learning-freiburg/CURB-SG](https://github.com/robot-learning-freiburg/CURB-SG)\n\n## Nodelets\n***hdl_graph_slam*** consists of four nodelets.\n\n- *prefiltering_nodelet*\n- *scan_matching_odometry_nodelet*\n- *floor_detection_nodelet*\n- *hdl_graph_slam_nodelet*\n\nThe input point cloud is first downsampled by *prefiltering_nodelet*, and then passed to the next nodelets. While *scan_matching_odometry_nodelet* estimates the sensor pose by iteratively applying a scan matching between consecutive frames (i.e., odometry estimation), *floor_detection_nodelet* detects floor planes by RANSAC. The estimated odometry and the detected floor planes are sent to *hdl_graph_slam*. To compensate the accumulated error of the scan matching, it performs loop detection and optimizes a pose graph which takes various constraints into account.\n\n\u003cimg src=\"imgs/nodelets.png\" width=\"712pix\" /\u003e\n\n## Constraints (Edges)\n\nYou can enable/disable each constraint by changing params in the launch file, and you can also change the weight (\\*_stddev) and the robust kernel (\\*_robust_kernel) of each constraint.\n\n- ***Odometry***\n\n- ***Loop closure***\n\n- ***GPS***\n  - */gps/geopoint* (geographic_msgs/GeoPointStamped)\n  - */gps/navsat* (sensor_msgs/NavSatFix)\n  - */gpsimu_driver/nmea_sentence* (nmea_msgs/Sentence)\n\nhdl_graph_slam supports several GPS message types. All the supported types contain (latitude, longitude, and altitude). hdl_graph_slam converts them into [the UTM coordinate](http://wiki.ros.org/geodesy), and adds them into the graph as 3D position constraints. If altitude is set to NaN, the GPS data is treated as a 2D constrait. GeoPoint is the most basic one, which consists of only (lat, lon, alt). Although NavSatFix provides many information, we use only (lat, lon, alt) and ignore all other data. If you're using HDL32e, you can directly connect *hdl_graph_slam* with *velodyne_driver* via */gpsimu_driver/nmea_sentence*.\n\n- ***IMU acceleration (gravity vector)***\n  - */gpsimu_driver/imu_data* (sensor_msgs/Imu)\n\nThis constraint rotates each pose node so that the acceleration vector associated with the node becomes vertical (as the gravity vector). This is useful to compensate for accumulated tilt rotation errors of the scan matching. Since we ignore acceleration by sensor motion, you should not give a big weight for this constraint.\n\n- ***IMU orientation (magnetic sensor)***\n  - */gpsimu_driver/imu_data* (sensor_msgs/Imu)\n\n  If your IMU has a reliable magnetic orientation sensor, you can add orientation data to the graph as 3D rotation constraints. Note that, magnetic orientation sensors can be affected by external magnetic disturbances. In such cases, this constraint should be disabled.\n\n- ***Floor plane***\n  - */floor_detection/floor_coeffs* (hdl_graph_slam/FloorCoeffs)\n\nThis constraint optimizes the graph so that the floor planes (detected by RANSAC) of the pose nodes becomes the same. This is designed to compensate the accumulated rotation error of the scan matching in large flat indoor environments.\n\n\n## Parameters\nAll the configurable parameters are listed in *launch/hdl_graph_slam.launch* as ros params.\n\n## Services\n- */hdl_graph_slam/dump*  (hdl_graph_slam/DumpGraph)\n  - save all the internal data (point clouds, floor coeffs, odoms, and pose graph) to a directory.\n- */hdl_graph_slam/save_map*  (hdl_graph_slam/SaveMap)\n  - save the generated map as a PCD file.\n\n## Requirements\n***hdl_graph_slam*** requires the following libraries:\n\n- OpenMP\n- PCL\n- g2o\n- suitesparse\n\nThe following ROS packages are required:\n\n- geodesy\n- nmea_msgs\n- pcl_ros\n- [ndt_omp](https://github.com/koide3/ndt_omp)\n- [fast_gicp](https://github.com/SMRT-AIST/fast_gicp)\n\n```bash\n# for melodic\nsudo apt-get install ros-melodic-geodesy ros-melodic-pcl-ros ros-melodic-nmea-msgs ros-melodic-libg2o\ncd catkin_ws/src\ngit clone https://github.com/koide3/ndt_omp.git -b melodic\ngit clone https://github.com/SMRT-AIST/fast_gicp.git --recursive\ngit clone https://github.com/koide3/hdl_graph_slam\n\ncd .. \u0026\u0026 catkin_make -DCMAKE_BUILD_TYPE=Release\n\n# for noetic\nsudo apt-get install ros-noetic-geodesy ros-noetic-pcl-ros ros-noetic-nmea-msgs ros-noetic-libg2o\n\ncd catkin_ws/src\ngit clone https://github.com/koide3/ndt_omp.git\ngit clone https://github.com/SMRT-AIST/fast_gicp.git --recursive\ngit clone https://github.com/koide3/hdl_graph_slam\n\ncd .. \u0026\u0026 catkin_make -DCMAKE_BUILD_TYPE=Release\n```\n\n**[optional]** *bag_player.py* script requires ProgressBar2.\n```bash\nsudo pip install ProgressBar2\n```\n\n## Example1 (Indoor)\n\nBag file (recorded in a small room):\n\n- [hdl_501.bag.tar.gz](http://www.aisl.cs.tut.ac.jp/databases/hdl_graph_slam/hdl_501.bag.tar.gz) (raw data, 344MB)\n- [hdl_501_filtered.bag.tar.gz](http://www.aisl.cs.tut.ac.jp/databases/hdl_graph_slam/hdl_501_filtered.bag.tar.gz) (downsampled data, 57MB, **Recommended!**)\n- [Mirror link](https://zenodo.org/record/6960371)\n\n```bash\nrosparam set use_sim_time true\nroslaunch hdl_graph_slam hdl_graph_slam_501.launch\n```\n\n```bash\nroscd hdl_graph_slam/rviz\nrviz -d hdl_graph_slam.rviz\n```\n\n```bash\nrosbag play --clock hdl_501_filtered.bag\n```\n\nWe also provide bag_player.py which automatically adjusts the playback speed and processes data as fast as possible.\n\n```bash\nrosrun hdl_graph_slam bag_player.py hdl_501_filtered.bag\n```\n\nYou'll see a point cloud like:\n\n\u003cimg src=\"imgs/top.png\" height=\"256pix\" /\u003e \u003cimg src=\"imgs/birds.png\" height=\"256pix\" /\u003e\n\nYou can save the generated map by:\n```bash\nrosservice call /hdl_graph_slam/save_map \"resolution: 0.05\ndestination: '/full_path_directory/map.pcd'\"\n```\n\n## Example2 (Outdoor)\n\nBag file (recorded in an outdoor environment):\n- [hdl_400.bag.tar.gz](http://www.aisl.cs.tut.ac.jp/databases/hdl_graph_slam/hdl_400.bag.tar.gz) (raw data, about 900MB)\n- [Mirror link](https://zenodo.org/record/6960371)\n\n```bash\nrosparam set use_sim_time true\nroslaunch hdl_graph_slam hdl_graph_slam_400.launch\n```\n\n```bash\nroscd hdl_graph_slam/rviz\nrviz -d hdl_graph_slam.rviz\n```\n\n```bash\nrosbag play --clock hdl_400.bag\n```\n\n\u003cimg src=\"imgs/hdl_400_points.png\" height=\"256pix\" /\u003e \u003cimg src=\"imgs/hdl_400_graph.png\" height=\"256pix\" /\u003e\n\n## Example with GPS\nFord Campus Vision and Lidar Data Set [\\[URL\\]](http://robots.engin.umich.edu/SoftwareData/Ford)\n\nThe following script converts the Ford Lidar Dataset to a rosbag and plays it. In this example, ***hdl_graph_slam*** utilizes the GPS data to correct the pose graph.\n\n```bash\ncd IJRR-Dataset-2\nrosrun hdl_graph_slam ford2bag.py dataset-2.bag\nrosrun hdl_graph_slam bag_player.py dataset-2.bag\n```\n\n\u003cimg src=\"imgs/ford1.png\" height=\"200pix\"/\u003e \u003cimg src=\"imgs/ford2.png\" height=\"200pix\"/\u003e \u003cimg src=\"imgs/ford3.png\" height=\"200pix\"/\u003e\n\n## Use hdl_graph_slam in your system\n\n1. Define the transformation between your sensors (LIDAR, IMU, GPS) and base_link of your system using static_transform_publisher (see line #11, hdl_graph_slam.launch). All the sensor data will be transformed into the common base_link frame, and then fed to the SLAM algorithm.\n\n2. Remap the point cloud topic of ***prefiltering_nodelet***. Like:\n\n```bash\n  \u003cnode pkg=\"nodelet\" type=\"nodelet\" name=\"prefiltering_nodelet\" ...\n    \u003cremap from=\"/velodyne_points\" to=\"/rslidar_points\"/\u003e\n  ...\n```\n\n## Common Problems\n\n### Parameter tuning guide\n\nThe mapping quality largely depends on the parameter setting. In particular, scan matching parameters have a big impact on the result. Tune the parameters accoding to the following instructions:\n\n- ***registration_method***\n  **[updated] In short, use FAST_GICP for most cases and FAST_VGICP or NDT_OMP if the processing speed matters** This parameter allows to change the registration method to be used for odometry estimation and loop detection. Note that GICP in PCL1.7 (ROS kinetic) or earlier has a bug in the initial guess handling. **If you are on ROS kinectic or earlier, do not use GICP**.\n\n- ***ndt_resolution***\n  This parameter decides the voxel size of NDT. Typically larger values are good for outdoor environements (0.5 - 2.0 [m] for indoor, 2.0 - 10.0 [m] for outdoor). If you chose NDT or NDT_OMP, tweak this parameter so you can obtain a good odometry estimation result.\n\n- ***other parameters***\n  All the configurable parameters are available in the launch file. Copy a template launch file (hdl_graph_slam_501.launch for indoor, hdl_graph_slam_400.launch for outdoor) and tweak parameters in the launch file to adapt it to your application.\n\n## License\n\nThis package is released under the BSD-2-Clause License.\n\n\nNote that the cholmod solver in g2o is licensed under GPL. You may need to build g2o without cholmod dependency to avoid the GPL.\n\n## Related packages\n\n- [interactive_slam](https://github.com/koide3/interactive_slam)\n- [hdl_graph_slam](https://github.com/koide3/hdl_graph_slam)\n- [hdl_localization](https://github.com/koide3/hdl_localization)\n- [hdl_people_tracking](https://github.com/koide3/hdl_people_tracking)\n\n\u003cimg src=\"imgs/packages.png\"/\u003e\n\n## Papers\nKenji Koide, Jun Miura, and Emanuele Menegatti, A Portable 3D LIDAR-based System for Long-term and Wide-area People Behavior Measurement, Advanced Robotic Systems, 2019 [[link]](https://www.researchgate.net/publication/331283709_A_Portable_3D_LIDAR-based_System_for_Long-term_and_Wide-area_People_Behavior_Measurement).\n\n## Contact\nKenji Koide, k.koide@aist.go.jp, https://staff.aist.go.jp/k.koide\n\nActive Intelligent Systems Laboratory, Toyohashi University of Technology, Japan [\\[URL\\]](http://www.aisl.cs.tut.ac.jp)  \nMobile Robotics Research Team, National Institute of Advanced Industrial Science and Technology (AIST), Japan  [\\[URL\\]](https://unit.aist.go.jp/hcmrc/mr-rt/contact.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoide3%2Fhdl_graph_slam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoide3%2Fhdl_graph_slam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoide3%2Fhdl_graph_slam/lists"}