{"id":662,"date":"2022-07-07T21:54:28","date_gmt":"2022-07-07T12:54:28","guid":{"rendered":"http:\/\/practical.kr\/?p=662"},"modified":"2022-07-07T22:16:51","modified_gmt":"2022-07-07T13:16:51","slug":"velodyne-%eb%9d%bc%ec%9d%b4%eb%8b%a4%ec%99%80-%ed%8c%8c%ec%9d%b4%ec%8d%ac-%ec%97%b0%ea%b2%b0","status":"publish","type":"post","link":"http:\/\/practical.kr\/?p=662","title":{"rendered":"Velodyne \ub77c\uc774\ub2e4\uc640 \ud30c\uc774\uc36c \uc5f0\uacb0"},"content":{"rendered":"\n<p>\ucd5c\uadfc Velodyne \ub77c\uc774\ub2e4 VLP-16\uc744 \uc0ac\uc6a9\ud574 \ubcfc \uae30\ud68c\uac00 \uc0dd\uacbc\ub2e4. \uc774 \ub77c\uc774\ub2e4\ub294 \uc790\uc728\uc8fc\ud589 \uc790\ub3d9\ucc28\uc5d0 \ub9ce\uc774 \uc0ac\uc6a9\ub418\uace0 \uc788\uc9c0\ub9cc \ub098\ub294 \ub77c\uc774\ub2e4\ub97c \uace0\uc815\ud558\uace0 \ud2b9\uc815 \ubaa9\ud45c\ubb3c\uc758 \uc2dc\uac04\uc5d0 \ub530\ub978 \uc704\uce58\ubcc0\ud654(\ubcc0\uc774)\ub97c \ud655\uc778\ud558\uace0\uc790 \ud14c\uc2a4\ud2b8\ub97c \uc2dc\uc791\ud588\uace0 \uacb0\uacfc\ubb3c\ub85c \ud30c\uc774\uc36c\uc5d0\uc11c \ub77c\uc774\ub2e4 \ub370\uc774\ud130\ub97c \uc2e4\uc2dc\uac04\uc73c\ub85c \uc77d\uc5b4\uc11c \ud30c\uc77c \ud639\uc740 \ub370\uc774\ud130 \ubca0\uc774\uc2a4\uc5d0 \uc800\uc7a5\ud560 \ubaa9\uc801\uc73c\ub85c \ud14c\uc2a4\ud2b8\ub97c \ud588\ub2e4.<\/p>\n\n\n\n<p class=\"has-large-font-size\">ROS<\/p>\n\n\n\n<p>\ub77c\uc774\ub2e4\ub97c \uad6c\uc785\ud560 \ub54c \ubc1b\uc740 VeloView\ub77c\ub294 \ud504\ub85c\uadf8\ub7a8\uc73c\ub85c \ub77c\uc774\ub2e4\uac00 \uc815\uc0c1\uc801\uc73c\ub85c \uc791\ub3d9\ud558\uace0 PCAP \ub610\ub294 CSV \ud615\ud0dc\uc758 \ud30c\uc77c\ub85c \uc800\uc7a5 \uac00\ub2a5\ud55c \uac83\uc744 \ud655\uc778\ud588\uc9c0\ub9cc \uadf8\uac74 \ub0b4\uac00 \uc6d0\ud558\ub294 \ubc29\ubc95\uc774 \uc544\ub2c8\uc5c8\ub2e4.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/practical.kr\/wp-content\/uploads\/2022\/07\/\u1109\u1173\u110f\u1173\u1105\u1175\u11ab\u1109\u1163\u11ba-2022-07-07-13-16-49.png\" alt=\"\" class=\"wp-image-664\" width=\"599\" height=\"341\"\/><figcaption>VeloView<\/figcaption><\/figure><\/div>\n\n\n\n<p>\uba70\uce60\uc758 \uc0bd\uc9c8\ub05d\uc5d0 ROS\ub97c \uc774\uc6a9\ud558\ub294 \uac83\uc774 \uac00\uc7a5(?) \ud6a8\uc728\uc801\uc774\ub77c\ub294 \uacb0\ub860\uc744 \uc5bb\uace0 Ubuntu 20.04\uc5d0 ROS &#8211; Noetic\uc744 \uc124\uce58\ud588\ub2e4. \uc544\ub798\uc758 \ub9c1\ud06c\uc5d0\uc11c ROS \uc124\uce58 \ubc29\ubc95\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ROS - Noetic \uc124\uce58\n<a rel=\"noreferrer noopener\" href=\"http:\/\/wiki.ros.org\/noetic\/Installation\/Ubuntu\" target=\"_blank\">http:\/\/wiki.ros.org\/noetic\/Installation\/Ubuntu<\/a><\/pre>\n\n\n\n<p class=\"has-large-font-size\">Velodyne Driver \uc124\uce58<\/p>\n\n\n\n<p>ROS\ub97c \uc774\uc6a9\ud558\ub294 \uac00\uc7a5 \ud070 \uc774\uc720\ub294 \uc774\ubbf8 \ub9cc\ub4e4\uc5b4\uc9c4 \ub4dc\ub77c\uc774\ubc84\ub97c \ud65c\uc6a9\ud560 \uc218 \uc788\uae30 \ub54c\ubb38\uc778\ub370 Velodyne Lidar \uc5ed\uc2dc \ubc84\uc804\ubcc4\ub85c \ub4dc\ub77c\uc774\ubc84\uac00 \uc788\ub2e4. \uc544\ub798\uc758 \ub9c1\ud06c\uc640 \uac19\uc774 \ub4dc\ub77c\uc774\ubc84\ub97c \uc124\uce58\ud588\ub2e4. \ub9c1\ud06c\uc5d0\ub294 \ucd5c\ucd08\uc5d0 \ub77c\uc774\ub2e4\ub97c \uc5f0\uacb0\ud558\ub294 \ubc29\ubc95\ubd80\ud130 rviz\ub97c \uc774\uc6a9\ud558\uc5ec VeloView\uc640 \uac19\uc740 \ud615\uc2dd\uc73c\ub85c \ub77c\uc774\ub2e4 \ub370\uc774\ud130\ub97c \uc870\ud68c \ud560 \uc218 \uc788\ub294 \ubc29\ubc95\uae4c\uc9c0 \uc54c\ub824\uc900\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\uc544\ub798 \ub9c1\ud06c\uc758 \ub0b4\uc6a9\uc5d0\uc11c \nsudo apt-get install ros-VERSION-velodyne\n\ubd80\ubd84\uc740\nsudo apt-get install ros-noetic-velodyne\n\uc73c\ub85c \ubcc0\uacbd\ud574\uc11c \uc124\uce58\ud574 \uc900\ub2e4\n\n\nVelodyne Driver \uc124\uce58\n<a rel=\"noreferrer noopener\" href=\"http:\/\/wiki.ros.org\/velodyne\/Tutorials\/Getting%20Started%20with%20the%20Velodyne%20VLP16\" target=\"_blank\">http:\/\/wiki.ros.org\/velodyne\/Tutorials\/Getting%20Started%20with%20the%20Velodyne%20VLP16<\/a><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/practical.kr\/wp-content\/uploads\/2022\/07\/\u1109\u1173\u110f\u1173\u1105\u1175\u11ab\u1109\u1163\u11ba-2022-07-07-13-38-00.png\" alt=\"\" class=\"wp-image-671\" width=\"625\" height=\"357\"\/><figcaption>RViz \uce21\uc815\uacb0\uacfc \ud654\uba74<\/figcaption><\/figure><\/div>\n\n\n\n<p>ROS &#8211; RViz \uc5d0\uc11c \ub370\uc774\ud130\ub97c \ud655\uc778\ud560 \uc218 \uc788\uc5c8\uc9c0\ub9cc \uc704\uce58 \ub370\uc774\ud130\ub97c \uc5bb\ub294 \uac83\uc774 \ubaa9\uc801\uc774\uc5c8\uae30 \ub54c\ubb38\uc5d0 VeloView\uc640 \ub3d9\uc77c\ud558\uac8c ROS\uc5d0\uc11c \uc798 \uc5f0\uacb0\ub418\ub294\uad6c\ub098\ub97c \ud655\uc778\ud558\uace0 \ub2e4\uc74c \uc0bd\uc9c8\uc744 \uc2dc\uc791\ud588\ub2e4. \ubaa9\ud45c\ub294 \ud30c\uc774\uc36c\uc5d0\uc11c \uac01\ub3c4\ubcc4 \uac70\ub9ac\ub97c \uc5bb\uc5b4\ub0b4\ub294 \uac83.<\/p>\n\n\n\n<p class=\"has-large-font-size\">Publisher, Subscriber, PointCloud, Python<\/p>\n\n\n\n<p>\ud30c\uc774\uc36c\uc73c\ub85c \ub77c\uc774\ub2e4 \ub370\uc774\ud130\ub97c \ucd94\ucd9c\ud558\uae30 \uc704\ud558\uc5ec ROS \ud29c\ud1a0\ub9ac\uc5bc\uc744 \uc2a4\ud130\ub514\ud558\ub358 \uacfc\uc815\uc5d0\uc11c ROS \ub178\ub4dc\ub4e4\uc758 \ud1b5\uc2e0 \ubc29\uc2dd\uc5d0 \ub300\ud574\uc11c \uc54c\uac8c \ub418\uc5c8\ub2e4. \uc804\uc5d0 \ub0b4\uac00 IOT \uc7a5\ube44 \uc5f0\uacb0\uc5d0 \uc8fc\ub85c \uc0ac\uc6a9\ud558\ub358  MQTT \ud504\ub85c\ud1a0\ucf5c\uacfc \uac70\uc758 \ud761\uc0ac\ud55c \uad6c\uc870. <\/p>\n\n\n\n<p>\ubc1c\ud589\uc790(Publisher)\uc640 \uc218\uc2e0\uc790(Subscriber)\uac00 \uc77c\uc815\ud55c \ud1a0\ud53d(topic)\uc744 \uacf5\uc720\ud558\uace0 \ub370\uc774\ud130\ub97c \uc1a1, \uc218\uc2e0\ud558\ub294 \ubc29\uc2dd\uc73c\ub85c \uc544\ub798 \ub9c1\ud06c\ub97c \ucc38\uc870\ud558\uba74 \ud30c\uc774\uc36c\uc73c\ub85c \ub370\uc774\ud130\ub97c \uc1a1, \uc218\uc2e0\ud558\ub294 \uc0d8\ud50c\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4.<\/p>\n\n\n\n<p>\uc704\uc758 RViz \ud504\ub85c\uadf8\ub7a8 \uc5ed\uc2dc \ud1a0\ud53d\uc744 Subscribe\ud558\uc5ec \ub77c\uc774\ub2e4\uc758 3\ucc28\uc6d0 \uc774\ubbf8\uc9c0\ub97c \uadf8\ub9b0\ub2e4. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\ud30c\uc774\uc36c\uc744 \uc774\uc6a9\ud55c ROS \ub370\uc774\ud130 \uc1a1\uc218\uc2e0 \uc0d8\ud50c\n<a rel=\"noreferrer noopener\" href=\"http:\/\/wiki.ros.org\/ROS\/Tutorials\/WritingPublisherSubscriber%28python%29\" target=\"_blank\">http:\/\/wiki.ros.org\/ROS\/Tutorials\/WritingPublisherSubscriber%28python%29<\/a><\/pre>\n\n\n\n<p>\uc544\ub798\uc758 \ucee4\ub9e8\ub4dc\ub97c \uc2e4\ud589\ud574\uc11c \ud37c\ube14\ub9ac\uc154(Publisher)\ub97c \uc2e4\ud589\uc2dc\ud0a8\ub2e4. Velodyne Driver \uc124\uce58 \ub9c1\ud06c\uc5d0\uc11c \uc774\ubbf8 Publisher\ub97c \uc2e4\ud589\ud588\uc5c8\ub2e4. \uadf8\ub798\uc11c RViz\uac00 \ub77c\uc774\ub2e4 \ub370\uc774\ud130\ub97c \uc218\uc2e0\ud574\uc11c \uacb0\uacfc \ud654\uba74\uc744 \uadf8\ub9b4 \uc218 \uc788\uc5c8\ub2e4. \uc885\ub8cc\ub418\uc5c8\ub2e4\uba74 \uc544\ub798\uc640 \uac19\uc774 \ub2e4\uc2dc \uc2e4\ud589\ud560 \uc218 \uc788\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ roslaunch velodyne_pointcloud VLP16_points.launch<\/pre>\n\n\n\n<p>\uc704\uc758 \uc0d8\ud50c \ucf54\ub4dc\ub97c \uc751\uc6a9\ud558\uc5ec \uc544\ub798\uc640 \uac19\uc774 \ubca8\ub85c\ub2e4\uc778 \ud1a0\ud53d\uc744 \uc218\uc2e0(Subscribe)\ud55c\ub2e4. <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">if __name__ == '__main__':\n    rospy.init_node(\"listener\", anonymous=True)\n    rospy.Subscriber('\/velodyne_points', PointCloud2, callback)\n\n    rospy.spin()<\/pre>\n\n\n\n<p>\uc704\uc758 \ucf54\ub4dc\uc5d0\uc11c rospy.Subscriber() \uc758 \ud30c\ub77c\uba54\ud0c0\ub294 \ud1a0\ud53d, \uc218\uc2e0\ud560 \uad6c\uc870\uccb4 \ud615\uc2dd, \ucf5c\ubc31 \ud568\uc218\uc778\ub370 \ucf5c\ubc31 \ud568\uc218\uc758 \uad6c\uc870\ub294 \uc544\ub798\uc640 \uac19\ub2e4.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import sensor_msgs.point_cloud2 as pc2\n\ndef callback(input_ros_msg):\n    for data in pc2.read_points(input_ros_msg, skip_nans=True):\n        x2 = data[0]\n        y2 = data[1]\n        z2 = data[2]\n        intensity = data[3]\n        ring = data[4]\n        time1 = datetime.fromtimestamp(data[5])\n\n        distance = math.sqrt((x2)**2+(y2)**2+(z2)**2)\n        azimuth = math.degrees(math.atan2((x2),(y2)))<\/pre>\n\n\n\n<p>\ucf5c\ubc31\uc744 \ud1b5\ud558\uc5ec \uc804\ub2ec\ub41c \ub370\uc774\ud130\ub294 PointCloud \uad6c\uc870\ub85c \ubcc0\ud658\ud558\uace0 \ubcc0\ud658\ub41c \uc88c\ud45c\ub97c \uc774\uc6a9\ud558\uc5ec \uac70\ub9ac\uc640 \ubc29\uc704\uac01\uc744 \uacc4\uc0b0\ud560 \uc218 \uc788\ub2e4. \uc774\uc81c \ub370\uc774\ud130\ub97c \uc5bb\uc5c8\uc73c\ub2c8 \uc800\uc7a5\ub9cc\ud558\uba74 \ub41c\ub2e4 .    ^_^<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\uac70\ub9ac\uc640 \ubc29\uc704\uac01 \uacc4\uc0b0\ubc29\ubc95\uc740 \uc544\ub798 \ub9c1\ud06c\ub97c \ucc38\uace0\ud588\ub2e4. \n<a href=\"https:\/\/gis.stackexchange.com\/questions\/108547\/how-to-calculate-distance-azimuth-and-dip-from-two-xyz-coordinates\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/gis.stackexchange.com\/questions\/108547\/how-to-calculate-distance-azimuth-and-dip-from-two-xyz-coordinates<\/a><\/pre>\n\n\n\n<p>2022.07.07 \ubc15\ubcd1\uc77c<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ucd5c\uadfc Velodyne \ub77c\uc774\ub2e4 VLP-16\uc744 \uc0ac\uc6a9\ud574 \ubcfc \uae30\ud68c\uac00 \uc0dd\uacbc\ub2e4. \uc774 \ub77c\uc774\ub2e4\ub294 \uc790\uc728\uc8fc\ud589 \uc790\ub3d9\ucc28\uc5d0 \ub9ce\uc774 \uc0ac\uc6a9\ub418\uace0 \uc788\uc9c0\ub9cc \ub098\ub294 \ub77c\uc774\ub2e4\ub97c \uace0\uc815\ud558\uace0 \ud2b9\uc815 \ubaa9\ud45c\ubb3c\uc758 \uc2dc\uac04\uc5d0 \ub530\ub978 \uc704\uce58\ubcc0\ud654(\ubcc0\uc774)\ub97c \ud655\uc778\ud558\uace0\uc790 \ud14c\uc2a4\ud2b8\ub97c \uc2dc\uc791\ud588\uace0 \uacb0\uacfc\ubb3c\ub85c \ud30c\uc774\uc36c\uc5d0\uc11c \ub77c\uc774\ub2e4 \ub370\uc774\ud130\ub97c \uc2e4\uc2dc\uac04\uc73c\ub85c \uc77d\uc5b4\uc11c \ud30c\uc77c \ud639\uc740 \ub370\uc774\ud130 \ubca0\uc774\uc2a4\uc5d0 \uc800\uc7a5\ud560 \ubaa9\uc801\uc73c\ub85c \ud14c\uc2a4\ud2b8\ub97c \ud588\ub2e4. ROS \ub77c\uc774\ub2e4\ub97c \uad6c\uc785\ud560 \ub54c \ubc1b\uc740 VeloView\ub77c\ub294 \ud504\ub85c\uadf8\ub7a8\uc73c\ub85c \ub77c\uc774\ub2e4\uac00 \uc815\uc0c1\uc801\uc73c\ub85c \uc791\ub3d9\ud558\uace0 PCAP \ub610\ub294 CSV \ud615\ud0dc\uc758 \ud30c\uc77c\ub85c<\/p>\n<div class=\"more-link\">\n\t\t\t\t <a href=\"http:\/\/practical.kr\/?p=662\" class=\"link-btn theme-btn\"><span>Read More <\/span> <i class=\"fa fa-caret-right\"><\/i><\/a>\n\t\t\t<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[35,81,80],"tags":[85,87,86,83,84,82],"class_list":["post-662","post","type-post","status-publish","format-standard","hentry","category-python","category-ros","category-velodyne","tag-lidar","tag-python","tag-ros","tag-velodyne","tag-84","tag-82"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/practical.kr\/index.php?rest_route=\/wp\/v2\/posts\/662","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/practical.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/practical.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/practical.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/practical.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=662"}],"version-history":[{"count":45,"href":"http:\/\/practical.kr\/index.php?rest_route=\/wp\/v2\/posts\/662\/revisions"}],"predecessor-version":[{"id":709,"href":"http:\/\/practical.kr\/index.php?rest_route=\/wp\/v2\/posts\/662\/revisions\/709"}],"wp:attachment":[{"href":"http:\/\/practical.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/practical.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=662"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/practical.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}