{"id":871,"date":"2026-06-12T15:56:39","date_gmt":"2026-06-12T07:56:39","guid":{"rendered":"https:\/\/projectleon.net\/make\/blog\/lidar-rplidar-a1-tf-luna-ugv-environment-mapping-arduino-farsi\/"},"modified":"2026-06-12T20:35:32","modified_gmt":"2026-06-12T12:35:32","slug":"lidar-rplidar-a1-tf-luna-ugv-environment-mapping-arduino-farsi","status":"publish","type":"post","link":"https:\/\/projectleon.net\/make\/blog\/lidar-rplidar-a1-tf-luna-ugv-environment-mapping-arduino-farsi\/","title":{"rendered":"LiDAR \u0627\u0631\u0632\u0627\u0646 \u0628\u0631\u0627\u06cc UGV \u2014 RPLIDAR A1 \u0648 TF-Luna: \u0646\u0642\u0634\u0647 \u0645\u062d\u06cc\u0637 \u0628\u0627 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 (\u0641\u0627\u0631\u0633\u06cc)"},"content":{"rendered":"<div class='hero-image-container' style='margin-bottom:28px;border-radius:14px;overflow:hidden;box-shadow:0 4px 18px rgba(0,0,0,0.08)'>\n<img src='' alt='LiDAR RPLIDAR TF-Luna UGV \u0646\u0642\u0634\u0647 \u0645\u062d\u06cc\u0637' style='width:100%;height:auto;display:block' loading='eager'\/>\n<\/div>\n<div class='beginner-intro' style='background:#f0f7ff;border-right:4px solid #2e5fb6;padding:16px 20px;border-radius:10px;margin-bottom:22px'>\n<h2 style='margin-top:0'>LiDAR \u0686\u06cc\u0633\u062a\u061f \u0686\u0631\u0627 \u0627\u0632 \u0633\u0648\u0646\u0627\u0631 \u0628\u0647\u062a\u0631 \u0627\u0633\u062a\u061f<\/h2>\n<p><strong>LiDAR (Light Detection And Ranging)<\/strong> \u0627\u0632 \u0644\u06cc\u0632\u0631 \u0628\u0631\u0627\u06cc \u0627\u0646\u062f\u0627\u0632\u0647\u200c\u06af\u06cc\u0631\u06cc \u0641\u0627\u0635\u0644\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u06a9\u0646\u062f \u2014 \u062f\u0642\u06cc\u0642\u200c\u062a\u0631\u060c \u0633\u0631\u06cc\u0639\u200c\u062a\u0631 \u0648 \u0628\u0627 \u0628\u0631\u062f \u0628\u06cc\u0634\u062a\u0631 \u0627\u0632 \u0633\u0648\u0646\u0627\u0631. \u062f\u0648 \u0646\u0648\u0639 \u0631\u0627\u06cc\u062c \u0628\u0631\u0627\u06cc DIY:<\/p>\n<p><strong>TF-Luna<\/strong>: \u06cc\u06a9 ToF (Time-of-Flight) \u0644\u06cc\u0632\u0631\u06cc \u0628\u0627 \u0628\u0631\u062f \u06f8 \u0645\u062a\u0631\u060c \u0627\u0631\u062a\u0628\u0627\u0637 UART\/I2C \u0648 \u0642\u06cc\u0645\u062a ~\u06f1\u06f8\u06f0K \u2014 \u0645\u0646\u0627\u0633\u0628 \u0627\u062c\u062a\u0646\u0627\u0628 \u0627\u0632 \u0645\u0648\u0627\u0646\u0639 \u062f\u0631 \u06cc\u06a9 \u062c\u0647\u062a.<\/p>\n<p><strong>RPLIDAR A1<\/strong>: \u06cc\u06a9 LiDAR \u0686\u0631\u062e\u0627\u0646 \u06f3\u06f6\u06f0\u00b0 \u0628\u0627 \u0628\u0631\u062f \u06f1\u06f2 \u0645\u062a\u0631 \u0648 \u06f8\u06f0\u06f0\u06f0 \u0646\u0642\u0637\u0647\/\u062b\u0627\u0646\u06cc\u0647 \u2014 \u0645\u0646\u0627\u0633\u0628 \u0646\u0642\u0634\u0647\u200c\u0628\u0631\u062f\u0627\u0631\u06cc \u06a9\u0627\u0645\u0644 \u0645\u062d\u06cc\u0637 (SLAM). \u0642\u06cc\u0645\u062a ~\u06f8\u06f0\u06f0K \u0627\u0645\u0627 \u0642\u062f\u0631\u062a\u0645\u0646\u062f\u062a\u0631\u06cc\u0646 \u0627\u0628\u0632\u0627\u0631 DIY \u0628\u0631\u0627\u06cc \u0646\u0627\u0648\u0628\u0631\u06cc \u0627\u0633\u062a.<\/p>\n<\/div>\n<div style='background:#fff8e1;border:1px solid #ffd54f;border-radius:10px;padding:16px;margin-bottom:22px'>\n<h3 style='margin-top:0'>&#x1f6e0;&#xfe0f; \u06a9\u0627\u0631\u062a \u067e\u0631\u0648\u0698\u0647<\/h3>\n<table style='width:100%;border-collapse:collapse'>\n<tr>\n<td style='padding:6px;font-weight:bold;width:40%'>\u0645\u0642\u0627\u06cc\u0633\u0647<\/td>\n<td style='padding:6px'>TF-Luna: \u0627\u0631\u0632\u0627\u0646\u060c \u0633\u0627\u062f\u0647 \/ RPLIDAR: \u06a9\u0627\u0645\u0644\u060c \u06af\u0631\u0627\u0646<\/td>\n<\/tr>\n<tr style='background:#fffde7'>\n<td style='padding:6px;font-weight:bold'>\u067e\u0631\u0648\u0633\u0633\u0648\u0631<\/td>\n<td style='padding:6px'>TF-Luna: Arduino \/ RPLIDAR: Raspberry Pi + ROS<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<h2>\u06a9\u062f TF-Luna \u0628\u0627 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648<\/h2>\n<pre style='background:#1e1e1e;color:#d4d4d4;padding:14px;border-radius:8px;font-size:12px;margin-bottom:18px'><code>\/\/ TF-Luna \u0627\u0632 \u0637\u0631\u06cc\u0642 UART (9600 baud)\n#include &lt;SoftwareSerial.h&gt;\nSoftwareSerial tfLuna(10, 11);  \/\/ RX=10, TX=11\n\nint getTFDistance(){\n  if(tfLuna.available() >= 9){\n    if(tfLuna.read() == 0x59 && tfLuna.peek() == 0x59){\n      tfLuna.read();  \/\/ \u062f\u0648\u0645\u06cc\u0646 header\n      int dist = tfLuna.read() | (tfLuna.read() << 8);\n      int strength = tfLuna.read() | (tfLuna.read() << 8);\n      tfLuna.read(); tfLuna.read(); tfLuna.read();  \/\/ \u0628\u0642\u06cc\u0647 \u0628\u0633\u062a\u0647\n      if(strength > 100) return dist;  \/\/ \u0627\u0637\u0645\u06cc\u0646\u0627\u0646 \u0627\u0632 \u0633\u06cc\u06af\u0646\u0627\u0644 \u0642\u0648\u06cc\n    }\n  }\n  return -1;\n}\n\nvoid setup(){\n  tfLuna.begin(115200);  \/\/ TF-Luna default 115200\n  \/\/ \u062a\u063a\u06cc\u06cc\u0631 \u0628\u0647 9600 \u0628\u0627 \u062f\u0633\u062a\u0648\u0631 TFMini:\n  \/\/ byte cmd[] = {0x5A,0x08,0x06,0x01,0x01,0x00,0x00,0x67};\n}\n\nvoid loop(){\n  int d = getTFDistance();\n  if(d > 0 && d < 50){  \/\/ \u0645\u0627\u0646\u0639 \u062f\u0631 \u06f5\u06f0cm\n    stopAndAvoid();\n  }\n}<\/code><\/pre>\n<h2>\u0631\u0627\u0647\u200c\u0627\u0646\u062f\u0627\u0632\u06cc RPLIDAR A1 \u0631\u0648\u06cc Raspberry Pi + ROS<\/h2>\n<pre style='background:#1e1e1e;color:#d4d4d4;padding:12px;border-radius:8px;font-size:12px;margin-bottom:18px'><code># \u0646\u0635\u0628 ROS Noetic \u0631\u0648\u06cc Raspberry Pi (Ubuntu 20.04)\nsudo apt install ros-noetic-rplidar-ros\n\n# \u0627\u062c\u0631\u0627\u06cc RPLIDAR node:\nroslaunch rplidar_ros rplidar_a1.launch\n\n# \u0645\u0634\u0627\u0647\u062f\u0647 \u0646\u0642\u0634\u0647 \u062f\u0631 Rviz:\nrosrun rviz rviz\n# \u0627\u0636\u0627\u0641\u0647 \u06a9\u0631\u062f\u0646 LaserScan display \u2192 topic: \/scan<\/code><\/pre>\n<div style='display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:18px;margin:20px 0'>\n<iframe width='100%' height='280' src='https:\/\/www.youtube.com\/embed\/eJZXRncGaGM' title='TF-Luna LiDAR Arduino Tutorial' frameborder='0' allowfullscreen><\/iframe><br \/>\n<iframe width='100%' height='280' src='https:\/\/www.youtube.com\/embed\/vxMSFrSz43Y' title='RPLIDAR A1 ROS Mapping Tutorial Raspberry Pi' frameborder='0' allowfullscreen><\/iframe>\n<\/div>\n<ul>\n<li><a href='https:\/\/github.com\/Slamtec\/rplidar_ros' target='_blank'>RPLIDAR ROS Package \u2014 GitHub<\/a><\/li>\n<li><a href='https:\/\/www.aparat.com\/result\/LiDAR+%D8%B1%D8%A8%D8%A7%D8%AA+%D9%86%D9%82%D8%B4%D9%87' target='_blank'>\u0622\u067e\u0627\u0631\u0627\u062a: LiDAR \u0631\u0628\u0627\u062a \u0646\u0642\u0634\u0647<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u0622\u0645\u0648\u0632\u0634 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 LiDAR \u0627\u0631\u0632\u0627\u0646 \u0628\u0631\u0627\u06cc UGV: TF-Luna (ToF \u06f8 \u0645\u062a\u0631\u060c \u06f1\u06f8\u06f0K) \u0628\u0631\u0627\u06cc \u0627\u062c\u062a\u0646\u0627\u0628 \u0627\u0632 \u0645\u0648\u0627\u0646\u0639 \u0648 RPLIDAR A1 (360\u00b0 \u0686\u0631\u062e\u0627\u0646\u060c \u06f8\u06f0\u06f0K) \u0628\u0631\u0627\u06cc \u0646\u0642\u0634\u0647\u200c\u0628\u0631\u062f\u0627\u0631\u06cc \u0645\u062d\u06cc\u0637. \u06a9\u062f \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u0648 ROS.<\/p>\n","protected":false},"author":1,"featured_media":883,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"categories":[19,16],"tags":[80,295,677,676,674,675,409,48,162],"class_list":["post-871","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials-2","category-ugv","tag-arduino-2","tag-lidar","tag-mapping","tag-ros","tag-rplidar-a1","tag-tf-luna","tag-tof","tag-ugv","tag-162"],"_links":{"self":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/871","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/comments?post=871"}],"version-history":[{"count":1,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/871\/revisions"}],"predecessor-version":[{"id":884,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/871\/revisions\/884"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/media\/883"}],"wp:attachment":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/media?parent=871"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/categories?post=871"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/tags?post=871"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}