ROS1与机器人仿真学习

  • 1075 字

快捷导航

ROS官方urdf教程:http://wiki.ros.org/urdf/Tutorials

常用指令

tf部分

发布static transform

1
2
rosrun tf2_ros static_transform_publisher x y z yaw pitch roll frame_id child_frame_id
rosrun tf2_ros static_transform_publisher x y z qx qy qz qw frame_id child_frame_id

例如:

1
rosrun tf2_ros static_transform_publisher 0 0 0 0 1 0 world a1

可以看到:

1
2
3
4
ddh@LAPTOP-DDH:~/catkin_ws$ rostopic list
/rosout
/rosout_agg
/tf_static

以及:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
ddh@LAPTOP-DDH:~/catkin_ws$ rostopic echo /tf_static
transforms:
-
header:
seq: 0
stamp:
secs: 1742455016
nsecs: 768368367
frame_id: "world"
child_frame_id: "a1"
transform:
translation:
x: 0.0
y: 0.0
z: 0.0
rotation:
x: 0.0
y: 0.479425538604
z: 0.0
w: 0.87758256189
---

使用launch文件发布的方式:

1
2
3
4
<launch>
<node pkg="tf2_ros" type="static_transform_publisher" name="link1_broadcaster"
args="1 0 0 0 0 0 1 link1_parent link1" />
</launch>

赞助喵
非常感谢您的喜欢!
赞助喵
分享这一刻
让朋友们也来瞅瞅!