随笔之ros多线程
2016-04-06 18:46
337 查看
nt main(int argc, char **argv) { ros::init(argc, argv, "convert_to_mono"); ros::NodeHandle nh; ros::Publisher image_pub = nh.advertise<sensor_msgs::Image>("image_hsv", 1000); ros::Subscriber image_sub = nh.subscribe(image_topic, 1000, &update_image); ros::Subscriber range_sub = nh.subscribe("sonar_height", 1000, &update_range); ros::Publisher cmd_vel_pub=nh.advertise<geometry_msgs::Twist>("/cmd_vel",1); ros::AsyncSpinner spinner(4); // Use 4 threads spinner.start(); ros::Rate loop_rate(22); while (ros::ok()) { loop_rate.sleep(); } ros::waitForShutdown(); return 0; }
相关文章推荐
- android 6.0 logcat机制(二)logcat从logd中获取log保存到文件中
- 基于echo例子的netty4通信总结
- “睡眠猴子”团队项目及成员介绍
- HDU 4722 (数位DP 水~)
- 自定义View之 onMeasure() view的高度自适应wrap_content view的测量
- 单词拼接
- 瑞昱RTL8710对标乐鑫ESP8266 谁将成为物联网首选
- 学习笔记:Android里JSON解析的几种方法
- QSignalMapper Class
- 定时任务
- Android 四大组件之ContentProvider工作原理
- NDK引用NDK生成的so
- 补间动画TweenAnimation
- Linq to Xml读取复杂xml(带命名空间)
- 基础算法-归并排序
- 第七周学习总结
- LeetCode-136. Single Number/137. Single Number II/260. Single Number III
- 我的第一篇csdn博客
- TCP 和 UDP 在socket编程中的区别
- bzoj 2502(有上下界的最小流)