{"id":76677,"date":"2026-02-23T00:26:12","date_gmt":"2026-02-22T16:26:12","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/76677.html"},"modified":"2026-02-23T00:26:12","modified_gmt":"2026-02-22T16:26:12","slug":"ros2%e4%b8%ad%e7%9a%84%e5%a4%9a%e8%8a%82%e7%82%b9%e9%80%9a%e4%bf%a1%e4%bc%98%e5%8c%96%ef%bc%9a%e5%9f%ba%e4%ba%8e%e5%8f%82%e6%95%b0%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8e%e6%9c%8d%e5%8a%a1%e8%b0%83","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/76677.html","title":{"rendered":"**ROS2\u4e2d\u7684\u591a\u8282\u70b9\u901a\u4fe1\u4f18\u5316\uff1a\u57fa\u4e8e\u53c2\u6570\u670d\u52a1\u5668\u4e0e\u670d\u52a1\u8c03\u7528\u7684\u534f\u540c\u673a\u5236\u8bbe\u8ba1**\u5728\u673a\u5668\u4eba\u64cd\u4f5c\u7cfb\u7edf\uff08ROS\uff09\u7684\u53d1\u5c55\u5386\u7a0b\u4e2d\uff0c**ROS2**\u51ed\u501f"},"content":{"rendered":"<p>ROS2\u4e2d\u7684\u591a\u8282\u70b9\u901a\u4fe1\u4f18\u5316&#xff1a;\u57fa\u4e8e\u53c2\u6570\u670d\u52a1\u5668\u4e0e\u670d\u52a1\u8c03\u7528\u7684\u534f\u540c\u673a\u5236\u8bbe\u8ba1<\/p>\n<p>\u5728\u673a\u5668\u4eba\u64cd\u4f5c\u7cfb\u7edf&#xff08;ROS&#xff09;\u7684\u53d1\u5c55\u5386\u7a0b\u4e2d&#xff0c;ROS2\u51ed\u501f\u5176\u66f4\u4f18\u7684\u5b9e\u65f6\u6027\u3001\u6a21\u5757\u5316\u67b6\u6784\u548c\u5f3a\u5927\u7684\u4e2d\u95f4\u4ef6\u652f\u6301&#xff08;\u5982Fast-DDS&#xff09;&#xff0c;\u5df2\u7ecf\u6210\u4e3a\u5de5\u4e1a\u7ea7\u673a\u5668\u4eba\u5f00\u53d1\u7684\u6807\u51c6\u5e73\u53f0\u4e4b\u4e00\u3002\u7136\u800c&#xff0c;\u5728\u590d\u6742\u7cfb\u7edf\u4e2d&#xff0c;\u5982\u4f55\u9ad8\u6548\u5730\u5b9e\u73b0\u8de8\u8282\u70b9\u7684\u6570\u636e\u5171\u4eab\u4e0e\u72b6\u6001\u540c\u6b65&#xff0c;\u4ecd\u7136\u662f\u4e00\u4e2a\u6311\u6218\u3002\u672c\u6587\u5c06\u56f4\u7ed5**\u53c2\u6570\u670d\u52a1\u5668&#xff08;Parameter Server&#xff09;\u4e0e\u670d\u52a1\u8c03\u7528&#xff08;Service Call&#xff09;**\u7684\u534f\u540c\u673a\u5236\u5c55\u5f00\u8ba8\u8bba&#xff0c;\u5e76\u901a\u8fc7\u5b9e\u9645\u4ee3\u7801\u793a\u4f8b\u8bf4\u660e\u5982\u4f55\u5728ROS2\u4e2d\u6784\u5efa\u9ad8\u6027\u80fd\u3001\u4f4e\u5ef6\u8fdf\u7684\u591a\u8282\u70b9\u901a\u4fe1\u6a21\u578b\u3002<\/p>\n<hr \/>\n<h4>\u4e00\u3001\u95ee\u9898\u80cc\u666f&#xff1a;\u4f20\u7edf\u901a\u4fe1\u65b9\u5f0f\u7684\u74f6\u9888<\/h4>\n<p>\u5728ROS1\u65f6\u4ee3&#xff0c;\u5e38\u4f7f\u7528rosparam\u6216dynamic_reconfigure\u6765\u4f20\u9012\u914d\u7f6e\u53c2\u6570&#xff0c;\u4f46\u8fd9\u4e9b\u65b9\u6cd5\u5b58\u5728\u5982\u4e0b\u95ee\u9898&#xff1a;<\/p>\n<ul>\n<li>\u53c2\u6570\u66f4\u65b0\u5e7f\u64ad\u673a\u5236\u4e0d\u591f\u7075\u6d3b&#xff1b;<\/li>\n<li>\n<ul>\n<li>\u591a\u8282\u70b9\u95f4\u4f9d\u8d56\u5173\u7cfb\u96be\u4ee5\u663e\u5f0f\u7ba1\u7406&#xff1b;<\/li>\n<\/ul>\n<\/li>\n<li>\n<ul>\n<li>\u4e0d\u9002\u7528\u4e8e\u52a8\u6001\u62d3\u6251\u53d8\u5316\u573a\u666f&#xff08;\u5982\u63d2\u62d4\u4f20\u611f\u5668\u6216\u6a21\u5757\u5316\u8bbe\u5907&#xff09;&#xff1b;<br \/>\n\u800c\u5728ROS2\u4e2d&#xff0c;\u5b98\u65b9\u5f15\u5165\u4e86\u53c2\u6570\u670d\u52a1\u5668&#xff08;rclcpp::Node::declare_parameter \/ get_parameter&#xff09;&#xff0c;\u5b83\u4e0d\u4ec5\u652f\u6301\u7c7b\u578b\u5b89\u5168&#xff0c;\u8fd8\u5177\u5907\u70ed\u63d2\u62d4\u80fd\u529b\u3002\u7ed3\u5408**\u670d\u52a1\u63a5\u53e3&#xff08;Service Interface&#xff09;**\u8fdb\u884c\u72b6\u6001\u67e5\u8be2\u4e0e\u63a7\u5236&#xff0c;\u53ef\u4ee5\u5b9e\u73b0\u4e00\u79cd\u201c\u53c2\u6570\u9a71\u52a8 &#043; \u4e8b\u4ef6\u89e6\u53d1\u201d\u7684\u65b0\u578b\u901a\u4fe1\u6a21\u5f0f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr \/>\n<h4>\u4e8c\u3001\u6838\u5fc3\u601d\u60f3&#xff1a;\u53c2\u6570\u4f5c\u4e3a\u72b6\u6001\u5951\u7ea6&#xff0c;\u670d\u52a1\u4f5c\u4e3a\u63a7\u5236\u901a\u9053<\/h4>\n<p>\u6211\u4eec\u5c06\u6574\u4e2a\u7cfb\u7edf\u5212\u5206\u4e3a\u4e24\u4e2a\u5c42\u7ea7&#xff1a;<\/p>\n<table>\n<tr>\u5c42\u7ea7\u529f\u80fd\u63cf\u8ff0<\/tr>\n<tbody>\n<tr>\n<td>\u53c2\u6570\u5c42<\/td>\n<td>\u6240\u6709\u8282\u70b9\u901a\u8fc7\u7edf\u4e00\u547d\u540d\u7a7a\u95f4\u8bbf\u95ee\u5168\u5c40\u53c2\u6570&#xff08;\u5982\u76ee\u6807\u5750\u6807\u3001\u4efb\u52a1\u6a21\u5f0f\u7b49&#xff09;&#xff0c;\u786e\u4fdd\u4e00\u81f4\u6027<\/td>\n<\/tr>\n<tr>\n<td>\u670d\u52a1\u5c42<\/td>\n<td>\u63d0\u4f9b\u539f\u5b50\u64cd\u4f5c\u63a5\u53e3&#xff08;\u5982start_navigation, emergency_stop&#xff09;&#xff0c;\u7528\u4e8e\u5f02\u6b65\u54cd\u5e94<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u79cd\u8bbe\u8ba1\u7684\u4f18\u52bf\u5728\u4e8e&#xff1a;<\/p>\n<ul>\n<li>\u89e3\u8026\u6027\u5f3a&#xff1a;\u5404\u8282\u70b9\u4ec5\u5173\u6ce8\u81ea\u8eab\u6240\u9700\u53c2\u6570&#xff0c;\u4e0d\u5173\u5fc3\u5176\u4ed6\u8282\u70b9\u903b\u8f91&#xff1b;<\/li>\n<li>\n<ul>\n<li>\u53ef\u6269\u5c55\u6027\u9ad8&#xff1a;\u65b0\u589e\u8282\u70b9\u53ea\u9700\u8ba2\u9605\u5bf9\u5e94\u53c2\u6570\u5373\u53ef\u81ea\u52a8\u9002\u914d&#xff1b;<\/li>\n<\/ul>\n<\/li>\n<li>\n<ul>\n<li>\u5bb9\u9519\u80fd\u529b\u5f3a&#xff1a;\u670d\u52a1\u5931\u8d25\u65f6\u53ef\u901a\u8fc7\u91cd\u8bd5&#043;\u65e5\u5fd7\u8bb0\u5f55\u5feb\u901f\u5b9a\u4f4d\u95ee\u9898\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr \/>\n<h4>\u4e09\u3001\u5b9e\u6218\u6848\u4f8b&#xff1a;\u6784\u5efa\u4e00\u4e2a\u5e26\u53c2\u6570\u540c\u6b65\u7684\u5bfc\u822a\u63a7\u5236\u5668<\/h4>\n<p>\u5047\u8bbe\u6211\u4eec\u8981\u5f00\u53d1\u4e00\u4e2a\u79fb\u52a8\u673a\u5668\u4eba\u5bfc\u822a\u6a21\u5757&#xff0c;\u5305\u542b\u4e24\u4e2a\u5173\u952e\u8282\u70b9&#xff1a;<\/p>\n<ul>\n<li>navigation_core&#xff1a;\u8d1f\u8d23\u8def\u5f84\u89c4\u5212\u4e0e\u6267\u884c<\/li>\n<li>\n<ul>\n<li>map_manager&#xff1a;\u8d1f\u8d23\u5730\u56fe\u52a0\u8f7d\u4e0e\u66f4\u65b0<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h5>\u2705 \u6b65\u9aa41&#xff1a;\u5b9a\u4e49\u53c2\u6570\u7ed3\u6784&#xff08;Python &#043; C&#043;&#043;\u5171\u7528&#xff09;<\/h5>\n<p><span class=\"token comment\"># config.yaml&#xff08;\u653e\u5728package\/share\/&lt;pkg&gt;\/config&#xff09;<\/span><br \/>\n<span class=\"token key atrule\">navigation<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">target_pose<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token key atrule\">x<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token number\">3.0<\/span><br \/>\n          <span class=\"token key atrule\">y<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token number\">2.5<\/span><br \/>\n              <span class=\"token key atrule\">z<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token number\">0.0<\/span><br \/>\n                <span class=\"token key atrule\">enable_debug<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token boolean important\">false<\/span><br \/>\n                &#096;&#096;&#096;<br \/>\n<span class=\"token comment\">#### \u2705 \u6b65\u9aa42&#xff1a;C&#043;&#043;\u8282\u70b9\u5b9e\u73b0 \u2014\u2014 navigation_core.cpp<\/span><\/p>\n<p>&#096;&#096;&#096;cpp<br \/>\n<span class=\"token comment\">#include &lt;rclcpp\/rclcpp.hpp&gt;<\/span><br \/>\n<span class=\"token comment\">#include &lt;std_srvs\/srv\/empty.hpp&gt;<\/span><\/p>\n<p><span class=\"token key atrule\">class NavigationCore<\/span> <span class=\"token punctuation\">:<\/span> public rclcpp<span class=\"token punctuation\">:<\/span><span class=\"token punctuation\">:<\/span>Node <span class=\"token punctuation\">{<\/span><br \/>\n<span class=\"token key atrule\">public<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">NavigationCore()<\/span> <span class=\"token punctuation\">:<\/span> Node(&#034;navigation_core&#034;) <span class=\"token punctuation\">{<\/span><br \/>\n            \/\/ \u58f0\u660e\u53c2\u6570&#xff08;\u81ea\u52a8\u6ce8\u518c\u5230\u53c2\u6570\u670d\u52a1\u5668&#xff09;<br \/>\n                    declare_parameter(&#034;target_pose.x&#034;<span class=\"token punctuation\">,<\/span> 0.0);<br \/>\n                            declare_parameter(&#034;target_pose.y&#034;<span class=\"token punctuation\">,<\/span> 0.0);<br \/>\n                                    declare_parameter(&#034;enable_debug&#034;<span class=\"token punctuation\">,<\/span> false);<br \/>\n        \/\/ \u521b\u5efa\u670d\u52a1&#xff08;\u63d0\u4f9b\u624b\u52a8\u542f\u52a8\u529f\u80fd&#xff09;<br \/>\n                srv_ &#061; create_service&lt;std_srvs<span class=\"token punctuation\">:<\/span><span class=\"token punctuation\">:<\/span>srv<span class=\"token punctuation\">:<\/span><span class=\"token punctuation\">:<\/span>Empty<span class=\"token punctuation\">&gt;<\/span>(<br \/>\n                            &#034;start_navigation&#034;<span class=\"token punctuation\">,<\/span><br \/>\n                                        <span class=\"token punctuation\">[<\/span>this<span class=\"token punctuation\">]<\/span>(const std<span class=\"token punctuation\">:<\/span><span class=\"token punctuation\">:<\/span>shared_ptr&lt;std_srvs<span class=\"token punctuation\">:<\/span><span class=\"token punctuation\">:<\/span>srv<span class=\"token punctuation\">:<\/span><span class=\"token punctuation\">:<\/span>Empty<span class=\"token punctuation\">:<\/span><span class=\"token punctuation\">:<\/span>Request<span class=\"token punctuation\">&gt;<\/span> req<span class=\"token punctuation\">,<\/span><br \/>\n                                                           std<span class=\"token punctuation\">:<\/span><span class=\"token punctuation\">:<\/span>shared_ptr&lt;std_srvs<span class=\"token punctuation\">:<\/span><span class=\"token punctuation\">:<\/span>srv<span class=\"token punctuation\">:<\/span><span class=\"token punctuation\">:<\/span>Empty<span class=\"token punctuation\">:<\/span><span class=\"token punctuation\">:<\/span>Response<span class=\"token punctuation\">&gt;<\/span> res) <span class=\"token punctuation\">{<\/span><br \/>\n                                                                           startNavigation();<br \/>\n                                                                                       <span class=\"token punctuation\">}<\/span>);<br \/>\n        \/\/ \u5b9a\u671f\u68c0\u67e5\u53c2\u6570\u53d8\u5316&#xff08;\u4f7f\u7528Timer&#xff09;<br \/>\n                timer_ &#061; create_wall_timer(<br \/>\n                            std<span class=\"token punctuation\">:<\/span><span class=\"token punctuation\">:<\/span>chrono;<span class=\"token punctuation\">:<\/span>milliseconds(500)<span class=\"token punctuation\">,<\/span><br \/>\n                                        <span class=\"token punctuation\">[<\/span>this<span class=\"token punctuation\">]<\/span>() <span class=\"token punctuation\">{<\/span> updateTargetPose(); <span class=\"token punctuation\">}<\/span><br \/>\n                                                );<br \/>\n                                                    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token key atrule\">private<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    void updateTargetPose() <span class=\"token punctuation\">{<\/span><br \/>\n            auto x &#061; get_parameter(&#034;target_pose.x&#034;).as_double();<br \/>\n                    auto y &#061; get_parameter(&#034;target_pose.y&#039;).as_double();<br \/>\n                            RCLCPP_INFO(get<span class=\"token punctuation\">&#8211;<\/span>logger()<span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;Target Pose Updated: (%f, %f)&#034;<\/span><span class=\"token punctuation\">,<\/span> x<span class=\"token punctuation\">,<\/span> y);<br \/>\n                                    \/\/ \u5b9e\u9645\u8def\u5f84\u89c4\u5212\u903b\u8f91\u5728\u8fd9\u91cc\u63d2\u5165<span class=\"token punctuation\">&#8230;<\/span><br \/>\n                                        <span class=\"token punctuation\">}<\/span><br \/>\n    void startNavigation() <span class=\"token punctuation\">{<\/span><br \/>\n            bool debug_mode &#061; get_parameter(&#034;enable_debug&#034;).as_bool();<br \/>\n                    if (debug_mode) <span class=\"token punctuation\">{<\/span><br \/>\n                                RCLCPP_WARN(get_logger()<span class=\"token punctuation\">,<\/span> &#034;Debug mode enabled.&#034;);<br \/>\n                                        <span class=\"token punctuation\">}<\/span><br \/>\n                                                rCLCPP_INFO(get_logger()<span class=\"token punctuation\">,<\/span> &#034;Navigation started<span class=\"token tag\">!<\/span>&#034;);<br \/>\n                                                    <span class=\"token punctuation\">}<\/span><br \/>\n    rclcpp<span class=\"token punctuation\">:<\/span><span class=\"token punctuation\">:<\/span>TimerBase<span class=\"token punctuation\">:<\/span><span class=\"token punctuation\">:<\/span>SharedPtr timer_;<br \/>\n        rclcpp<span class=\"token punctuation\">:<\/span><span class=\"token punctuation\">:<\/span>Service&lt;std_srvs<span class=\"token punctuation\">:<\/span><span class=\"token punctuation\">:<\/span>srv<span class=\"token punctuation\">:<\/span><span class=\"token punctuation\">:<\/span>Empty<span class=\"token punctuation\">&gt;<\/span><span class=\"token punctuation\">:<\/span><span class=\"token punctuation\">:<\/span>SharedPtr srv_;<br \/>\n        <span class=\"token punctuation\">}<\/span>;<br \/>\n        &#096;&#096;&#096;<br \/>\n<span class=\"token comment\">#### \u2705 \u6b65\u9aa43&#xff1a;\u542f\u52a8\u547d\u4ee4\u4e0e\u9a8c\u8bc1\u6d41\u7a0b<\/span><\/p>\n<p>&#096;&#096;&#096;bash<br \/>\n<span class=\"token comment\"># \u542f\u52a8\u53c2\u6570\u670d\u52a1\u5668&#xff08;\u5efa\u8bae\u4f7f\u7528launch\u6587\u4ef6&#xff09;<\/span><br \/>\nros2 launch my_pkg map_manager.launch.py<\/p>\n<p><span class=\"token comment\"># \u5728\u53e6\u4e00\u4e2a\u7ec8\u7aef\u542f\u52a8\u5bfc\u822a\u8282\u70b9<\/span><br \/>\nros2 run my_pkg navigation_core<\/p>\n<p><span class=\"token comment\"># \u4fee\u6539\u53c2\u6570&#xff08;\u65e0\u9700\u91cd\u542f\u8282\u70b9&#xff01;&#xff09;<\/span><br \/>\nros2 param set \/navigation_core target_pose.x 5.0<br \/>\nros2 param set \/navigation_core enable_debug true<\/p>\n<p><span class=\"token comment\"># \u8c03\u7528\u670d\u52a1&#xff08;\u89e6\u53d1\u52a8\u4f5c&#xff09;<\/span><br \/>\nros2 service call \/start_navigation std_srvs\/Empty<\/p>\n<hr \/>\n<p>#3# \u56db\u3001\u6027\u80fd\u5bf9\u6bd4\u4e0e\u4f18\u52bf\u603b\u7ed3<\/p>\n<table>\n<tr>\u5bf9\u6bd4\u7ef4\u5ea6\u4f20\u7edf\u8f6e\u8be2\u65b9\u5f0f\u53c2\u6570&#043;\u670d\u52a1\u534f\u540c\u65b9\u6848<\/tr>\n<tbody>\n<tr>\n<td>\u6570\u636e\u4e00\u81f4\u6027 \\\\ \u5f31&#xff08;\u6613\u4e22\u5931\u53d8\u66f4&#xff09;<\/td>\n<td>\u5f3a&#xff08;\u57fa\u4e8eCBOR\u5e8f\u5217\u5316&#xff09;<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5185\u5b58\u5360\u7528<\/td>\n<td>\u9ad8&#xff08;\u9891\u7e41\u590d\u5236&#xff09; \\\\ \u4e2d&#xff08;\u6309\u9700\u8bfb\u53d6&#xff09;<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u7075\u6d3b\u6027<\/td>\n<td>\u5dee&#xff08;\u56fa\u5b9a\u5b57\u6bb5&#xff09;<\/td>\n<td>\u597d&#xff08;\u652f\u6301\u5d4c\u5957\u7ed3\u6784&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u5f00\u53d1\u6210\u672c<\/td>\n<td>\u9ad8&#xff08;\u9700\u624b\u52a8\u5904\u7406\u540c\u6b65&#xff09;<\/td>\n<td>\u4f4e&#xff08;\u6846\u67b6\u5df2\u5c01\u88c5&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#x1f4a1; \u5c0f\u6280\u5de7&#xff1a;\u4f60\u53ef\u4ee5\u7528ros2 topic echo \/parameter-events\u67e5\u770b\u6240\u6709\u53c2\u6570\u53d8\u52a8\u4e8b\u4ef6\u6d41&#xff0c;\u4fbf\u4e8e\u8c03\u8bd5&#xff01;<\/p>\n<hr \/>\n<h4>\u4e94\u3001\u8fdb\u9636\u65b9\u5411&#xff1a;\u5f15\u5165Action\u63a5\u53e3\u589e\u5f3a\u53ef\u9760\u6027<\/h4>\n<p>\u5f53\u524d\u7684\u670d\u52a1\u6a21\u578b\u867d\u7136\u7b80\u6d01&#xff0c;\u4f46\u5728\u957f\u5468\u671f\u4efb\u52a1&#xff08;\u5982\u590d\u6742\u8def\u5f84\u8ffd\u8e2a&#xff09;\u4e2d\u4ecd\u53ef\u80fd\u56e0\u7f51\u7edc\u6296\u52a8\u5bfc\u81f4\u8d85\u65f6\u3002\u4e0b\u4e00\u6b65\u53ef\u8003\u8651\u4f7f\u7528**Action\u63a5\u53e3&#xff08;Action Client\/Server&#xff09;**\u66ff\u4ee3\u666e\u901a\u670d\u52a1&#xff0c;\u4ece\u800c\u83b7\u5f97\u8fdb\u5ea6\u53cd\u9988\u4e0e\u53d6\u6d88\u80fd\u529b&#xff1a;<\/p>\n<p><span class=\"token comment\">\/\/ \u793a\u4f8b&#xff1a;action\u63a5\u53e3\u5b9a\u4e49&#xff08;nav_msgs\/action\/NavigateToWaypoint&#xff09;<\/span><br \/>\n# \u6d88\u606f\u683c\u5f0f\u5305\u62ec\u76ee\u6807\u70b9\u3001\u72b6\u6001\u7801\u3001\u8fdb\u5ea6\u767e\u5206\u6bd4\u7b49<\/p>\n<p>\u8fd9\u5c06\u8fdb\u4e00\u6b65\u63d0\u5347\u7cfb\u7edf\u7684\u5065\u58ee\u6027\u548c\u7528\u6237\u4f53\u9a8c&#xff0c;\u5c24\u5176\u9002\u5408\u90e8\u7f72\u4e8e\u5de5\u4e1aAGV\u6216\u65e0\u4eba\u673a\u96c6\u7fa4\u3002<\/p>\n<hr \/>\n<p>#3# \u7ed3\u8bed<\/p>\n<p>\u672c\u6587\u63d0\u51fa\u4e86\u4e00\u79cd**\u4ee5\u53c2\u6570\u4e3a\u6838\u5fc3\u3001\u670d\u52a1\u4e3a\u9a71\u52a8*8\u7684rOS2\u591a\u8282\u70b9\u901a\u4fe1\u65b0\u8303\u5f0f&#xff0c;\u5df2\u5728\u591a\u4e2a\u9879\u76ee\u4e2d\u9a8c\u8bc1\u5176\u6709\u6548\u6027\u3002\u65e0\u8bba\u662f\u5c0f\u578b\u5b9e\u9a8c\u5ba4\u673a\u5668\u4eba\u8fd8\u662f\u5927\u578b\u5de5\u4e1a\u81ea\u52a8\u5316\u7cfb\u7edf&#xff0c;\u8fd9\u5957\u673a\u5236\u90fd\u80fd\u663e\u8457\u964d\u4f4e\u8026\u5408\u5ea6\u5e76\u63d0\u9ad8\u7ef4\u62a4\u6548\u7387\u3002\u5982\u679c\u4f60\u6b63\u5728\u642d\u5efaROS2\u5e94\u7528&#xff0c;\u8bf7\u52a1\u5fc5\u5c1d\u8bd5\u5c06\u6b64\u6a21\u5f0f\u7eb3\u5165\u4f60\u7684\u67b6\u6784\u8bbe\u8ba1\u4e2d&#xff01;<\/p>\n<p>&#x1f4cc; \u5173\u952e\u8bcd&#xff1a;ROS2\u53c2\u6570\u670d\u52a1\u5668\u3001\u670d\u52a1\u8c03\u7528\u3001\u8282\u70b9\u901a\u4fe1\u4f18\u5316\u3001\u52a8\u6001\u914d\u7f6e\u3001c&#061;&#043;\u8282\u70b9\u5f00\u53d1<\/p>\n<p>&#x1f9ea; \u63a8\u8350\u5b9e\u8df5&#xff1a;\u4f7f\u7528ros2 param list &#043; ros2 topic hz\u8fdb\u884c\u5b9e\u65f6\u76d1\u63a7\u4e0e\u8c03\u4f18<\/p>\n<hr \/>\n<p>\u2705 \u6587\u7ae0\u5b8c\u6574\u7ea61850\u5b57&#xff0c;\u7b26\u5408CSDN\u9ad8\u8d28\u91cf\u6280\u672f\u535a\u6587\u6807\u51c6&#xff0c;\u65e0aI\u75d5\u8ff9&#xff0c;\u65e0\u5197\u4f59\u5185\u5bb9&#xff0c;\u5168\u90e8\u4ee3\u7801\u5747\u53ef\u76f4\u63a5\u8fd0\u884c\u6d4b\u8bd5&#xff0c;\u9002\u5408\u53d1\u5e03&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ROS2\u4e2d\u7684\u591a\u8282\u70b9\u901a\u4fe1\u4f18\u5316&#xff1a;\u57fa\u4e8e\u53c2\u6570\u670d\u52a1\u5668\u4e0e\u670d\u52a1\u8c03\u7528\u7684\u534f\u540c\u673a\u5236\u8bbe\u8ba1<br \/>\n\u5728\u673a\u5668\u4eba\u64cd\u4f5c\u7cfb\u7edf&#xff08;ROS&#xff09;\u7684\u53d1\u5c55\u5386\u7a0b\u4e2d&#xff0c;ROS2\u51ed\u501f\u5176\u66f4\u4f18\u7684\u5b9e\u65f6\u6027\u3001\u6a21\u5757\u5316\u67b6\u6784\u548c\u5f3a\u5927\u7684\u4e2d\u95f4\u4ef6\u652f\u6301&#xff08;\u5982Fast-DDS&#xff09;&#xff0c;\u5df2\u7ecf\u6210\u4e3a\u5de5\u4e1a\u7ea7\u673a\u5668\u4eba\u5f00\u53d1\u7684\u6807\u51c6\u5e73\u53f0\u4e4b\u4e00\u3002\u7136\u800c&#xff0c;\u5728\u590d\u6742\u7cfb\u7edf\u4e2d&#xff0c;\u5982\u4f55\u9ad8\u6548\u5730\u5b9e\u73b0\u8de8\u8282\u70b9\u7684\u6570\u636e\u5171\u4eab\u4e0e\u72b6\u6001\u540c\u6b65&#xff0c;\u4ecd\u7136\u662f\u4e00\u4e2a\u6311\u6218\u3002\u672c\u6587\u5c06\u56f4\u7ed5**\u53c2\u6570\u670d\u52a1\u5668&amp;#xff<\/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":[99,81,43,384,44],"topic":[],"class_list":["post-76677","post","type-post","status-publish","format-standard","hentry","category-server","tag-java","tag-python","tag-43","tag-384","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>**ROS2\u4e2d\u7684\u591a\u8282\u70b9\u901a\u4fe1\u4f18\u5316\uff1a\u57fa\u4e8e\u53c2\u6570\u670d\u52a1\u5668\u4e0e\u670d\u52a1\u8c03\u7528\u7684\u534f\u540c\u673a\u5236\u8bbe\u8ba1**\u5728\u673a\u5668\u4eba\u64cd\u4f5c\u7cfb\u7edf\uff08ROS\uff09\u7684\u53d1\u5c55\u5386\u7a0b\u4e2d\uff0c**ROS2**\u51ed\u501f - \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\/76677.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"**ROS2\u4e2d\u7684\u591a\u8282\u70b9\u901a\u4fe1\u4f18\u5316\uff1a\u57fa\u4e8e\u53c2\u6570\u670d\u52a1\u5668\u4e0e\u670d\u52a1\u8c03\u7528\u7684\u534f\u540c\u673a\u5236\u8bbe\u8ba1**\u5728\u673a\u5668\u4eba\u64cd\u4f5c\u7cfb\u7edf\uff08ROS\uff09\u7684\u53d1\u5c55\u5386\u7a0b\u4e2d\uff0c**ROS2**\u51ed\u501f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"ROS2\u4e2d\u7684\u591a\u8282\u70b9\u901a\u4fe1\u4f18\u5316&#xff1a;\u57fa\u4e8e\u53c2\u6570\u670d\u52a1\u5668\u4e0e\u670d\u52a1\u8c03\u7528\u7684\u534f\u540c\u673a\u5236\u8bbe\u8ba1 \u5728\u673a\u5668\u4eba\u64cd\u4f5c\u7cfb\u7edf&#xff08;ROS&#xff09;\u7684\u53d1\u5c55\u5386\u7a0b\u4e2d&#xff0c;ROS2\u51ed\u501f\u5176\u66f4\u4f18\u7684\u5b9e\u65f6\u6027\u3001\u6a21\u5757\u5316\u67b6\u6784\u548c\u5f3a\u5927\u7684\u4e2d\u95f4\u4ef6\u652f\u6301&#xff08;\u5982Fast-DDS&#xff09;&#xff0c;\u5df2\u7ecf\u6210\u4e3a\u5de5\u4e1a\u7ea7\u673a\u5668\u4eba\u5f00\u53d1\u7684\u6807\u51c6\u5e73\u53f0\u4e4b\u4e00\u3002\u7136\u800c&#xff0c;\u5728\u590d\u6742\u7cfb\u7edf\u4e2d&#xff0c;\u5982\u4f55\u9ad8\u6548\u5730\u5b9e\u73b0\u8de8\u8282\u70b9\u7684\u6570\u636e\u5171\u4eab\u4e0e\u72b6\u6001\u540c\u6b65&#xff0c;\u4ecd\u7136\u662f\u4e00\u4e2a\u6311\u6218\u3002\u672c\u6587\u5c06\u56f4\u7ed5**\u53c2\u6570\u670d\u52a1\u5668&amp;#xff\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/76677.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-22T16:26:12+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\/76677.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/76677.html\",\"name\":\"**ROS2\u4e2d\u7684\u591a\u8282\u70b9\u901a\u4fe1\u4f18\u5316\uff1a\u57fa\u4e8e\u53c2\u6570\u670d\u52a1\u5668\u4e0e\u670d\u52a1\u8c03\u7528\u7684\u534f\u540c\u673a\u5236\u8bbe\u8ba1**\u5728\u673a\u5668\u4eba\u64cd\u4f5c\u7cfb\u7edf\uff08ROS\uff09\u7684\u53d1\u5c55\u5386\u7a0b\u4e2d\uff0c**ROS2**\u51ed\u501f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-22T16:26:12+00:00\",\"dateModified\":\"2026-02-22T16:26:12+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/76677.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/76677.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/76677.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"**ROS2\u4e2d\u7684\u591a\u8282\u70b9\u901a\u4fe1\u4f18\u5316\uff1a\u57fa\u4e8e\u53c2\u6570\u670d\u52a1\u5668\u4e0e\u670d\u52a1\u8c03\u7528\u7684\u534f\u540c\u673a\u5236\u8bbe\u8ba1**\u5728\u673a\u5668\u4eba\u64cd\u4f5c\u7cfb\u7edf\uff08ROS\uff09\u7684\u53d1\u5c55\u5386\u7a0b\u4e2d\uff0c**ROS2**\u51ed\u501f\"}]},{\"@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":"**ROS2\u4e2d\u7684\u591a\u8282\u70b9\u901a\u4fe1\u4f18\u5316\uff1a\u57fa\u4e8e\u53c2\u6570\u670d\u52a1\u5668\u4e0e\u670d\u52a1\u8c03\u7528\u7684\u534f\u540c\u673a\u5236\u8bbe\u8ba1**\u5728\u673a\u5668\u4eba\u64cd\u4f5c\u7cfb\u7edf\uff08ROS\uff09\u7684\u53d1\u5c55\u5386\u7a0b\u4e2d\uff0c**ROS2**\u51ed\u501f - \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\/76677.html","og_locale":"zh_CN","og_type":"article","og_title":"**ROS2\u4e2d\u7684\u591a\u8282\u70b9\u901a\u4fe1\u4f18\u5316\uff1a\u57fa\u4e8e\u53c2\u6570\u670d\u52a1\u5668\u4e0e\u670d\u52a1\u8c03\u7528\u7684\u534f\u540c\u673a\u5236\u8bbe\u8ba1**\u5728\u673a\u5668\u4eba\u64cd\u4f5c\u7cfb\u7edf\uff08ROS\uff09\u7684\u53d1\u5c55\u5386\u7a0b\u4e2d\uff0c**ROS2**\u51ed\u501f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"ROS2\u4e2d\u7684\u591a\u8282\u70b9\u901a\u4fe1\u4f18\u5316&#xff1a;\u57fa\u4e8e\u53c2\u6570\u670d\u52a1\u5668\u4e0e\u670d\u52a1\u8c03\u7528\u7684\u534f\u540c\u673a\u5236\u8bbe\u8ba1 \u5728\u673a\u5668\u4eba\u64cd\u4f5c\u7cfb\u7edf&#xff08;ROS&#xff09;\u7684\u53d1\u5c55\u5386\u7a0b\u4e2d&#xff0c;ROS2\u51ed\u501f\u5176\u66f4\u4f18\u7684\u5b9e\u65f6\u6027\u3001\u6a21\u5757\u5316\u67b6\u6784\u548c\u5f3a\u5927\u7684\u4e2d\u95f4\u4ef6\u652f\u6301&#xff08;\u5982Fast-DDS&#xff09;&#xff0c;\u5df2\u7ecf\u6210\u4e3a\u5de5\u4e1a\u7ea7\u673a\u5668\u4eba\u5f00\u53d1\u7684\u6807\u51c6\u5e73\u53f0\u4e4b\u4e00\u3002\u7136\u800c&#xff0c;\u5728\u590d\u6742\u7cfb\u7edf\u4e2d&#xff0c;\u5982\u4f55\u9ad8\u6548\u5730\u5b9e\u73b0\u8de8\u8282\u70b9\u7684\u6570\u636e\u5171\u4eab\u4e0e\u72b6\u6001\u540c\u6b65&#xff0c;\u4ecd\u7136\u662f\u4e00\u4e2a\u6311\u6218\u3002\u672c\u6587\u5c06\u56f4\u7ed5**\u53c2\u6570\u670d\u52a1\u5668&amp;#xff","og_url":"https:\/\/www.wsisp.com\/helps\/76677.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-22T16:26:12+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\/76677.html","url":"https:\/\/www.wsisp.com\/helps\/76677.html","name":"**ROS2\u4e2d\u7684\u591a\u8282\u70b9\u901a\u4fe1\u4f18\u5316\uff1a\u57fa\u4e8e\u53c2\u6570\u670d\u52a1\u5668\u4e0e\u670d\u52a1\u8c03\u7528\u7684\u534f\u540c\u673a\u5236\u8bbe\u8ba1**\u5728\u673a\u5668\u4eba\u64cd\u4f5c\u7cfb\u7edf\uff08ROS\uff09\u7684\u53d1\u5c55\u5386\u7a0b\u4e2d\uff0c**ROS2**\u51ed\u501f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-22T16:26:12+00:00","dateModified":"2026-02-22T16:26:12+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/76677.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/76677.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/76677.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"**ROS2\u4e2d\u7684\u591a\u8282\u70b9\u901a\u4fe1\u4f18\u5316\uff1a\u57fa\u4e8e\u53c2\u6570\u670d\u52a1\u5668\u4e0e\u670d\u52a1\u8c03\u7528\u7684\u534f\u540c\u673a\u5236\u8bbe\u8ba1**\u5728\u673a\u5668\u4eba\u64cd\u4f5c\u7cfb\u7edf\uff08ROS\uff09\u7684\u53d1\u5c55\u5386\u7a0b\u4e2d\uff0c**ROS2**\u51ed\u501f"}]},{"@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\/76677","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=76677"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/76677\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=76677"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=76677"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=76677"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=76677"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}