我使用ROS建图的时候,用的是Kinect的深度信息转换成laser scan,Rviz仿真环境调用出laser scan信息的时候显示如下错误:

Transform [sender=unknown_publisher]
For frame [camera_depth_frame]: No transform to fixed frame [map]. TF error: [Lookup would require extrapolation into the future. Requested time 1554964684.878786069 but the latest data is at time 1554964684.525343790, when looking up transform from frame [camera_depth_frame] to frame [map]]

最后发现错误是因为编码器数据发布的频率太快,将原本30Hz的发布频率改成10Hz的频率即可!

//使用10Hz的频率发布信息

ros::Rate r(10);