1.1运行发布者首先运行roscore:$rosrun在尝试使用你的应用前,请确认你已经在调用catkin_make后启用了你工作空间的setup.sh文件.(最好将它写入~/.bashrc文件)#Inyourcatkinworkspace$cd~/catkin_ws$source./devel/setup.bash现在运行上一篇教程中创建的叫做”talker”的发布者:$rosrunbeginner_tutorialstalker(C++)你将会看到类似于:[INFO][WallTime:1314931831.774057]helloworld1314931831.77[INFO][WallTime:1314931832.775497]helloworld1314931832.77[INFO][WallTime:1314931833.778937]helloworld1314931833.78[INFO][WallTime:1314931834.782059]helloworld1314931834.78[INFO][WallTime:1314931835.784853]helloworld1314931835.78[INFO][WallTime:1314931836.788106]helloworld1314931836.79发布者node在运行,现在需要运行从发布者接收message的订阅者:1.2运行订阅者运行上一个教程中创建的叫做”listneer”的订阅者:$rosrunbeginner_tutorialslistener(C++)你将会看到类似于这样的输出:INFO][WallTime:1314931969.258941]/listener_17657_1314931968795Iheardhelloworld1314931969.26[INFO][WallTime:1314931970.262246]/listener_17657_1314931968795Iheardhelloworld1314931970.26[INFO][WallTime:1314931971.266348]/listener_17657_1314931968795Iheardhelloworld1314931971.26[INFO][WallTime:1314931972.270429]/listener_17657_1314931968795Iheardhelloworld1314931972.27[INFO][WallTime:1314931973.274382]/listener_17657_1314931968795Iheardhelloworld1314931973.27[INFO][WallTime:1314931974.277694]/listener_17657_1314931968795Iheardhelloworld1314931974.28[INFO][WallTime:1314931975.283708]/listener_17657_1314931968795Iheardhelloworld1314931975.28至此,你已经验证了一个简单的发布者这和订阅者.