How to insert static transforms when reading a rosbag?
I am trying to write the positions of my camera frame to a file for this I have following code:
for topic, msg, t in bag.read_messages(topics=topics):
if topic == "/tf":
tf_msg = msg.transforms[0]
if tf_msg.child_frame_id == "camera_holder":
write transform to file
Now this is working, but the problem is camera_holder is the false frame. I have a transform between camera_holder and camera but I don't know how to apply it without writing a transformbroadcaster and listener. I don't need a publisher and listener since I have control of all the code and ros is not even running. Is there a way to "insert" a static transform into my rosbag such that I could simply do: if tf_msg.child_frame_id == "camera":
instead of if tf_msg.child_frame_id == "camera_holder":
Do you mean that you need the
tf_static
topic?