ROS与C++入门教程-actionlib-运行action服务器和客户端
ROS与C++入门教程-actionlib-运行action服务器和客户端
说明:
- 介绍如何运行客户端和服务器并可视化通道输出和节点图
启动客户端和服务器
- 新终端,执行roscore
$ roscore
- 新终端,执行客户端
$ rosrun actionlib_tutorials fibonacci_client
- 新终端,执行服务器
$ rosrun actionlib_tutorials fibonacci_server
查看Action的反馈
- 新开终端,执行:
$ rostopic echo /fibonacci/feedback
- 显示:
---
header:
seq: 1
stamp: 1250813676611629000
frame_id:
status:
goal_id:
stamp: 1250813676611339000
id: 1250813676611339000
status: 1
text:
feedback:
sequence: (0, 1, 1)
---
header:
seq: 2
stamp: 1250813677611559000
frame_id:
status:
goal_id:
stamp: 1250813676611339000
id: 1250813676611339000
status: 1
text:
feedback:
sequence: (0, 1, 1, 2)
---
header:
seq: 3
stamp: 1250813678611635000
frame_id:
status:
goal_id:
stamp: 1250813676611339000
id: 1250813676611339000
status: 1
text:
feedback:
sequence: (0, 1, 1, 2, 3)
---
查看action结果:
- 新终端,执行:
$ rostopic echo /fibonacci/result
- 显示:
---
header:
seq: 1
stamp: 1250813759950015000
frame_id:
status:
goal_id:
stamp: 1250813739949752000
id: 1250813739949752000
status: 3
text:
result:
sequence: (0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946)
查看节点图:
- rqt_graph(新)或 rxgraph(旧):
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号