Listening to multiple tf transforms in bag file
Hi everybody,
My setup : Ubuntu 12.10, ROS Groovy, laptop with i7 CPU, and 6GB of RAM.
My goal : from a rosbag, being able to write certain transforms (currently, the ones from the openni_tracker (a modified version)) into a txt file, with timestamps.
My problem : based on the tf tutorial on a TfListener, I listened to tf, and tried to write only the part interesting me. Moreover, all the frame I want to write are not always published.
My code snipet si something like that :
In main,
- initialize the ros node
- create the Tf Listener
while the node is ok
for all the possible users I am looking to
if listener.canTransform,
time_of_my_user = ros::Time::now();
for all joints
waitforTransform(time_of_my_user),lookupTransform(time_of_my_user), Write in a txt file
The problem is that I am missing a LOT of transforms. I was thinking it might be because my loops doesn't go fast enought. Thus I tried, when playing the bag file, to use the option "-r 0.1". But in this case, I don't have anything written at all.
May someone enlighten me of his/her knowledge about tf, as I am quite sure I am missing something (maybe about the lookupTransform ?). Or give me another solution in order to be able to write a list of transformations into a txt file (I was maybe thinking about a subscriber to tf ?)...
If needed, I can provide the exact code.
Thanks in advance, Bests regards,
Steph