学习视频:

11.订阅者Subscriber的编程实现_哔哩哔哩_bilibili

创建订阅者:

先将相关源码放入src内部:

 进行编译前一样要先设定编译规则:

add_executable(pose_subscriber src/pose_subscriber.cpp)

target_link_libraries(pose_subscriber ${catkin_LIBRARIES})

 保存后回到根目录进行编译:

catkin_make

 

 编译后要记得设定环境变量;

 source devel/setup.bash

后续再使用就好了;