ros 发生frame[]not exit
问题描述:在写ros程序的时候,利用
sensor_msgs::PointCloud2 syc_laserCloudregister;函数进行函数撰写的时候发生了 fixframe[]not exit的问题,还发生在transform的选项中,但是我也设置了frame id。
后来经过查阅网上的资料,没有想要的结果。最终通过自己的调试,找到了问题的原因。
解决方法:
将
sensor_msgs::PointCloud2 syc_laserCloudregister;将定义不要作为全局函数,要作为局部变量放在回调函数中。
按照如下顺序
sensor_msgs::PointCloud2 syc_laserCloudregister;
pcl::toROSMsg(*lasersurr,syc_laserCloudSurround);
pubsurrd->publish(syc_laserCloudSurround);
放在回调函数中。

浙公网安备 33010602011771号