ROS——一文读懂:tf_monitor、static_transform_publisher、tf_echo
时间:2022-12-14 14:30:00
虽然 tf 主要用于一个 ROS 该节点的代码库,但它有大量的命令行工具,可以帮助调试和创建 tf 坐标系。 这些工具包括:
-
view_frames:可视化坐标变换的完整树。
-
tf_monitor:转换监控帧。
-
tf_echo:在屏幕上打印指定的变化
-
roswtf:使用 tfwtf 帮助您跟踪插件 tf 的问题。
-
static_transform_publisher 是一个用于发送静态转换的命令行工具。
也许你还想用 tf_remap 该节点是重新映射坐标变换的实用程序节点。
tf_monitor
将当前坐标变换树的信息打印到控制台
rosrun tf tf_monitor
监控特定转换。
tf_monitor <source_frame> <target_target>
static_transform_publisher
static_transform_publisher该工具用于发布两个参考系之间的静态坐标变换,两个参考系一般不会发生相对位置变化
name自己拿,给这个node取一个名字
args 有两种格式,一种是位移 旋转角,一种是位移 四元数:
// 位移 旋转角 static_transform_publisher x y z yaw pitch roll frame_id child_frame_id period_in_ms // 位移 四元数 static_transform_publisher x y z qx qy qz qw frame_id child_frame_id period_in_ms
- frame_id和 child_frame_id参与变换的两个坐标系
- period_in_ms发布频率为毫秒,默认值为100ms
<launch> <node pkg="tf" type="static_transform_publisher" name="link1_broadcaster" args="1 0 0 0 0 0 1 link1_parent link1 100" /> </launch>
tf_echo
tf_echo <source_frame> <target_frame>
打印有关 source_frame 和 target_frame 具体转换信息之间。 例如,回显 /map 和 /odom 两者之间的转换: