15.4 试试看
在新终端,运行
$ cd ~/catkin_ws
$ . devel/setup.bash
$ rosrun beginner_tutorials add_two_ints_server.py
在新终端,运行
$ cd ~/catkin_ws
$ . devel/setup.bash
$ rosrun beginner_tutorials add_two_ints_client.py
你会看到打印的使用信息,类似于
/home/user/catkin_ws/src/beginner_tutorials/scripts/add_two_ints_client.py [x y]
接着运行
$ rosrun beginner_tutorials add_two_ints_client.py 4 5
你将得到
Requesting 4+5
4 + 5 = 9
the server 将输出
Returning [4 + 5 = 9]
现在你已经学会如何编写简单的Service和Client,开始测试简单的Service和Client吧。
Last updated