{"id":149,"date":"2021-11-21T12:43:07","date_gmt":"2021-11-21T12:43:07","guid":{"rendered":"http:\/\/47.103.123.166\/?p=149"},"modified":"2021-11-21T12:43:07","modified_gmt":"2021-11-21T12:43:07","slug":"ros2_foxy%e5%ad%a6%e4%b9%a04-%e5%b8%b8%e7%94%a8%e5%b7%a5%e5%85%b7","status":"publish","type":"post","link":"http:\/\/47.103.123.166\/?p=149","title":{"rendered":"ROS2_Foxy\u5b66\u4e604\u2014\u2014\u5e38\u7528\u5de5\u5177"},"content":{"rendered":"<h1>1 rqt<\/h1>\n<h2>1.1 \u5b89\u88c5<\/h2>\n<p>&emsp;&emsp;\u4e0d\u540c\u7684\u7248\u672c \u5b89\u88c5\u65b9\u5f0f\u4e0d\u540c\u3002<\/p>\n<pre><code class=\"language-powershell\"># apt2.0 Ubuntu 20.04 and newer\n    $ sudo apt update\n    $ sudo apt install ~nros-&lt;distro&gt;-rqt*\n# apt1.x Ubuntu 18.04 and older\n    $ sudo apt update\n    $ sudo apt install ros-&lt;distro&gt;-rqt*<\/code><\/pre>\n<h2>1.2 rqt_graph<\/h2>\n<p>&emsp;&emsp;\u8fd0\u884crqt_graph\uff0c\u4e5f\u53ef\u4ee5\u4ecerqt\u6253\u5f00\uff0crqt_graph\u6e05\u6670\u5730\u5c55\u793a\u4e86\u8282\u70b9\u3001\u8bdd\u9898\u7b49\u56fe\u5143\u7d20\u7684\u5173\u7cfb\u3002<br \/>\n<img src=\"http:\/\/47.103.123.166\/wp-content\/uploads\/2021\/11\/post-149-619a3edc18515.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h2>1.3 rqt_console<\/h2>\n<p>&emsp;&emsp;\u8bb0\u5f55\u7ec8\u7aef\u7684\u65e5\u5fd7\uff0c\u4e5f\u662f\u4e00\u4e2a\u8282\u70b9\uff0c\u6536\u96c6\/rosout\u7684\u4fe1\u606f\uff0c\u53ef\u4ee5\u6839\u636e\u65e5\u5fd7\u7b49\u7ea7\u8fc7\u6ee4\uff0c\u4e5f\u53ef\u4ee5\u9ad8\u4eae\u4e00\u4e9b\u5185\u5bb9\u3002<\/p>\n<pre><code class=\"language-powershell\">$ ros2 run rqt_console rqt_console<\/code><\/pre>\n<p><img src=\"http:\/\/47.103.123.166\/wp-content\/uploads\/2021\/11\/post-149-619a3edc7a28a.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><br \/>\n&emsp;&emsp;\u4e0a\u4e2d\u4e0b\u4e00\u5171\u4e09\u4e2a\u7a97\u53e3\uff0c\u4e0a\u9762\u7a97\u53e3\u5217\u51fa\u4e86\u6240\u6709\u7684\u65e5\u5fd7\uff0c\u4e2d\u95f4\u7a97\u53e3\u53ef\u4ee5\u6839\u636e\u65e5\u5fd7\u7b49\u7ea7\u8fdb\u884c\u7b5b\u9009\uff0c\u4e0b\u9762\u7684\u989d\u7a97\u53e3\u53ef\u4ee5\u9ad8\u4eae\u4e00\u4e9b\u9700\u8981\u7684\u5b57\u7b26\u4e32\u3002<br \/>\n&emsp;&emsp;\u65e5\u5fd7\u7b49\u7ea7\u6309\u4e25\u91cd\u6027\uff0c\u5982\u4e0b\u6392\u5217\uff1a<\/p>\n<pre><code class=\"language-cpp\">Fatal\nError\nWarn\nInfo\nDebug<\/code><\/pre>\n<h1>2 launch file<\/h1>\n<p>&emsp;&emsp;Launch files allow you to start up and configure a number of executables containing ROS 2 nodes simultaneously.<\/p>\n<pre><code class=\"language-powershell\">$ ros2 launch &lt;launch_file_name&gt;<\/code><\/pre>\n<p>&emsp;&emsp;launch\u6587\u4ef6\u7684\u7f16\u5199\u5728\u540e\u7eed\u535a\u6587\u4e2d\u5355\u5217\u4e00\u8282~<\/p>\n<h1>3 ros2bag<\/h1>\n<p>&emsp;&emsp;\u8bb0\u5f55topic\u53d1\u5e03\u7684\u6570\u636e\uff0c\u53ef\u9009\u62e9\u8bb0\u5f55\u54ea\u4e9btopic\uff0c\u4e8b\u540e\u53ef\u4ee5\u5bf9ros\u5305\u8fdb\u884c\u56de\u653e\u3002<\/p>\n<pre><code class=\"language-powershell\"># \u5f55\u5305\n    # \u5305\u5b58\u5728\u4e8e \u5f55\u5305\u7ec8\u7aef \u6240\u5728\u7684\u76ee\u5f55\u4e0b\n    $ ros2 bag record &lt;topic_name&gt;\n\n    # \u540c\u65f6\u5f55\u591a\u4e2a\u8bdd\u9898\uff0c\u8bdd\u9898\u4e4b\u95f4\u4f7f\u7528\u7a7a\u683c\u5206\u5f00\n    # \u4f7f\u7528 -o \u9009\u9879\u53ef\u4ee5\u8bbe\u7f6e\u5305\u540d\n    $ ros2 bag record -o &lt;bag_file_name&gt; &lt;topic1_name&gt; &lt;topic2_name&gt;\n    # \u4f7f\u7528 -a \u9009\u9879\u662f\u8bb0\u5f55\u6240\u6709topic\uff0c\u5728\u5b58\u5728\u5faa\u73af\u4f9d\u8d56\u7684\u7cfb\u7edf\u4e2d \u4e0d\u5efa\u8bae\u4f7f\u7528\n    $ ros2 bag record -a\n\n# \u67e5\u770b\u5305\u7684\u4fe1\u606f\n    $ ros2 bag info &lt;bag_file_name&gt;\n    # \u6709\u8fd9\u4e9b\u4fe1\u606f\n    Files:             subset.db3\n    Bag size:          228.5 KiB\n    Storage id:        sqlite3\n    Duration:          48.47s\n    Start:             Oct 11 2019 06:09:09.12 (1570799349.12)\n    End                Oct 11 2019 06:09:57.60 (1570799397.60)\n    Messages:          3013\n    Topic information: Topic: \/turtle1\/cmd_vel | Type: geometry_msgs\/msg\/Twist | Count: 9 | Serialization Format: cdr\n                     Topic: \/turtle1\/pose | Type: turtlesim\/msg\/Pose | Count: 3004 | Serialization Format: cdr\n\n# \u56de\u653e\n    $ ros2 bag play &lt;bag_file_name&gt;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1 rqt 1.1 \u5b89\u88c5 &emsp;&emsp;\u4e0d\u540c\u7684\u7248\u672c \u5b89\u88c5\u65b9\u5f0f\u4e0d\u540c\u3002 # apt2.0 Ubuntu 20.04 and newer $ sudo apt update $ sudo apt install ~nros-&lt;distro&gt;-rqt* # apt1.x Ubuntu 18.04 and older $ sudo apt update $ sudo apt install ros-&lt;distro&gt;-rqt* 1.2 rqt_graph &emsp;&emsp;\u8fd0\u884crqt_graph\uff0c\u4e5f\u53ef\u4ee5\u4ecerqt\u6253\u5f00\uff0crqt_graph\u6e05\u6670\u5730\u5c55\u793a\u4e86\u8282\u70b9\u3001\u8bdd\u9898\u7b49\u56fe\u5143\u7d20\u7684\u5173\u7cfb\u3002 1.3 rqt_console &emsp;&emsp;\u8bb0\u5f55\u7ec8\u7aef\u7684\u65e5\u5fd7\uff0c\u4e5f\u662f\u4e00\u4e2a\u8282\u70b9\uff0c\u6536\u96c6\/rosout\u7684\u4fe1\u606f\uff0c\u53ef\u4ee5\u6839\u636e\u65e5\u5fd7\u7b49\u7ea7\u8fc7\u6ee4\uff0c\u4e5f\u53ef\u4ee5\u9ad8\u4eae\u4e00\u4e9b\u5185\u5bb9\u3002 $ ros2 run rqt_console rqt_console &emsp;&emsp;\u4e0a\u4e2d\u4e0b\u4e00\u5171\u4e09\u4e2a\u7a97\u53e3\uff0c\u4e0a\u9762\u7a97\u53e3\u5217\u51fa\u4e86\u6240\u6709\u7684\u65e5\u5fd7\uff0c\u4e2d\u95f4\u7a97\u53e3\u53ef\u4ee5\u6839\u636e\u65e5\u5fd7\u7b49\u7ea7\u8fdb\u884c\u7b5b\u9009\uff0c\u4e0b\u9762\u7684\u989d\u7a97\u53e3\u53ef\u4ee5\u9ad8\u4eae\u4e00\u4e9b\u9700\u8981\u7684\u5b57\u7b26\u4e32\u3002 &emsp;&emsp;\u65e5\u5fd7\u7b49\u7ea7\u6309\u4e25\u91cd\u6027\uff0c\u5982\u4e0b\u6392\u5217\uff1a Fatal Error Warn Info Debug 2 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"http:\/\/47.103.123.166\/index.php?rest_route=\/wp\/v2\/posts\/149"}],"collection":[{"href":"http:\/\/47.103.123.166\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/47.103.123.166\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/47.103.123.166\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/47.103.123.166\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=149"}],"version-history":[{"count":1,"href":"http:\/\/47.103.123.166\/index.php?rest_route=\/wp\/v2\/posts\/149\/revisions"}],"predecessor-version":[{"id":150,"href":"http:\/\/47.103.123.166\/index.php?rest_route=\/wp\/v2\/posts\/149\/revisions\/150"}],"wp:attachment":[{"href":"http:\/\/47.103.123.166\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/47.103.123.166\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=149"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/47.103.123.166\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}