{"id":1330,"date":"2022-07-13T07:00:16","date_gmt":"2022-07-13T07:00:16","guid":{"rendered":"https:\/\/webroad-seisaku.com\/fujiko-test\/?p=1330"},"modified":"2023-08-07T01:21:18","modified_gmt":"2023-08-07T01:21:18","slug":"how-to-tune-3d-lidar-slam-parameters","status":"publish","type":"post","link":"https:\/\/webroad-seisaku.com\/fujiko-test\/archives\/1330","title":{"rendered":"How to Tune 3D-Lidar SLAM Parameters"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1334 size-large\" src=\"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Picture1-1024x473.png\" alt=\"\" width=\"1024\" height=\"473\" srcset=\"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Picture1-1024x473.png 1024w, https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Picture1-300x139.png 300w, https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Picture1-768x355.png 768w, https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Picture1-1536x710.png 1536w, https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Picture1.png 1595w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>Do you want to implement 3D-Lidar SLAM for your use case successfully?<\/p>\n<p>Have you heard of the 3D-Lidar SLAM but are unsure how to maximize its performance?<\/p>\n<p>Do you find tweaking the 3D-Lidar SLAM parameters complex and confusing?<\/p>\n<p>If you answered yes to any of these questions, you would find a lot of value in this article. Once you\u2019ve decided to use 3D-Lidar SLAM for your business use case, you will need to tick off these three checkboxes:<\/p>\n<ol>\n<li>Pick an appropriate 3D-Lidar sensor unit<\/li>\n<li>Decide on a proper 3D-Lidar SLAM approach<\/li>\n<li>Choose the relevant parameters for the SLAM system<\/li>\n<\/ol>\n<p>If you are unsure of the first two checkboxes, we\u2019ve written about the 3D-Lidar SLAM approach and how you can select the appropriate sensor for your use case. We\u2019ll leave the links at the end of this article for you to delve deeper if you haven\u2019t already.<\/p>\n<p>In this article, we\u2019ll share some descriptions, typical values, and high-level guidelines on the 4 main parameters, which commonly are included in many 3D-Lidar SLAM approaches. We\u2019ll also talk about how these parameters may impact the overall performance of the system.<\/p>\n<hr \/>\n<h2>Voxel sizes and why they matter<\/h2>\n<p><strong>Smaller voxel size improves robustness and accuracy but has a price to pay<\/strong><\/p>\n<p>For a SLAM system, we treat the 3D space as a group of small 3D spaces known as <a href=\"https:\/\/en.wikipedia.org\/wiki\/Voxel\" target=\"_blank\" rel=\"noopener\">voxels<\/a>. <strong>Voxel size<\/strong> indicates how granular or coarse you want to dissect the 3D space. In other words, what dimension should a voxel be?<\/p>\n<p>In theory, a smaller voxel size means improved robustness and accuracy even though it saturates at some point. This is because when the voxel size is small, the SLAM system dissects the 3D space into many smaller 3D spaces and thus has been able to extract more points for tracking and mapping. This ability to capture more points allows for more points to track against when moving, resulting in greater robustness and accuracy.<\/p>\n<p>However, when the system has more points to process for tracking and mapping, the system is inevitably slower, introducing the processing time vs. accuracy trade-off.<\/p>\n<p>So when should you lower the voxel size? We recommend using a smaller voxel size if you are in a small indoor place near because the points concentrate in a small 3D space and it\u2019s not possible to have meaningful number of points if voxel size is large. Also, we recommend to do so for mapping applications when real-time processing isn\u2019t required.<\/p>\n<p>Here\u2019s what typical voxel sizes in meters may look like:<\/p>\n<div id=\"attachment_1335\" style=\"width: 1034px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1335\" class=\"wp-image-1335 size-large\" src=\"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Voxel-size-1024x492.png\" alt=\"\" width=\"1024\" height=\"492\" srcset=\"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Voxel-size-1024x492.png 1024w, https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Voxel-size-300x144.png 300w, https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Voxel-size-768x369.png 768w, https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Voxel-size.png 1206w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><p id=\"caption-attachment-1335\" class=\"wp-caption-text\"><em>Figure 2: Typical values for voxel size (in meter)<\/em><\/p><\/div>\n<p>As a thumb of the rule, we would start from 1.0m for outdoor robotics, 0.5m for large indoor robotics, and 0.3m for small indoor (e.g., office space) robotics. As you may have noticed, the parameters are relatively low for mapping to gain more accuracy in sacrifice of processing speed in general.<\/p>\n<p>However, in the case that your SLAM system doesn\u2019t track well with the suggested voxel size, we would recommend trying a smaller voxel size. Conversely, if your SLAM system cannot catch up with real-time feed, try a larger voxel size to reduce the number of points used.<\/p>\n<p>The key is understanding the impact of the voxel size parameter to inform the decision on changing the value as required, which you do now.<\/p>\n<hr \/>\n<h2><strong>Understand the maximum distance for matching the current frame to the map<\/strong><\/h2>\n<p>This parameter indicates how far you want to use an existing keyframe in the Iterative Closest Point [1] process to determine the current pose instead of creating a new one.<\/p>\n<p>In other words, this parameter determines how frequently you want to create a new keyframe. The longer the distance you set, the less frequent the system creates a new keyframe.<\/p>\n<p>Some typical values (in meters) are given in the image below:<\/p>\n<div id=\"attachment_1331\" style=\"width: 1034px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1331\" class=\"wp-image-1331 size-large\" src=\"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Maximum-distance-to-match-1024x427.png\" alt=\"\" width=\"1024\" height=\"427\" srcset=\"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Maximum-distance-to-match-1024x427.png 1024w, https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Maximum-distance-to-match-300x125.png 300w, https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Maximum-distance-to-match-768x320.png 768w, https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Maximum-distance-to-match.png 1389w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><p id=\"caption-attachment-1331\" class=\"wp-caption-text\"><em>Figure 3: Typical values for maximum distance for matching frames to map (in meters)<\/em><\/p><\/div>\n<p>For indoor applications, we set smaller values since we\u2019d like to have more frequent keyframes than our outdoor use cases to detect movements more precisely.<\/p>\n<hr \/>\n<h2><strong>Pay attention to the voxel size when deciding on the minimum matched points to track<\/strong><\/h2>\n<p>The parameter \u201cminimum number of matched points to track\u201d sets the threshold to decide whether or not the tracking has failed.<\/p>\n<p>When the number of matched points between the keyframes and the current frame is below this threshold value, the SLAM system is said to be \u2018lost\u2019.<\/p>\n<p>Intuitively, you can say that the smaller the number of matched points that are required to track, the easier it is for the SLAM system to continue tracking without getting lost. However, setting a too small number introduces false tracking and accumulates larger drift.<\/p>\n<p>It\u2019s essential to consider the voxel size you have already set in order to select the appropriate value for this parameter. If you\u2019ve set a larger voxel size, you\u2019d have fewer points for matching; the minimum matched points needs to be set lower.<\/p>\n<p>The number below is the example for our SLAM system which uses absolute values, but it could be relative numbers or percentages as well.<\/p>\n<div id=\"attachment_1333\" style=\"width: 1034px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1333\" class=\"wp-image-1333 size-large\" src=\"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Minimum-to-track-1024x375.png\" alt=\"\" width=\"1024\" height=\"375\" srcset=\"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Minimum-to-track-1024x375.png 1024w, https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Minimum-to-track-300x110.png 300w, https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Minimum-to-track-768x281.png 768w, https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Minimum-to-track.png 1187w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><p id=\"caption-attachment-1333\" class=\"wp-caption-text\"><em>Figure 4: Typical values for the minimum number of points to track<\/em><\/p><\/div>\n<p>If the environment has rich structures, set a higher value while reducing it when there are fewer objects around the lidar (e.g., a fairly open field with several trees). Thus, indoor environments typically have higher values than outdoor environments.<\/p>\n<hr \/>\n<h2><strong>Setting the minimum number of match points to relocalize<\/strong><\/h2>\n<p>The parameter \u201cminimum number of points to relocalize\u201d sets a threshold to decide if the initial position on the map is identified.<\/p>\n<p>When the number of matched points between the keyframes and the current frame is above the given threshold value, the SLAM system considers it as being \u201crelocalized.\u201d Here\u2019s an example from our SLAM system. Again we\u2019re using absolute values here, but it could be relative numbers or percentages as well.<\/p>\n<div id=\"attachment_1332\" style=\"width: 1034px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1332\" class=\"wp-image-1332 size-large\" src=\"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Minimum-to-relocalize-1024x358.png\" alt=\"\" width=\"1024\" height=\"358\" srcset=\"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Minimum-to-relocalize-1024x358.png 1024w, https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Minimum-to-relocalize-300x105.png 300w, https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Minimum-to-relocalize-768x269.png 768w, https:\/\/webroad-seisaku.com\/fujiko-test\/wp-content\/uploads\/2022\/07\/Minimum-to-relocalize.png 1243w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><p id=\"caption-attachment-1332\" class=\"wp-caption-text\"><em>Figure 5: Values for \u201cminimum number of points to relocalize\u201d<\/em><\/p><\/div>\n<p>When you set this parameter to a smaller value, the SLAM finds it easier to relocalize. However, selecting a too-small value introduces false relocalization [2].<\/p>\n<p>A rule of thumb is to set it to 1500 and depending on how the SLAM behaves (eg. more loop closures performed or higher experience of false relocalization) you can reduce or increase it accordingly.<\/p>\n<hr \/>\n<h2><strong>Final words<\/strong><\/h2>\n<p>At Kudan, through our blog, we\u2019ve aimed to distill the information and present it as simply as possible. Here are some of our previous articles on 3D Lidar SLAM:<\/p>\n<ul>\n<li><a href=\"https:\/\/webroad-seisaku.com\/fujiko-test\/blog\/3d-lidar-slam-the-basics\/\" target=\"_blank\" rel=\"noopener\">3D lidar SLAM: The Basics<\/a><\/li>\n<li><a href=\"https:\/\/webroad-seisaku.com\/fujiko-test\/blog\/how-to-select-the-best-3d-lidar-for-slam\/\" target=\"_blank\" rel=\"noopener\">How to Select the Best 3D Lidar for SLAM<\/a><\/li>\n<\/ul>\n<p>In this article, we\u2019ve presented the goal of tuning 3D-Lidar SLAM parameters, general guidelines, typical values, and their impact on the system's performance. The list of parameters to tweak and additional tricks to improve SLAM accuracy and robustness expands wider than what we\u2019ve been able to cover here. If you\u2019re interested to learn more or if you have a question in mind, we invite you to <a href=\"https:\/\/webroad-seisaku.com\/fujiko-test\/contact\/\" target=\"_blank\" rel=\"noopener\">say hi to us<\/a> for your specific needs around the technology.<\/p>\n<hr \/>\n<h2><strong>References<\/strong><\/h2>\n<p>[1] Chen, Yang &amp; Medioni, Gerard. (1992) \u201cObject modeling by registration of multiple range images,\u201d Image and Vision Computing, vol. 10, no. 3, pp. 145\u2013155.[<a href=\"https:\/\/www.sciencedirect.com\/science\/article\/abs\/pii\/026288569290066C\" target=\"_blank\" rel=\"noopener\">PDF<\/a>].<br \/>\n[2] Vysotska, Olga &amp; Stachniss, Cyrill. (2017). Relocalization under Substantial Appearance Changes using Hashing [<a href=\"https:\/\/www.researchgate.net\/profile\/Cyrill_Stachniss\/publication\/344351938_Relocalization_under_Substantial_Appearance_Changes_using_Hashing\/links\/5f6b4252458515b7cf4747c2\/Relocalization-under-Substantial-Appearance-Changes-using-Hashing.pdf\" target=\"_blank\" rel=\"noopener\">PDF<\/a>]<\/p>\n<hr \/>\n<p>\u25a0For more details, please contact us from <a href=\"https:\/\/webroad-seisaku.com\/fujiko-test\/contact\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Do you want to implement 3D-Lidar SLAM for your use case successfully? Have you heard of the 3D-Lidar SLAM but are unsure how to maximize its performance? Do you find tweaking the 3D-Lidar SLAM parameters complex and confusing? If you answered yes to any of these questions, you would find a lot of value in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1336,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","_lightning_design_setting":[],"header_top_description":"","footnotes":""},"categories":[2],"tags":[62,5,61,10,18,70,94,246],"class_list":["post-1330","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-3d-lidar-slam","tag-kudan","tag-kudan-3d-lidar-slam","tag-kudanslam","tag-mapping","tag-robotics","tag-simultaneous-localization-and-mapping","tag-voxel"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-json\/wp\/v2\/posts\/1330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-json\/wp\/v2\/comments?post=1330"}],"version-history":[{"count":7,"href":"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-json\/wp\/v2\/posts\/1330\/revisions"}],"predecessor-version":[{"id":1437,"href":"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-json\/wp\/v2\/posts\/1330\/revisions\/1437"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-json\/wp\/v2\/media\/1336"}],"wp:attachment":[{"href":"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-json\/wp\/v2\/media?parent=1330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-json\/wp\/v2\/categories?post=1330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webroad-seisaku.com\/fujiko-test\/wp-json\/wp\/v2\/tags?post=1330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}