This commit is contained in:
2026-08-05 18:17:25 +08:00
parent 61796dfa9f
commit b52cee9e39
34 changed files with 866 additions and 309 deletions
+11 -11
View File
@@ -290,8 +290,8 @@ sudo apt install ros-humble-robot-state-publisher
ros2 run robot_state_publisher robot_state_publisher \
--ros-args -p robot_description:="$(xacro arm.urdf)"
# 发布 JointState(本仓库 cpp_robot_tf2 就是这个)
ros2 run cpp_robot_tf2 joint_state_publisher
# 发布 JointState(本仓库 cpp_robot_tf2 就是这个,executable 名 joint_state_publisher_cpp)
ros2 run cpp_robot_tf2 joint_state_publisher_cpp
```
### 7.3 看 TF 树
@@ -380,16 +380,16 @@ def transform_grasp_to_base(camera_pose, buffer):
docker exec ros2_dev bash -lc "source /root/ros2_ws/install/setup.bash && ros2 launch bringup robot_launch.py"
```
**预期日志**:
**预期日志**(launch 用 `name=` 重命名去掉了 `_cpp` 后缀,所以节点名是 joint_state_publisher / tf2_listener,而 `[INFO]` 前缀里显示的是 launch 起的 process 名,带 `_cpp`):
```
[joint_state_publisher_cpp]: joint_state_publisher_cpp started, joints: 3
[tf2_listener_cpp]: tf2_listener_cpp started
[robot_state_publisher]: got segment base_link
[robot_state_publisher]: got segment link1
[robot_state_publisher]: got segment link2
[robot_state_publisher]: got segment gripper
[tf2_listener_cpp]: gripper in base_link: x=0.013 y=0.004 z=0.299
[tf2_listener_cpp]: gripper in base_link: x=0.019 y=0.009 z=0.298
[joint_state_publisher_cpp-1] [INFO] [...] JointStatePublisher started, joints: 3
[tf2_listener_cpp-2] [INFO] [...] Tf2Listener started: from=base_link to=gripper
[robot_state_publisher-3] [INFO] [...] got segment base_link
[robot_state_publisher-3] [INFO] [...] got segment link1
[robot_state_publisher-3] [INFO] [...] got segment link2
[robot_state_publisher-3] [INFO] [...] got segment gripper
[tf2_listener_cpp-2] [INFO] [...] gripper in base_link: x=0.013 y=0.004 z=0.299
[tf2_listener_cpp-2] [INFO] [...] gripper in base_link: x=0.019 y=0.009 z=0.298
```
### 10.2 看 TF 树(PDF)