pcl_ros::transformPointCloud says it does not have the transformation
Hi all, I am using the pcl_ros package in Groovy in order to transform a point cloud in the /map frame (/map -> /odom is given by a localizer node, while /odom -> /rgb_optical_frame is given by a set of transform publishers):
pcl_ros::transformPointCloud(fixedFrame, *cloud, *tcloud, tf_);
However, an exception is raised that says I do not have the transormation from /rgb_optical_frame to /map. If I open rqt and display the transformation tree, this is all connected as expected.
Could it be some issues about timings? How to check them, how to solve?
EDIT: here I add some additional information from the comments I have two machines, on the first machine (I call it sensor-laptop) the following topics are computed: - tf (/map -> /odom, /odom -> /X1_rgb_optical_frame) - point clouds from depth and rgb images
on the second machine (visualization-laptop) I compute the following topics: - point clouds (again) from depth and rgb images sent over the network from sensor-laptop and I am trying to visualize these point clouds using the transformation computed on the other laptop
the two laptops are time-synchronized using chrony, however, the transformPointCloud function says it does not have the transformation:
[ERROR] [1408639544.612446512]: Unable to lookup transform, cache is empty, when looking up transform from frame [/X1_rgb_optical_frame] to frame [/map]
EDIT2: the output of tf_echo and tf_monitor on the visualizer-laptop these outputs have been obtained on visualizer-laptop by setting ROS_MASTER_URI to the address of sensor-laptop
$ rosrun tf tf_echo /map /X1_rgb_optical_frame Failure at 1408704324.631461344 Exception thrown:Could not find a connection between '/map' and '/X1_rgb_optical_frame' because they are not part of the same tree.Tf has two or more unconnected trees. The current list of frames is: Frame /X1_depth_optical_frame exists with parent /X1_depth_frame. Frame /X1_depth_frame exists with parent /X1_link. Frame /X2_depth_frame exists with parent /X2_link. Frame /X2_link exists with parent /base_link. Frame /X2_depth_optical_frame exists with parent /X2_depth_frame. Frame /X1_link exists with parent /base_link. Frame /base_link exists with parent /base_projected. Frame /X1_rgb_frame exists with parent /X1_link. Frame /X2_rgb_frame exists with parent /X2_link. Frame /X2_rgb_optical_frame exists with parent /X2_rgb_frame. Frame /base_projected exists with parent NO_PARENT. Frame /imu exists with parent /base_link. Frame /X1_rgb_optical_frame exists with parent /X1_rgb_frame. Frame /odom exists with parent /map. Frame /map exists with parent NO_PARENT. At time 1408704324.660 - Translation: [0.110, 0.045, 0.540] - Rotation: in Quaternion [0.496, 0.504, 0.503, 0.497] in RPY [1.571, 0.002, 1.585] At time 1408704324.660 - Translation: [0.110, 0.045, 0.540] - Rotation: in Quaternion [0.496, 0.504, 0.503, 0.497] in RPY [1.571, 0.002, 1.585] At time 1408704326.660 - Translation: [0.110, 0.045, 0.540] - Rotation: in Quaternion [0.496, 0.504, 0.503, 0.497] in RPY [1.571, 0.002, 1.585] At time 1408704326.660 - Translation: [0.110, 0.045, 0.540] - Rotation: in Quaternion [0.496, 0.504, 0.503, 0.497] in RPY [1.571, 0.002, 1.585] At time 1408704328.663 - Translation: [0.110, 0.045, 0.540] - Rotation: in ...
Yes, it most probably is. The actual exception should tell you what the problem is.
I have another hypothesis: it could be that you have to somehow tell ROS that the transformation from /rgb_optical_frame to /map is the transformation /rgb_optical_frame->/odom->/map
@lucaluca, the tf library takes care of that
Yeah you're right, I got confused, but if the tree is connected there's no need to tell ROS anything. Sorry :)
dornhege, the exception says this: so, it does not mention anything about timing issues
I think you're missing the actual content here. Can you verify that the time stamp of the point cloud is in the range of the TF times in the listener. Is everything running on a single machine?
dornhege, actually this is run on two machines: one with the sensors and the other with the visualizer in the current configuration: clouds and localization (tf) are computed on the sensor-laptop, then clouds are again computed on visualizer-laptop and I take the tf computed on the sensor-laptop
I cannot send clouds over the network (too large), how can I sync the clouds computed on the visualizer-laptop with the tfs computed on the sensor-laptop?