{"id":3130,"date":"2019-10-16T18:41:23","date_gmt":"2019-10-16T09:41:23","guid":{"rendered":"http:\/\/oohito.com\/nqthm\/?p=3130"},"modified":"2022-08-21T20:52:57","modified_gmt":"2022-08-21T11:52:57","slug":"ros2%e3%81%a7m5stack%e3%82%92%e3%81%a4%e3%81%aa%e3%81%90","status":"publish","type":"post","link":"https:\/\/oohito.com\/nqthm\/archives\/3130","title":{"rendered":"ROS2\u3067M5Stack\u3068PC\u3092\u3064\u306a\u3050"},"content":{"rendered":"\n<p>Ubuntu 18.04 \u306aPC\u3068M5Stack Gray\u3068\u3092ROS2\u3067\u7d50\u3093\u3067\u307f\u305f\u306e\u3067\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u30e1\u30e2\u3002<\/p>\n\n\n\n<p>\u53c2\u8003\u306b\u3057\u305f\u306e\u306f\u4ee5\u4e0b\u306e\u30b5\u30a4\u30c8<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/index.ros.org\/doc\/ros2\/Installation\/Dashing\/Linux-Install-Debians\/\">https:\/\/index.ros.org\/doc\/ros2\/Installation\/Dashing\/Linux-Install-Debians\/<\/a><\/li><li><a href=\"https:\/\/speakerdeck.com\/anoken\/m5stack-x-ros2\">https:\/\/speakerdeck.com\/anoken\/m5stack-x-ros2<\/a><\/li><li><a href=\"https:\/\/micro-xrce-dds.readthedocs.io\/en\/latest\/installation.html\">https:\/\/micro-xrce-dds.readthedocs.io\/en\/latest\/installation.html<\/a><\/li><li><a href=\"https:\/\/github.com\/ROBOTIS-GIT\/ros2arduino\">https:\/\/github.com\/ROBOTIS-GIT\/ros2arduino<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f7f\u7528\u74b0\u5883<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\">PC\u5074<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>\u666e\u901a\u306e\u30ce\u30fc\u30c8PC\uff08\u672c\u5f53\u306f\u3042\u307e\u308a\u666e\u901a\u3058\u3083\u306a\u3044 GPD MicroPC\u3060\u3051\u3069\u5909\u308f\u3089\u306a\u3044\u306f\u305a\uff09<\/li><li>Ubuntu 18.04<\/li><li>Visual Studio Code<\/li><li>vscode \u306e Platform IO \u62e1\u5f35<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">M5Stack\u5074<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>M5Stack Gray \uff08\u591a\u5206 Basic \u3067\u3082 Fire \u3067\u3082\u540c\u3058\uff09<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u4f5c\u696d\u3044\u308d\u3044\u308d<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">ROS2\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b5\u30a4\u30c8\u306e\u624b\u9806\u306b\u3066ROS2 Dashing Diademata\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3002\u300cInstall additional RMW implementations\u300d\u4ee5\u5916\u306f\u5168\u3066\u5b9f\u65bd\u3057\u305f\u3002\uff08\u624b\u9806\u306f\u7701\u7565\uff09<\/p>\n\n\n\n<p><a href=\"https:\/\/index.ros.org\/doc\/ros2\/Installation\/Dashing\/Linux-Install-Debians\/\">https:\/\/index.ros.org\/doc\/ros2\/Installation\/Dashing\/Linux-Install-Debians\/<\/a><\/p>\n\n\n\n<p>python-rosdep2 \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u5f8c\u3067\u3001\u4ee5\u4e0b\u3092\u884c\u3063\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo rosdep init\nrosdep update<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n\n\n\n<p>\u300c<a href=\"https:\/\/www.amazon.co.jp\/dp\/B07W6DX9MW\/\">ROS2\u3067\u306f\u3058\u3081\u3088\u3046\u6b21\u4e16\u4ee3\u30ed\u30dc\u30c3\u30c8\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0<\/a>\u300d\u3067\u52c9\u5f37\u4e2d\u306a\u306e\u3067\u3001\u66f8\u7c4d\u3067\u8aac\u660e\u3055\u308c\u3066\u3044\u305f\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u4f7f\u3063\u305f\u3002\uff08\u4e01\u5be7\u3067\u308f\u304b\u308a\u3084\u3059\u3044\u3067\u3059\uff09<\/p>\n\n\n\n<p>\u3042\u3089\u304b\u3058\u3081 working \u3068 ros2_ws \u306e\u30d5\u30a9\u30eb\u30c0\u306f\u4f5c\u6210\u6e08\u307f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd ~\/working\ngit clone https:\/\/github.com\/youtalk\/get-started-ros2.git\ncd get-started-ros2\ngit submodule update --init\ncd ~\/ros2_ws\nln -s ~\/working\/get-started-ros2\/ros2 src\nrosdep install --from-paths src --ignore-src -r -y\ncolcon build<\/pre>\n\n\n\n<p>colcon build \u304c\u4f55\u5ea6\u304b\u5931\u6557\u3057\u305f\u3051\u3069\u3001\u3084\u308a\u76f4\u3057\u305f\u3089\u5168\u3066\u30d3\u30eb\u30c9\u3067\u304d\u305f\u3002\u4e0d\u601d\u8b70\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Micro-XRCE-DDS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n\n\n\n<p>M5Stack\u306f\u3001Micro-XRCE-DDS\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305fPC\u3068\u63a5\u7d9a\u3059\u308b\u3068ROS2\u3067\u3064\u306a\u304c\u308c\u308b\u3089\u3057\u3044\u3002\u305d\u3053\u3067Micro-XRCE-DDS\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u3092\u898b\u306a\u304c\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/micro-xrce-dds.readthedocs.io\/en\/latest\/installation.html\">https:\/\/micro-xrce-dds.readthedocs.io\/en\/latest\/installation.html<\/a><\/p>\n\n\n\n<p>\u307b\u307c\u4e0a\u306e\u901a\u308a\u3060\u304c\u3001 <a href=\"https:\/\/speakerdeck.com\/anoken\/m5stack-x-ros2?slide=16\">https:\/\/speakerdeck.com\/anoken\/m5stack-x-ros2?slide=16<\/a> \u306b\u3088\u308b\u3068\u3001cmake \u306e\u3068\u3053\u308d\u3067\u30aa\u30d7\u30b7\u30e7\u30f3\u6307\u5b9a\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u305f\u3002\u305d\u308c\u304c\u3069\u3093\u306a\u610f\u5473\u3092\u6301\u3063\u3066\u3044\u308b\u304b\uff08\u307e\u3060\uff09\u308f\u304b\u3063\u3066\u3044\u306a\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd ~\/working\ngit clone https:\/\/github.com\/eProsima\/Micro-XRCE-DDS.git\ncd Micro-XRCE-DDS\nmkdir build\ncd build\ncmake -DTHIRDPARTY=ON -DCONFIG_UDP_TRANSPORT_MTU=4096 -DCONFIG_SERIAL_TRANSPORT_MTU=4096 ..\nmake\nsudo make install<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">ros2arduino \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n\n\n\n<p>M5Stack \u5074\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306f ros2arduino \u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u5fc5\u8981\u3068\u306a\u308b\u306e\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002vscode + platformio \u3067\u958b\u767a\u3057\u3066\u3044\u308b\u306e\u3067 \u3001PIO Home \u304b\u3089 Libraries \u3067 ros2arduino \u3092\u691c\u7d22\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002\u975e\u5e38\u306b\u7c21\u5358\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0<\/h2>\n\n\n\n<p>\u4eca\u56de\u306f\u30c6\u30b9\u30c8\u3068\u3057\u3066chatter\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f7f\u7528\u3057\u3001PC\u5074\u3092Listener \u3001M5Stack\u5074\u3092Publisher\u3068\u3057\u305f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">PC\u5074\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0<\/h3>\n\n\n\n<p>PC\u5074\u306b\u3064\u3044\u3066\u306f\u3001\u3075\u3064\u3046\u306bROS2\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3059\u308b\u3002\u5148\u307b\u3069\u30d3\u30eb\u30c9\u3057\u305fROS2\u306e\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u3057\u3066\u5165\u3063\u3066\u3044\u308b\u3082\u306e\u3092\u305d\u306e\u307e\u307e\u4f7f\u7528\u3057\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">. ~\/ros2_ws\/install\/setup.bash\nros2 run hello_world listener<\/pre>\n\n\n\n<p>\u4e0a\u8a18\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u306f\u3001chatter\u30c8\u30d4\u30c3\u30af\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u53d7\u3051\u53d6\u3063\u3066\u753b\u9762\u306b\u8868\u793a\u3059\u308b\u3082\u306e\u3067\u3042\u308b\u3002\u5225\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u958b\u3044\u3066\u4ee5\u4e0b\u3092\u5b9f\u884c\u3059\u308c\u3070\u3001PC\u5185\u3067\u52d5\u4f5c\u78ba\u8a8d\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">. ~\/ros2_ws\/install\/setup.bash\nros2 run hello_world talker<\/pre>\n\n\n\n<p>\u52d5\u4f5c\u3092\u78ba\u8a8d\u3057\u305f\u3089 talker \u306f\u6b62\u3081\u3066\u304a\u304f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">M5Stack \u5074\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0<\/h3>\n\n\n\n<p>vscode \u3067PIO Home\u304b\u3089New Project \u3092\u9078\u3093\u3067\u65b0\u898f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3059\u308b\u3002Name\u306b\u9069\u5f53\u306a\u540d\u524d\u3092\u5165\u529b\u3057\u3001Board\u3067\u9069\u5207\u306a\u30c7\u30d0\u30a4\u30b9\u3092\u9078\u629e\u3057\uff08\u4f7f\u3063\u305f\u306e\u306f M5Stack GREY ESP32\uff09\u3001Framework\u306fArduino\u3068\u3057\u305f\u3002<\/p>\n\n\n\n<p>Libraries \u3067 Installed \u3092\u9078\u3093\u3067 ros2arduino \u306e Examples\u3092\u63a2\u3057\u305f\u3002\u4eca\u56de\u306f\u3001 publisher_wifi_udp \u3068\u3044\u3046\u305d\u308c\u3089\u3057\u3044\u3082\u306e\u3092\u9078\u3093\u3067\u5185\u5bb9\u3092\u30b3\u30d4\u30fc\u3057\u3001 src\/main.cpp \u306b\u4e38\u3054\u3068\u8cbc\u308a\u4ed8\u3051\u305f\u3002<\/p>\n\n\n\n<p>\u30b5\u30f3\u30d7\u30eb\u304b\u3089\u306e\u5909\u66f4\u70b9\u3068\u3057\u3066\u306f\u3001\u4ee5\u4e0b\u306e\u901a\u308a\u3002\uff08\u30b5\u30f3\u30d7\u30eb\u3092\u898b\u308c\u3070\u308f\u304b\u308b\u306e\u3067\u8a73\u7d30\u306f\u7701\u7565\uff09<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u5148\u982d\u306b #include &lt;M5Stack.h&gt; \u3092\u633f\u5165\u3057\u305f\u3002<\/li><li>SSID, SSID_PW \u3092\u9069\u5207\u306a\u5185\u5bb9\u306b\u5909\u66f4\u3057\u305f\u3002<\/li><li>AGENT_IP \u3092PC\u306eIP\u30a2\u30c9\u30ec\u30b9\u306b\u3057\u305f\u3002<\/li><li>27\u884c\u76ee\u4ed8\u8fd1\u306b\u3042\u308b &#8220;arduino_chatter&#8221; \u3092 &#8220;chatter&#8221; \u306b\u5909\u66f4\u3057\u305f\u3002<\/li><li>setup \u306b\u3001\u9069\u5b9c M5.begin \u3084\u3089 M5.print \u306a\u3069\u3092\u5165\u308c\u3001\u52d5\u4f5c\u3057\u3066\u3044\u308b\u304b\u308f\u304b\u308b\u3088\u3046\u306b\u3057\u305f\u3002<\/li><\/ul>\n\n\n\n<p>\u3042\u3068\u306f\u666e\u901a\u306b\u30d3\u30eb\u30c9\u3057\u3066\u3001M5Stack \u306b\u8ee2\u9001\u3002\u8ee2\u9001\u3059\u308b\u3068\u81ea\u52d5\u7684\u306b\u8d77\u52d5\u3059\u308b\u304c\u3001\u3068\u308a\u3042\u3048\u305a\u653e\u7f6e\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u52d5\u4f5c\u78ba\u8a8d<\/h2>\n\n\n\n<p>PC\u5074\u3067\u306f\u3001ROS2\u306e\u30ce\u30fc\u30c9\uff08\u4eca\u56de\u306f chatter \u306e listener\uff09\u3068\u3001Micro-XRCE-DDS\u306e\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u304c\u5fc5\u8981\u3068\u306a\u308b\u3002\u30ce\u30fc\u30c9\u306e\u8d77\u52d5\u306f\u4e0a\u3067\u884c\u3063\u305f\u306e\u3067\u3001Micro-XRCE-DDS\u3092\u8d77\u52d5\u3055\u305b\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">MicroXRCEAgent udp -p 2018<\/pre>\n\n\n\n<p>\u30dd\u30fc\u30c8\u756a\u53f7\u306f ros2arduino \u306e\u30b5\u30f3\u30d7\u30eb\u306b\u8a18\u8ff0\u3055\u308c\u3066\u3044\u308b\u3082\u306e\u3092\u6307\u5b9a\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u6b21\u306b M5Stack \u3092\u30ea\u30bb\u30c3\u30c8\u3057\u3066\u8d77\u52d5\u3057\u306a\u304a\u3059\u3002\u30a2\u30af\u30bb\u30b9\u30dd\u30a4\u30f3\u30c8\u306b\u63a5\u7d9a\u3067\u304d\u308c\u3070\u3001Micro-XRCE-DDS\u306e\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306b\u63a5\u7d9a\u306b\u3044\u304f\u3002\uff08\u306a\u306e\u3067\u5148\u306b\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3092\u8d77\u52d5\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308b\uff09\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306e\u30ed\u30b0\u306b\u3001session established \u3068\u8868\u793a\u3055\u308c\u308c\u3070\u7121\u4e8b\u306b\u63a5\u7d9a\u304c\u6e08\u3093\u3067\u3044\u308b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"http:\/\/oohito.com\/nqthm\/wp-content\/uploads\/2019\/10\/IMG_20191016_183725-1.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u3070\u3063\u3061\u30b9\u30af\u30b7\u30e7\u3060\u304c\u3001\u4e0a\u306e\u3088\u3046\u306b\u306a\u308c\u3070OK\u3002\u5de6\u5074\u306bMicroXRCEAgent\u306e\u30ed\u30b0\u3001\u53f3\u5074\u306bM5Stack\u304b\u3089\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p>\u74b0\u5883\u69cb\u7bc9\u306b\u5c11\u3057\u624b\u9593\u53d6\u3063\u305f\u304c\u3001ROS2\u3067PC\u3068M5Stack\u304c\u7c21\u5358\u306b\u3064\u306a\u304c\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u306e\u306f\u5b09\u3057\u3044\u3002\u3053\u308c\u3067\u4f55\u3092\u4f5c\u308d\u3046\u304b\u306a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu 18.04 \u306aPC\u3068M5Stack Gray\u3068\u3092ROS2\u3067\u7d50\u3093\u3067\u307f\u305f\u306e\u3067\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u30e1\u30e2\u3002 \u53c2\u8003\u306b\u3057\u305f\u306e\u306f\u4ee5\u4e0b\u306e\u30b5\u30a4\u30c8 https:\/\/index.ros.org\/doc\/ros2\/Installatio&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-3130","post","type-post","status-publish","format-standard","hentry","category-ros"],"_links":{"self":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/3130","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/comments?post=3130"}],"version-history":[{"count":1,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/3130\/revisions"}],"predecessor-version":[{"id":3508,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/3130\/revisions\/3508"}],"wp:attachment":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/media?parent=3130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/categories?post=3130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/tags?post=3130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}