{"id":89330,"date":"2026-08-02T20:56:37","date_gmt":"2026-08-02T12:56:37","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/89330.html"},"modified":"2026-08-02T20:56:37","modified_gmt":"2026-08-02T12:56:37","slug":"ros%e6%9c%ba%e5%99%a8%e4%ba%ba-%e4%bb%8e%e9%9b%b6%e5%bc%80%e5%a7%8b%e6%af%8f%e6%97%a5%e6%97%a5%e5%bf%97%e8%ae%b0%e5%bd%95day6","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/89330.html","title":{"rendered":"ROS\u673a\u5668\u4eba-\u4ece\u96f6\u5f00\u59cb\u6bcf\u65e5\u65e5\u5fd7\u8bb0\u5f55day6"},"content":{"rendered":"<h2>\u4e00\u3001\u4ec0\u4e48\u662f Launch&#xff1f;<\/h2>\n<p>\u7b80\u5355\u8bf4&#xff0c;Launch \u5c31\u662f ROS2 \u7684&#034;\u4e00\u952e\u542f\u52a8\u5668&#034;\u3002\u4f60\u5199\u4e00\u4e2a Python \u811a\u672c&#xff0c;\u628a\u8981\u542f\u52a8\u7684\u8282\u70b9\u3001\u53c2\u6570\u3001\u8bdd\u9898\u91cd\u6620\u5c04\u5168\u58f0\u660e\u5728\u91cc\u9762&#xff0c;\u4e00\u6761 ros2 launch \u547d\u4ee4\u5168\u90e8\u62c9\u8d77\u6765\u3002<\/p>\n<p>from launch import LaunchDescription<br \/>\nfrom launch_ros.actions import Node<\/p>\n<p>def generate_launch_description():<br \/>\n    return LaunchDescription([<br \/>\n        Node(package&#061;&#039;robot_driver&#039;, executable&#061;&#039;odom_node&#039;),<br \/>\n        Node(package&#061;&#039;cartographer_ros&#039;, executable&#061;&#039;cartographer_node&#039;),<br \/>\n        Node(package&#061;&#039;rviz2&#039;, executable&#061;&#039;rviz2&#039;),<br \/>\n    ])<\/p>\n<p>\u672c\u8d28\u4e0a&#xff0c;ros2 launch \u542f\u52a8\u540e\u4f1a\u5728\u7cfb\u7edf\u5c42\u9762\u521b\u5efa\u4e00\u4e2a\u8fdb\u7a0b\u7ec4&#xff0c;\u6240\u6709\u5b50\u8282\u70b9\u90fd\u6302\u5728\u8fd9\u4e2a\u8fdb\u7a0b\u7ec4\u4e0b\u9762&#xff0c;\u7531 Launch \u7edf\u4e00\u7ba1\u7406\u751f\u547d\u5468\u671f\u3002<\/p>\n<p>\u5f53\u6211\u4eec\u6309\u4e0bctrl&#043;c\u65f6&#xff1a;<\/p>\n<p>Ctrl&#043;C (SIGINT)<br \/>\n    \u2502<br \/>\n    \u25bc<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502 \u2460 Python signal handler \u88ab\u89e6\u53d1                   \u2502<br \/>\n\u2502    signal.signal(SIGINT, handler)               \u2502<br \/>\n\u2502    \u2192 \u4e0d\u76f4\u63a5\u9000\u51fa&#xff0c;\u800c\u662f\u5411 asyncio \u4e8b\u4ef6\u5faa\u73af          \u2502<br \/>\n\u2502      \u6295\u9012\u4e00\u4e2a &#034;shutdown&#034; \u4e8b\u4ef6                    \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\n                       \u25bc<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502 \u2461 LaunchService._shutdown() \u88ab\u8c03\u7528              \u2502<br \/>\n\u2502    \u2192 \u505c\u6b62\u63a5\u53d7\u65b0\u7684 Action                        \u2502<br \/>\n\u2502    \u2192 \u904d\u5386\u6240\u6709\u3010\u6b63\u5728\u8fd0\u884c\u7684\u5b50\u8fdb\u7a0b\u3011\u5217\u8868            \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\n                       \u25bc<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502 \u2462 \u5411\u6bcf\u4e2a\u5b50\u8fdb\u7a0b\u53d1\u9001 SIGINT&#xff08;\u7b2c\u4e00\u8f6e&#xff09;              \u2502<br \/>\n\u2502    process.send_signal(signal.SIGINT)           \u2502<br \/>\n\u2502    \u2192 \u7ed9\u5b50\u8fdb\u7a0b\u4e00\u4e2a&#034;\u4f18\u96c5\u9000\u51fa&#034;\u7684\u673a\u4f1a                \u2502<br \/>\n\u2502    \u2192 \u5b50\u8fdb\u7a0b\u53ef\u4ee5&#xff1a;\u4fdd\u5b58\u5730\u56fe\u3001\u5173\u95ed\u8bbe\u5907\u3001flush\u65e5\u5fd7   \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\n                       \u25bc<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502 \u2463 \u7b49\u5f85\u5b50\u8fdb\u7a0b\u9000\u51fa&#xff08;\u5e26\u8d85\u65f6&#xff09;                       \u2502<br \/>\n\u2502    asyncio.wait_for(proc.wait(), timeout)       \u2502<br \/>\n\u2502    \u2192 \u9ed8\u8ba4\u8d85\u65f6\u7ea6 5~10 \u79d2&#xff08;\u7248\u672c\u4e0d\u540c\u6709\u5dee\u5f02&#xff09;        \u2502<br \/>\n\u2502    \u2192 \u671f\u95f4\u6301\u7eed\u76d1\u63a7\u6bcf\u4e2a\u5b50\u8fdb\u7a0b\u7684\u9000\u51fa\u72b6\u6001            \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\n                       \u25bc<br \/>\n              \u5b50\u8fdb\u7a0b\u662f\u5426\u5168\u90e8\u9000\u51fa&#xff1f;<br \/>\n              \/              \\\\<br \/>\n           \u662f                  \u5426&#xff08;\u8d85\u65f6\u4e86\u8fd8\u6ca1\u6b7b&#xff09;<br \/>\n           \u2502                   \u2502<br \/>\n           \u25bc                   \u25bc<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502 \u2464a \u6e05\u7406\u5b8c\u6bd5      \u2502  \u2502 \u2464b \u5347\u7ea7&#xff1a;\u53d1\u9001 SIGTERM     \u2502<br \/>\n\u2502 \u5173\u95ed\u4e8b\u4ef6\u5faa\u73af     \u2502  \u2502 process.terminate()       \u2502<br \/>\n\u2502 Launch \u9000\u51fa      \u2502  \u2502 \u2192 \u518d\u7b49\u4e00\u5c0f\u6bb5\u65f6\u95f4          \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2502 \u2192 \u8fd8\u4e0d\u884c&#xff1f;SIGKILL \u5f3a\u6740    \u2502<br \/>\n                      \u2502   process.kill()          \u2502<br \/>\n                      \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<hr \/>\n<h3>\u4e8c\u3001\u4ec0\u4e48\u60c5\u51b5\u4e0b\u6740\u6b7b Launch \u4f1a\u5bfc\u81f4\u5b64\u513f\u8282\u70b9&#xff1f;<\/h3>\n<p>\u76f4\u63a5 kill -9 &lt;pid&gt; \u628a launch \u8fdb\u7a0b\u6740\u4e86&#xff0c;\u7ed3\u679c\u540e\u53f0\u8fd8\u8dd1\u7740\u4e09\u56db\u4e2a\u8282\u70b9&#xff0c;ros2 node list \u4e00\u770b\u5168\u662f&#034;\u5e7d\u7075&#034;\u3002<\/p>\n<p>\u539f\u56e0&#xff1a;kill -9 \u53d1\u7684\u662f SIGKILL&#xff0c;\u8fd9\u4e2a\u4fe1\u53f7\u4e0d\u53ef\u6355\u83b7\u3001\u4e0d\u53ef\u62e6\u622a\u3002 Launch \u8fdb\u7a0b\u77ac\u95f4\u66b4\u6bd9&#xff0c;\u6839\u672c\u6765\u4e0d\u53ca\u5411\u5b50\u8fdb\u7a0b\u8f6c\u53d1\u9000\u51fa\u4fe1\u53f7&#xff0c;\u5b50\u8fdb\u7a0b\u5c31\u6210\u4e86\u5b64\u513f&#xff0c;\u88ab\u7cfb\u7edf init \u8fdb\u7a0b\u63a5\u7ba1&#xff0c;\u7ee7\u7eed\u5728\u90a3\u8dd1\u3002<\/p>\n<p>\u9664\u4e86 kill -9&#xff0c;\u8fd8\u6709\u51e0\u79cd\u60c5\u51b5\u4e5f\u4f1a\u4ea7\u751f\u5b64\u513f&#xff1a;<\/p>\n<ul>\n<li>Launch \u8fdb\u7a0b\u81ea\u5df1\u6bb5\u9519\u8bef\u5d29\u4e86&#xff08;\u7236\u8fdb\u7a0b\u5f02\u5e38\u9000\u51fa&#xff09;<\/li>\n<li>\u5b50\u8fdb\u7a0b\u901a\u8fc7 shell&#061;True \u6216 setsid() \u542f\u52a8&#xff0c;\u8131\u79bb\u4e86\u8fdb\u7a0b\u7ec4<\/li>\n<li>\u8282\u70b9\u4ee3\u7801\u91cc\u81ea\u5df1\u5c4f\u853d\u4e86 SIGINT\/SIGTERM<\/li>\n<\/ul>\n<p>\u6b63\u786e\u59ff\u52bf&#xff1a; \u6c38\u8fdc\u7528 Ctrl&#043;C&#xff08;SIGINT&#xff09;\u6216 kill -15&#xff08;SIGTERM&#xff09;&#xff0c;\u7ed9 Launch \u4e00\u4e2a&#034;\u5584\u540e&#034;\u7684\u673a\u4f1a\u3002<\/p>\n<hr \/>\n<h3>\u4e09\u3001\u4ec0\u4e48\u662f\u6d41\u63a7\u53cd\u538b&#xff08;Backpressure&#xff09;&#xff1f;<\/h3>\n<p>\u4e00\u53e5\u8bdd&#xff1a;\u6d88\u8d39\u7aef\u592a\u6162 \u2192 \u7f13\u51b2\u533a\u5806\u6ee1 \u2192 \u538b\u529b\u53cd\u5411\u4f20\u5bfc\u56de\u751f\u4ea7\u7aef \u2192 \u751f\u4ea7\u7aef\u88ab\u8feb\u505c\u53d1\u3002<\/p>\n<p>\u751f\u6d3b\u7c7b\u6bd4&#xff1a;\u4f60\u62ff\u6c34\u7ba1\u5f80\u676f\u5b50\u91cc\u704c\u6c34&#xff0c;\u676f\u5b50\u6ee1\u4e86\u6c34\u6ea2\u51fa\u6765\u3002\u5982\u679c\u676f\u5b50\u6709\u4e2a\u5bc6\u5c01\u76d6&#xff08;\u7f13\u51b2\u533a\u6709\u9650&#xff09;&#xff0c;\u6c34\u704c\u4e0d\u8fdb\u53bb&#xff0c;\u4f60\u5c31\u88ab\u8feb\u5173\u6c34\u9f99\u5934\u2014\u2014\u8fd9\u4e2a&#034;\u88ab\u8feb\u5173&#034;\u5c31\u662f\u53cd\u538b\u3002<\/p>\n<p>\u5728 DDS \u91cc&#xff0c;Reliable \u6a21\u5f0f &#043; \u6709\u9650\u961f\u5217\u6df1\u5ea6\u00a0\u53ef\u80fd\u5bfc\u81f4\u6d41\u63a7\u53cd\u538b&#xff1a;<\/p>\n<ul>\n<li>Publisher \u53d1\u6570\u636e\u8fdb\u961f\u5217<\/li>\n<li>Subscriber \u6d88\u8d39\u540e\u56de ACK<\/li>\n<li>\u5982\u679c Subscriber \u592a\u6162&#xff0c;ACK \u8fdf\u8fdf\u4e0d\u6765&#xff0c;\u961f\u5217\u5806\u6ee1<\/li>\n<li>Publisher \u7684 publish() \u88ab\u963b\u585e&#xff08;\u6216\u8fd4\u56de\u5931\u8d25&#xff09;<\/li>\n<li>\u751f\u4ea7\u7aef\u88ab\u6d88\u8d39\u7aef\u62d6\u6b7b\u4e86<\/li>\n<\/ul>\n<p>Best Effort \u6a21\u5f0f\u6ca1\u6709 ACK \u673a\u5236&#xff0c;\u961f\u5217\u6ee1\u4e86\u76f4\u63a5\u4e22\u6700\u65e7\u7684&#xff0c;\u4e0d\u5b58\u5728\u53cd\u538b&#xff0c;\u4f46\u4e5f\u610f\u5473\u7740\u53ef\u80fd\u4e22\u6570\u636e\u3002<\/p>\n<hr \/>\n<h3>\u56db\u3001Cartographer \u5d29\u6e83\u95ee\u9898<\/h3>\n<p>&#xff08;ROS\u673a\u5668\u4eba-\u4ece\u96f6\u5f00\u59cb\u6bcf\u65e5\u65e5\u5fd7\u8bb0\u5f55day3-CSDN\u535a\u5ba2&#xff09;\u6587\u4e2d\u95ee\u9898<\/p>\n<h4><span style=\"color:#4d4d4d\">\u6211\u7684 odom \u53d1\u9001\u7aef\u914d\u7f6e&#xff1a;<\/span><\/h4>\n<p>auto qos &#061; rclcpp::QoS(rclcpp::KeepLast(10)).reliable();<br \/>\nodom_pub_ &#061; create_publisher&lt;nav_msgs::msg::Odometry&gt;(&#034;\/odom&#034;, qos);<\/p>\n<p>odom\u53d1\u9001\u7aef\u7684\u53d1\u9001\u6a21\u5f0f\u662freliable\u4e14\u961f\u5217\u957f\u5ea6\u4e3a10&#xff0c;\u5f53carto\u5bf9odom\u7684\u6d88\u8d39\u4e0d\u53ca\u65f6\u65f6&#xff0c;odom\u6570\u636e\u79ef\u538b&#xff0c;\u5bfc\u81f4odom\u7684\u53d1\u9001\u7aef\u505c\u53d1odom\u6570\u636e&#xff0c;odom\u6570\u636e\u505c\u53d1\u53c8\u4f1a\u5bfc\u81f4carto\u62ff\u4e0d\u5230odom\u6570\u636e\u8fdb\u800c\u5f62\u6210\u6076\u6027\u5faa\u73af\u3002<\/p>\n<p>Cartographer \u5185\u90e8\u8ba1\u7b97\u91cf\u5927&#xff08;\u5927\u89d2\u5ea6\u8f6c\u5f2f\u540e\u626b\u63cf\u5339\u914d\u3001\u5b50\u56fe\u6784\u5efa&#xff09;<br \/>\n    \u2192 \u6d88\u8d39 \/odom \u901f\u5ea6\u4e0b\u964d<br \/>\n    \u2192 DDS ACK \u5ef6\u8fdf<br \/>\n    \u2192 Publisher \u961f\u5217&#xff08;depth&#061;10&#xff09;\u5806\u6ee1<br \/>\n    \u2192 Reliable \u6a21\u5f0f\u89e6\u53d1\u53cd\u538b&#xff0c;odom \u505c\u53d1<br \/>\n    \u2192 Cartographer \u62ff\u4e0d\u5230\u65b0 odom<br \/>\n    \u2192 \u5904\u7406\u66f4\u52a0\u505c\u6ede \u2192 \u6d88\u8d39\u66f4\u6162 \u2192 \u961f\u5217\u66f4\u6ee1<br \/>\n    \u2192 \u6076\u6027\u5faa\u73af<\/p>\n<h4>\u89e3\u51b3<\/h4>\n<p>\u5c06odom \u53d1\u9001\u6a21\u5f0f\u6539\u6210 Best Effort&#xff1a;<\/p>\n<p>auto qos &#061; rclcpp::QoS(rclcpp::KeepLast(5))<br \/>\n             .best_effort()<br \/>\n             .durability_volatile();<\/p>\n<hr \/>\n<h3>\u4e94\u3001DDS \u4e24\u8282\u70b9\u4e92\u901a\u7684\u4e09\u4e2a\u524d\u63d0<\/h3>\n<p>\u5f53\u4e0a\u5c42UDP\u6d88\u606f\u65e0\u6cd5\u5230\u8fbe\u5c0f\u8f66\u65f6&#xff0c;\u8981\u8003\u8651\u662f\u4e0d\u662f\u6d88\u606f\u5728\u8f6c\u6362\u7684\u65f6\u5019DDS\u4e0d\u901a\u3002<\/p>\n<table>\n<tr>\u6761\u4ef6\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u540c ROS_DOMAIN_ID<\/td>\n<td>\u4e0d\u540c domain \u903b\u8f91\u9694\u79bb&#xff0c;\u4e92\u76f8\u4e0d\u53ef\u89c1&#xff08;\u9ed8\u8ba4 0&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u540c RMW \u5b9e\u73b0<\/td>\n<td>FastDDS \u548c CycloneDDS \u4e4b\u95f4\u4e0d\u4e92\u901a<\/td>\n<\/tr>\n<tr>\n<td>QoS Profile \u517c\u5bb9<\/td>\n<td>Best Effort \u7684 Pub \u65e0\u6cd5\u88ab Reliable \u7684 Sub \u8ba2\u9605<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6392\u67e5\u547d\u4ee4&#xff1a;<\/p>\n<p>echo $ROS_DOMAIN_ID<br \/>\necho $RMW_IMPLEMENTATION<br \/>\nros2 topic info \/odom &#8211;verbose<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u4ec0\u4e48\u662f Launch&#xff1f;<br \/>\n\u7b80\u5355\u8bf4&#xff0c;Launch \u5c31\u662f ROS2 \u7684\\&#8221;\u4e00\u952e\u542f\u52a8\u5668\\&#8221;\u3002\u4f60\u5199\u4e00\u4e2a Python \u811a\u672c&#xff0c;\u628a\u8981\u542f\u52a8\u7684\u8282\u70b9\u3001\u53c2\u6570\u3001\u8bdd\u9898\u91cd\u6620\u5c04\u5168\u58f0\u660e\u5728\u91cc\u9762&#xff0c;\u4e00\u6761 ros2 launch \u547d\u4ee4\u5168\u90e8\u62c9\u8d77\u6765\u3002<br \/>\nfrom launch import LaunchDescription<br \/>\nfrom launch_ros.actions import Nodedef generate_launch_description():<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,50,384,125,925],"topic":[],"class_list":["post-89330","post","type-post","status-publish","format-standard","hentry","category-server","tag-linux","tag-50","tag-384","tag-125","tag-925"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>ROS\u673a\u5668\u4eba-\u4ece\u96f6\u5f00\u59cb\u6bcf\u65e5\u65e5\u5fd7\u8bb0\u5f55day6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/89330.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ROS\u673a\u5668\u4eba-\u4ece\u96f6\u5f00\u59cb\u6bcf\u65e5\u65e5\u5fd7\u8bb0\u5f55day6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001\u4ec0\u4e48\u662f Launch&#xff1f; \u7b80\u5355\u8bf4&#xff0c;Launch \u5c31\u662f ROS2 \u7684&quot;\u4e00\u952e\u542f\u52a8\u5668&quot;\u3002\u4f60\u5199\u4e00\u4e2a Python \u811a\u672c&#xff0c;\u628a\u8981\u542f\u52a8\u7684\u8282\u70b9\u3001\u53c2\u6570\u3001\u8bdd\u9898\u91cd\u6620\u5c04\u5168\u58f0\u660e\u5728\u91cc\u9762&#xff0c;\u4e00\u6761 ros2 launch \u547d\u4ee4\u5168\u90e8\u62c9\u8d77\u6765\u3002 from launch import LaunchDescription from launch_ros.actions import Nodedef generate_launch_description():\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/89330.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-02T12:56:37+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/89330.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/89330.html\",\"name\":\"ROS\u673a\u5668\u4eba-\u4ece\u96f6\u5f00\u59cb\u6bcf\u65e5\u65e5\u5fd7\u8bb0\u5f55day6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-02T12:56:37+00:00\",\"dateModified\":\"2026-08-02T12:56:37+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/89330.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/89330.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/89330.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ROS\u673a\u5668\u4eba-\u4ece\u96f6\u5f00\u59cb\u6bcf\u65e5\u65e5\u5fd7\u8bb0\u5f55day6\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ROS\u673a\u5668\u4eba-\u4ece\u96f6\u5f00\u59cb\u6bcf\u65e5\u65e5\u5fd7\u8bb0\u5f55day6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/89330.html","og_locale":"zh_CN","og_type":"article","og_title":"ROS\u673a\u5668\u4eba-\u4ece\u96f6\u5f00\u59cb\u6bcf\u65e5\u65e5\u5fd7\u8bb0\u5f55day6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u3001\u4ec0\u4e48\u662f Launch&#xff1f; \u7b80\u5355\u8bf4&#xff0c;Launch \u5c31\u662f ROS2 \u7684\"\u4e00\u952e\u542f\u52a8\u5668\"\u3002\u4f60\u5199\u4e00\u4e2a Python \u811a\u672c&#xff0c;\u628a\u8981\u542f\u52a8\u7684\u8282\u70b9\u3001\u53c2\u6570\u3001\u8bdd\u9898\u91cd\u6620\u5c04\u5168\u58f0\u660e\u5728\u91cc\u9762&#xff0c;\u4e00\u6761 ros2 launch \u547d\u4ee4\u5168\u90e8\u62c9\u8d77\u6765\u3002 from launch import LaunchDescription from launch_ros.actions import Nodedef generate_launch_description():","og_url":"https:\/\/www.wsisp.com\/helps\/89330.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-02T12:56:37+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/89330.html","url":"https:\/\/www.wsisp.com\/helps\/89330.html","name":"ROS\u673a\u5668\u4eba-\u4ece\u96f6\u5f00\u59cb\u6bcf\u65e5\u65e5\u5fd7\u8bb0\u5f55day6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-02T12:56:37+00:00","dateModified":"2026-08-02T12:56:37+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/89330.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/89330.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/89330.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"ROS\u673a\u5668\u4eba-\u4ece\u96f6\u5f00\u59cb\u6bcf\u65e5\u65e5\u5fd7\u8bb0\u5f55day6"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/89330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=89330"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/89330\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=89330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=89330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=89330"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=89330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}