How to visualize tf data in python?
I would like to visualize tf data from a bag I have in python(it should look like it looks in rviz). Maybe using rviz, but it doesn't have to be. I know I could use python to call system calls, but this feels very clunky. I currently am visualizing images like this:
bag = rosbag.Bag(os.path.join(Dataset.bags_path, dataset.name + ".bag"))
for topic, msg, t in bag.read_messages(topics=topics):
image = bridge.imgmsg_to_cv2(msg, "bgr8")
cv2.imshow("Image", image)
cv2.waitKey(10)
# visalize tf somehow
Is there a similar way to do this for the tf data?
EDIT: I would like to see a certain feature of the tf data. The feature would be a certain frame not moving too much. This I would like to verify visually and not programmatically, since I'm afraid that might be too finiky. When I verified that, I would like to press space and to record the timestamp of that moment. For that I thought it would be a good idea to visualize the tf tree inside of a python program, so that I can grab the timestamp directly in the code on a space press. Right now I play the bag manually and then pause it and copy paste the timestamp into a file, which is cumbersome. I hope this was enough info, let me know if it is still unclear.
the question title asks about TF, but the body shows code for visualising images.
Can you clarify what it is you're after exactly?
I am after what I asked. How can I visualize tf data, in a fashion similar to the how I do it with images. I am imagining something like: rviz.visualize(msg) or the like
Okay, your question doesn't make that very clear. I would recommend using RVIZ for all of this, that is exactly what it's for.
Yes, but I would like to automate certain tasks in rviz. This is why "simply" using rviz is not useful, because it doesn't allow me to automate my tasks
Can you describe exactly what you're trying to achieve so we can get an idea if it's possible in RVIZ or not. The 3D visualizations in RVIZ are very complex rebuilding them from scratch should not be taken lightly.