{"id":437653,"date":"2024-11-07T21:04:44","date_gmt":"2024-11-07T21:04:44","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=437653"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=437653","title":{"rendered":"<span>\u0417\u0430\u043c\u0435\u0442\u043a\u0438 \u043f\u043e ROS: \u041f\u0440\u043e\u0441\u0442\u043e\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 launch \u0444\u0430\u0439\u043b\u044b<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u042d\u0442\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u0438\u0437 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u043e  \u0440\u043e\u0431\u043e\u0442\u043e\u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 <a href=\"https:\/\/ros.org\/\" rel=\"noopener noreferrer nofollow\">ROS<\/a>. \u041f\u0435\u0440\u0432\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/840894\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e launch \u0444\u0430\u0439\u043b\u0430\u0445. \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.<\/p>\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u043e\u0434 \u0432 ROS \u044d\u0442\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b rosrun. \u041d\u043e \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0434 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 rosrun \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0434\u044b \u0432 \u043d\u043e\u0432\u043e\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435.<\/p>\n<p>launch \u0444\u0430\u0439\u043b\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0434 ROS \u0438 rosmaster \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 ROS \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 roslaunch. \u0417\u0430\u043f\u0443\u0441\u043a launch \u0444\u0430\u0439\u043b\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>roslaunch package_name launch_file.launch<\/code><\/pre>\n<p>launch \u0444\u0430\u0439\u043b\u044b \u044d\u0442\u043e \u0444\u0430\u0439\u043b\u044b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 xml \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c launch. <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c launch \u0444\u0430\u0439\u043b \u0443\u043a\u0430\u0437\u0430\u0432 \u043f\u0443\u0442\u044c \u0434\u043e launch \u0444\u0430\u0439\u043b\u0430<\/p>\n<pre><code>roslaunch path\/to\/launch\/file\/launch_file.launch<\/code><\/pre>\n<p>roslaunch \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 roscore \u0435\u0441\u043b\u0438 \u043e\u043d \u0435\u0449\u0435 \u043d\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0441\u044f roscore \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 &#8212;wait. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 roslaunch \u0431\u0443\u0434\u0435\u0442 \u0436\u0434\u0430\u0442\u044c \u043f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 roscore.<\/p>\n<h3>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 launch \u0444\u0430\u0439\u043b\u043e\u0432<\/h3>\n<p>launch \u0444\u0430\u0439\u043b\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u043d\u0430\u0431\u043e\u0440 \u0442\u0435\u0433\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0430\u0441\u043f\u0435\u043a\u0442\u043e\u0432 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u0422\u0435\u0433 <strong>node<\/strong> \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f  \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0443\u0437\u043b\u043e\u0432 ROS. \u0412 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u0445 \u0442\u0435\u0433\u0430 <strong>node<\/strong> \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u043c\u044f \u043f\u0430\u043a\u0435\u0442\u0430, \u043d\u043e\u0434\u044b \u0438\u0442\u0434.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0435\u0433\u0430 node \u0432 launch \u0444\u0430\u0439\u043b\u0435:<\/p>\n<pre><code class=\"xml\">&lt;node pkg=\"turtlesim\" type=\"turtlesim_node\" name=\"turtlesim\" respawn=\"true\"\/&gt;<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <strong>pkg<\/strong> \u0437\u0430\u0434\u0430\u0435\u0442 \u0438\u043c\u044f \u043f\u0430\u043a\u0435\u0442\u0430. type \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0438\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 (\u0438\u043c\u044f \u0443\u0437\u043b\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0437\u0430\u0434\u0430\u0435\u043c \u0432 CMakeLists.txt \u0432 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 add_executable \u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u0441\u043b\u0435 \u0438\u043c\u0435\u043d\u0438 \u043f\u0430\u043a\u0435\u0442\u0430 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0443\u0437\u043b\u0430).  respawn=&#187;true&#187;  \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e \u0443\u0437\u0435\u043b \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0443\u0437\u043b\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a<\/p>\n<pre><code class=\"bash\">rosrun turtlesim turtlesim_node<\/code><\/pre>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0435\u0433\u0430 node \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u043d\u0438\u0435 rosbag \u0444\u0430\u0439\u043b\u0430<\/p>\n<pre><code class=\"xml\">&lt;node pkg=\"rosbag\" type=\"play\" name=\"player\" output=\"screen\" args=\"-l --hz=10 \/home\/vlad\/Downloads\/rgbd_dataset_freiburg1_rpy-2hz-with-pointclouds.bag\"\/&gt;<\/code><\/pre>\n<p>\u042d\u0442\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0435:<\/p>\n<pre><code class=\"bash\">rosbag play -l --hz=10 \/home\/vlad\/Downloads\/rgbd_dataset_freiburg1_rpy-2hz-with-pointclouds.bag<\/code><\/pre>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 \u0442\u0435\u0433\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0433\u0438 remap, param, env \u0438 rosparam.<\/p>\n<p>\u0422\u0435\u0433 <strong>remap<\/strong> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0434\u0430\u0442\u044c \u0430\u043b\u0438\u0430\u0441 (\u043f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c) \u0434\u043b\u044f \u0442\u043e\u043f\u0438\u043a\u0430. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u0442\u0435\u0433\u0443 \u0443\u0437\u0435\u043b \u0431\u0443\u0434\u0435\u0442 \u0434\u0443\u043c\u0430\u0442\u044c \u0447\u0442\u043e \u043e\u043d \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043b \u043d\u0430 \u0442\u043e\u043f\u0438\u043a \/topic1 \u0445\u043e\u0442\u044f \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u043d \u043f\u043e\u0434\u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043d\u0430 \u0442\u043e\u043f\u0438\u043a \/topic2. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0442\u043e\u043f\u0438\u043a \u0438\u043c\u0435\u0435\u0442 \u0434\u043b\u0438\u043d\u043d\u043e\u0435 \u0438\u043b\u0438 \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u0438\u043c\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0442\u043e\u043f\u0438\u043a \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0435\u043e\u043f\u043e\u0442\u043e\u043a\u0430 \u0441 \u043a\u0430\u043c\u0435\u0440\u044b \/usb_cam\/image_raw, \u0430 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u0430\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c rosbag \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442 \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0441\u0432\u043e\u0439 \u0442\u043e\u043f\u0438\u043a. remap \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a<\/p>\n<pre><code class=\"xml\">&lt;remap from=\"~camera_info\" to=\"\/image_publisher_1727120104720172865\/camera_info\" \/&gt;<\/code><\/pre>\n<p>\u0422\u0435\u0433 <strong>param<\/strong> \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0435\u0433\u0430 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0442\u043e\u043f\u0438\u043a\u0430:<\/p>\n<pre><code class=\"xml\">&lt;param name=\"topic\" value=\"\/camera\/depth_registered\/points\" \/&gt;<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0431\u0443\u043b\u0435\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<pre><code class=\"xml\">&lt;param name=\"calculate_points_density\" type=\"bool\" value=\"true\" \/&gt;<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u0442\u0435\u0433\u0435 arg<\/p>\n<pre><code class=\"xml\">&lt;arg name=\"framerate\" default=\"20\" \/&gt;<\/code><\/pre>\n<p>\u0438 \u043f\u043e\u0442\u043e\u043c \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0442\u0435\u0433\u0435 \u0447\u0435\u0440\u0435\u0437 $(arg framerate):<\/p>\n<pre><code class=\"xml\">&lt;param name=\"framerate\" value=\"$(arg framerate)\" \/&gt;<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 launch \u0444\u0430\u0439\u043b\u044b launch \u0444\u0430\u0439\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0435\u0433\u0430 <strong>include<\/strong><\/p>\n<pre><code class=\"xml\">&lt;include file=\"$(find pkg-name)\/path\/filename.launch\"\/&gt;<\/code><\/pre>\n<h3>\u041e\u0442\u043b\u0430\u0434\u043a\u0430 \u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 launch \u0444\u0430\u0439\u043b\u043e\u0432<\/h3>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c launch \u0444\u0430\u0439\u043b \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 <strong>gdb<\/strong> \u0438\u043b\u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>Valgrind<\/strong>.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c launch \u0444\u0430\u0439\u043b \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 gdb \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 l<strong>aunch-prefix<\/strong>=&#187;gdb -ex run &#8212;args&#187;\u0432 \u0442\u0435\u0433 node.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 launch \u0444\u0430\u0439\u043b\u0430<\/p>\n<pre><code class=\"xml\">&lt;launch&gt;     &lt;node name=\"test_node\" pkg=\"test_slam_metrics\" type=\"test_metrics_node\" output=\"screen\" launch-prefix=\"gdb -ex run --args\"\/&gt;      &lt;\/launch&gt;<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 launch \u0444\u0430\u0439\u043b\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b gdb.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0443\u0437\u0435\u043b \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 Valgrind. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c Valgrind \u0438 KCachegrind:<\/p>\n<pre><code class=\"bash\"> sudo apt install valgrind kcachegrind<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0432 launch \u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"xml\">&lt;launch&gt;     &lt;node name=\"test_node\" pkg=\"test_slam_metrics\" type=\"test_metrics_node\" output=\"screen\" launch-prefix=\"valgrind --tool=callgrind --callgrind-out-file=outfile\"\/&gt; &lt;\/launch&gt;<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c launch \u0444\u0430\u0439\u043b \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0442\u0430\u043a\u043e\u0439 \u0432\u044b\u0432\u043e\u0434:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/41e\/31c\/a69\/41e31ca69f0bc5ca7e98fd164f304d61.png\" width=\"758\" height=\"146\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/41e\/31c\/a69\/41e31ca69f0bc5ca7e98fd164f304d61.png\"\/><\/figure>\n<p>\u0414\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 <strong>Valgrind<\/strong> \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c <strong>KCachegrind<\/strong> <\/p>\n<pre><code class=\"bash\"> kcachegrind ~\/.ros\/outfile<\/code><\/pre>\n<p>\u041e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043e\u043a\u043d\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b KCachegrind<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e0d\/67e\/bee\/e0d67ebee8f120a60e6a82945b241d42.png\" alt=\"\" title=\"\" width=\"684\" height=\"486\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e0d\/67e\/bee\/e0d67ebee8f120a60e6a82945b241d42.png\"\/><\/figure>\n<p>\u0412 \u0441\u0435\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043c\u043d\u043e\u0433\u043e \u0433\u0430\u0439\u0434\u043e\u0432 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 KCachegrind, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u043e\u0442 <a href=\"https:\/\/baptiste-wicht.com\/posts\/2011\/09\/profile-c-application-with-callgrind-kcachegrind.html\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u0442<\/a>.<\/p>\n<p>\u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u043a\u0430\u0436\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e launch \u0444\u0430\u0439\u043b\u0430 \u0434\u043b\u044f \u0443\u0437\u043b\u0430 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u043a\u0430\u043c\u0435\u0440\u044b: <\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" ?&gt;  &lt;launch&gt;     &lt;arg name=\"name\" default=\"camera_front\" \/&gt;     &lt;arg name=\"framerate\" default=\"20\" \/&gt;     &lt;arg name=\"camera_info\" default=\"package:\/\/my_cam_driver\/ost.yaml\" \/&gt;      &lt;node name=\"$(arg name)\" pkg=\"my_cam_driver\" type=\"my_cam_driver_node\" output=\"screen\"&gt;         &lt;param name=\"framerate\" value=\"$(arg framerate)\" \/&gt;         &lt;param name=\"camera_info_url\" value=\"$(arg camera_info)\" \/&gt;     &lt;\/node&gt; &lt;\/launch&gt;<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 arg, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0443\u0437\u043b\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0435\u0433\u0430 node.<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043e roslaunch \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 <a href=\"http:\/\/wiki.ros.org\/roslaunch\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435<\/a>. \u0422\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e  \u043d\u0430\u0439\u0442\u0438 \u0441\u0435\u0440\u0438\u044e \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u043e\u0432.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u043a\u0430 \u0432\u0441\u0435.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/850564\/\"> https:\/\/habr.com\/ru\/articles\/850564\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u042d\u0442\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u0438\u0437 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u043e  \u0440\u043e\u0431\u043e\u0442\u043e\u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 <a href=\"https:\/\/ros.org\/\" rel=\"noopener noreferrer nofollow\">ROS<\/a>. \u041f\u0435\u0440\u0432\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/840894\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e launch \u0444\u0430\u0439\u043b\u0430\u0445. \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.<\/p>\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u043e\u0434 \u0432 ROS \u044d\u0442\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b rosrun. \u041d\u043e \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0434 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 rosrun \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0434\u044b \u0432 \u043d\u043e\u0432\u043e\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435.<\/p>\n<p>launch \u0444\u0430\u0439\u043b\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0434 ROS \u0438 rosmaster \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 ROS \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 roslaunch. \u0417\u0430\u043f\u0443\u0441\u043a launch \u0444\u0430\u0439\u043b\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>roslaunch package_name launch_file.launch<\/code><\/pre>\n<p>launch \u0444\u0430\u0439\u043b\u044b \u044d\u0442\u043e \u0444\u0430\u0439\u043b\u044b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 xml \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c launch. <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c launch \u0444\u0430\u0439\u043b \u0443\u043a\u0430\u0437\u0430\u0432 \u043f\u0443\u0442\u044c \u0434\u043e launch \u0444\u0430\u0439\u043b\u0430<\/p>\n<pre><code>roslaunch path\/to\/launch\/file\/launch_file.launch<\/code><\/pre>\n<p>roslaunch \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 roscore \u0435\u0441\u043b\u0438 \u043e\u043d \u0435\u0449\u0435 \u043d\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0441\u044f roscore \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 &#8212;wait. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 roslaunch \u0431\u0443\u0434\u0435\u0442 \u0436\u0434\u0430\u0442\u044c \u043f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 roscore.<\/p>\n<h3>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 launch \u0444\u0430\u0439\u043b\u043e\u0432<\/h3>\n<p>launch \u0444\u0430\u0439\u043b\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u043d\u0430\u0431\u043e\u0440 \u0442\u0435\u0433\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0430\u0441\u043f\u0435\u043a\u0442\u043e\u0432 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u0422\u0435\u0433 <strong>node<\/strong> \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f  \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0443\u0437\u043b\u043e\u0432 ROS. \u0412 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u0445 \u0442\u0435\u0433\u0430 <strong>node<\/strong> \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u043c\u044f \u043f\u0430\u043a\u0435\u0442\u0430, \u043d\u043e\u0434\u044b \u0438\u0442\u0434.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0435\u0433\u0430 node \u0432 launch \u0444\u0430\u0439\u043b\u0435:<\/p>\n<pre><code class=\"xml\">&lt;node pkg=\"turtlesim\" type=\"turtlesim_node\" name=\"turtlesim\" respawn=\"true\"\/&gt;<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <strong>pkg<\/strong> \u0437\u0430\u0434\u0430\u0435\u0442 \u0438\u043c\u044f \u043f\u0430\u043a\u0435\u0442\u0430. type \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0438\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 (\u0438\u043c\u044f \u0443\u0437\u043b\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0437\u0430\u0434\u0430\u0435\u043c \u0432 CMakeLists.txt \u0432 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 add_executable \u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u0441\u043b\u0435 \u0438\u043c\u0435\u043d\u0438 \u043f\u0430\u043a\u0435\u0442\u0430 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0443\u0437\u043b\u0430).  respawn=&#187;true&#187;  \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e \u0443\u0437\u0435\u043b \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0443\u0437\u043b\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a<\/p>\n<pre><code class=\"bash\">rosrun turtlesim turtlesim_node<\/code><\/pre>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0435\u0433\u0430 node \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u043d\u0438\u0435 rosbag \u0444\u0430\u0439\u043b\u0430<\/p>\n<pre><code class=\"xml\">&lt;node pkg=\"rosbag\" type=\"play\" name=\"player\" output=\"screen\" args=\"-l --hz=10 \/home\/vlad\/Downloads\/rgbd_dataset_freiburg1_rpy-2hz-with-pointclouds.bag\"\/&gt;<\/code><\/pre>\n<p>\u042d\u0442\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0435:<\/p>\n<pre><code class=\"bash\">rosbag play -l --hz=10 \/home\/vlad\/Downloads\/rgbd_dataset_freiburg1_rpy-2hz-with-pointclouds.bag<\/code><\/pre>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 \u0442\u0435\u0433\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0433\u0438 remap, param, env \u0438 rosparam.<\/p>\n<p>\u0422\u0435\u0433 <strong>remap<\/strong> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0434\u0430\u0442\u044c \u0430\u043b\u0438\u0430\u0441 (\u043f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c) \u0434\u043b\u044f \u0442\u043e\u043f\u0438\u043a\u0430. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u0442\u0435\u0433\u0443 \u0443\u0437\u0435\u043b \u0431\u0443\u0434\u0435\u0442 \u0434\u0443\u043c\u0430\u0442\u044c \u0447\u0442\u043e \u043e\u043d \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043b \u043d\u0430 \u0442\u043e\u043f\u0438\u043a \/topic1 \u0445\u043e\u0442\u044f \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u043d \u043f\u043e\u0434\u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043d\u0430 \u0442\u043e\u043f\u0438\u043a \/topic2. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0442\u043e\u043f\u0438\u043a \u0438\u043c\u0435\u0435\u0442 \u0434\u043b\u0438\u043d\u043d\u043e\u0435 \u0438\u043b\u0438 \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u0438\u043c\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0442\u043e\u043f\u0438\u043a \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0435\u043e\u043f\u043e\u0442\u043e\u043a\u0430 \u0441 \u043a\u0430\u043c\u0435\u0440\u044b \/usb_cam\/image_raw, \u0430 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u0430\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c rosbag \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442 \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0441\u0432\u043e\u0439 \u0442\u043e\u043f\u0438\u043a. remap \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a<\/p>\n<pre><code class=\"xml\">&lt;remap from=\"~camera_info\" to=\"\/image_publisher_1727120104720172865\/camera_info\" \/&gt;<\/code><\/pre>\n<p>\u0422\u0435\u0433 <strong>param<\/strong> \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0435\u0433\u0430 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0442\u043e\u043f\u0438\u043a\u0430:<\/p>\n<pre><code class=\"xml\">&lt;param name=\"topic\" value=\"\/camera\/depth_registered\/points\" \/&gt;<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0431\u0443\u043b\u0435\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<pre><code class=\"xml\">&lt;param name=\"calculate_points_density\" type=\"bool\" value=\"true\" \/&gt;<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u0442\u0435\u0433\u0435 arg<\/p>\n<pre><code class=\"xml\">&lt;arg name=\"framerate\" default=\"20\" \/&gt;<\/code><\/pre>\n<p>\u0438 \u043f\u043e\u0442\u043e\u043c \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0442\u0435\u0433\u0435 \u0447\u0435\u0440\u0435\u0437 $(arg framerate):<\/p>\n<pre><code class=\"xml\">&lt;param name=\"framerate\" value=\"$(arg framerate)\" \/&gt;<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 launch \u0444\u0430\u0439\u043b\u044b launch \u0444\u0430\u0439\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0435\u0433\u0430 <strong>include<\/strong><\/p>\n<pre><code class=\"xml\">&lt;include file=\"$(find pkg-name)\/path\/filename.launch\"\/&gt;<\/code><\/pre>\n<h3>\u041e\u0442\u043b\u0430\u0434\u043a\u0430 \u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 launch \u0444\u0430\u0439\u043b\u043e\u0432<\/h3>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c launch \u0444\u0430\u0439\u043b \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 <strong>gdb<\/strong> \u0438\u043b\u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>Valgrind<\/strong>.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c launch \u0444\u0430\u0439\u043b \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 gdb \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 l<strong>aunch-prefix<\/strong>=&#187;gdb -ex run &#8212;args&#187;\u0432 \u0442\u0435\u0433 node.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 launch \u0444\u0430\u0439\u043b\u0430<\/p>\n<pre><code class=\"xml\">&lt;launch&gt;     &lt;node name=\"test_node\" pkg=\"test_slam_metrics\" type=\"test_metrics_node\" output=\"screen\" launch-prefix=\"gdb -ex run --args\"\/&gt;      &lt;\/launch&gt;<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 launch \u0444\u0430\u0439\u043b\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b gdb.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0443\u0437\u0435\u043b \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 Valgrind. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c Valgrind \u0438 KCachegrind:<\/p>\n<pre><code class=\"bash\"> sudo apt install valgrind kcachegrind<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0432 launch \u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"xml\">&lt;launch&gt;     &lt;node name=\"test_node\" pkg=\"test_slam_metrics\" type=\"test_metrics_node\" output=\"screen\" launch-prefix=\"valgrind --tool=callgrind --callgrind-out-file=outfile\"\/&gt; &lt;\/launch&gt;<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c launch \u0444\u0430\u0439\u043b \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0442\u0430\u043a\u043e\u0439 \u0432\u044b\u0432\u043e\u0434:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0414\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 <strong>Valgrind<\/strong> \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c <strong>KCachegrind<\/strong> <\/p>\n<pre><code class=\"bash\"> kcachegrind ~\/.ros\/outfile<\/code><\/pre>\n<p>\u041e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043e\u043a\u043d\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b KCachegrind<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u0441\u0435\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043c\u043d\u043e\u0433\u043e \u0433\u0430\u0439\u0434\u043e\u0432 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 KCachegrind, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u043e\u0442 <a href=\"https:\/\/baptiste-wicht.com\/posts\/2011\/09\/profile-c-application-with-callgrind-kcachegrind.html\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u0442<\/a>.<\/p>\n<p>\u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u043a\u0430\u0436\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e launch \u0444\u0430\u0439\u043b\u0430 \u0434\u043b\u044f \u0443\u0437\u043b\u0430 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u043a\u0430\u043c\u0435\u0440\u044b: <\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" ?&gt;  &lt;launch&gt;     &lt;arg name=\"name\" default=\"camera_front\" \/&gt;     &lt;arg name=\"framerate\" default=\"20\" \/&gt;     &lt;arg name=\"camera_info\" default=\"package:\/\/my_cam_driver\/ost.yaml\" \/&gt;      &lt;node name=\"$(arg name)\" pkg=\"my_cam_driver\" type=\"my_cam_driver_node\" output=\"screen\"&gt;         &lt;param name=\"framerate\" value=\"$(arg framerate)\" \/&gt;         &lt;param name=\"camera_info_url\" value=\"$(arg camera_info)\" \/&gt;     &lt;\/node&gt; &lt;\/launch&gt;<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 arg, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0443\u0437\u043b\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0435\u0433\u0430 node.<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043e roslaunch \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 <a href=\"http:\/\/wiki.ros.org\/roslaunch\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435<\/a>. \u0422\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e  \u043d\u0430\u0439\u0442\u0438 \u0441\u0435\u0440\u0438\u044e \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u043e\u0432.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u043a\u0430 \u0432\u0441\u0435.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/850564\/\"> https:\/\/habr.com\/ru\/articles\/850564\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-437653","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/437653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=437653"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/437653\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=437653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=437653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=437653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}