Just run roslauch to publish TF once

If you just want to run roslaunch to release TF once, you can use the node tag in the launch file to achieve it.

The following is an example of a launch file that publishes TF once:

<launch> 
    <node pkg="tf2_ros" type="static_transform_publisher" name="static_tf_publisher" args="1 0 0 0 0 0 parent_frame child_frame"/> 
    <!-- 其他节点 -->
 </launch>

In this example, we use the static_transform_publisher node in the tf2_ros package to publish the static transformation from "parent_frame" to "child_frame". The args parameter specifies the transformation matrix, respectively (x, y, z, r, p, y). Note that we don't use the spin function of the ROS node here, because we just want to release the TF once, and we don't need to keep the node running all the time.

After starting this launch file, TF will be released once and end with the end of the node.

おすすめ

転載: blog.csdn.net/k1419197516/article/details/129550143