velodyne transform_node error require extrapolation
I am runing three nodes trying to transform a velodyne point_cloud with a /tf.
rosrun velodyne_driver velodyne_node _model:=32E _pcap:=file.pcap
(publishing /velodyne_packets)
rosrun robot_setup_tf tf_broadcaster
(publishing /tf with parent "base_link" and children "velodyne")
The kernel of my tf_broadcaster publish an increment translation :
int i=1;
while(n.ok()){
broadcaster.sendTransform(
tf::StampedTransform(
tf::Transform(tf::Quaternion(0, 0, 0, 1), tf::Vector3(10+i, 20, 20)),
ros::Time::now(),"base_link", "velodyne"));
r.sleep();
i=i+1;
}
And the third node is:
rosrun velodyne_pointcloud transform_node _frame_id:=/base_link _calibration:=32db.yaml
(subscribing /velodyne_packets and /tf and publishing /velodyne_points)
I am getting this error:
Lookup would require extrapolation into the past. Requested time 00.. but the earliest data is at time 00.., when looking up transform from frame [velodyne] to frame [base_link]
I have seen other answers about changing time(0) to time.now() but it is inside the code of transform_node provided by ROS and I don't think I should change it, do I? . I think the error should be in my parametrization. Any ideas? Thanks in advance
Updated:
The error is at the beginning but the node still works apparently. In addition in some executions the error does not appear.
I have tried changing the _frame_id from the transform_node from /base_link to /velodyne and I get the same tf.
When I use rviz I see the same pointcloud, I can not see the applied transformation (translation). I use Decay time > 1 and I should see pointcloud accumulated and each new frame should be translated respect the previous one and I can not see the change.
Rqt_graph shows that transform_node is subscribed to /tf but I can not see the transformed point cloud.
rosrun tf tf_echo base_link velodyne
At time 1465466281.155
- Translation: [1005.000, 20.000, 20.000]
- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]
in RPY (radian) [0.000, -0.000, 0.000]
in RPY (degree) [0.000, -0.000, 0.000]
.
rosrun tf view_frames
pdf with information::
view_frames Result
Recorded at time: 1465466163.119
base_link --> velodyne
Broadcaster: /robot_tf_publisher
Average rate: 100.202 Hz
Most recent transform: 1465466163.115 ( 0.005 sec old)
Buffer length: 4.940 sec
.
rostopic echo /tf
transforms:
-
header:
seq: 0
stamp: secs: 1465466125 nsecs: 274628467
frame_id: base_link
child_frame_id: velodyne
transform:
translation: x: 25133.0 y: 20.0 z: 20.0
rotation: x: 0.0 y: 0.0 z: 0.0 w: 1.0
It's probably normal to get those messages when starting up, but they should go away once the transform is available. Or, perhaps your tf broadcaster has a problem. Could you edit your question and post the relevant parts?
update done. Seems like tf is right, but I can not see the translation in rviz, maybe because the center is also translated. How can I check the transformation?
thank you very much, now I can see it is working with transform_node _frame_id:=/base_link and rviz with decay > 1. shall I close the question?