赞
踩
ROS默认一个线程,也就是如果有多个订阅者对象,回调函数会一个接一个执行,对于一般的数据处理来说,一个线程可能已经足够执行多个回调函数并且看不出来阻塞的迹象,但是对于点云等大体量的数据处理来说,一个线程往往不能满足,ROS提供多线程处理方式
ros::MultiThreadedSpinner spinner(4); // Use 4 threads
spinner.spin(); // spin() will not return until the node has been shutdown
ROS官文地址: link
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。