Reading bagfiles in Matlab: bag.AvailableFrames is empty

asked 2022-10-13 10:25:16 -0500

anturtla gravatar image

Hi,

I recorded some bagfiles, and while trying to access them with Matlab, using bag = rosbag(myfile.bag) and then topic = select(bag, 'Topic', '/tf') function to access /tf topic, there is a field of the topic struct called topic.AvailableFrames which is empty. The fact that this field is empty prevents me to use the functions canTransform and getTransform in Matlab, to retrieve transforms between any frame at any moment in Matlab. Anyway, accessing the single fields of the msg structure obtained with readMessages(topic) function, I correctly see all the messages with the reciprocal transform between parent and child frame (to parse them, I should check time instants and write all the products by myself!). When we saw this, we decided to try playing the bagfile in ROS and repeat the rosbag again (on the played file): at the end of this procedure I get a rosbag that has AvailableFrames displayed correctly, but I have a number of files and would avoid recording each one again if possible. Someone can tell why in the first file it is impossible to read the list of available frames?

I used ROS Noetic on Ubuntu 20.04 LTS and Matlab 2020b on Windows 10. Thank you!

edit retag flag offensive close merge delete