Robotics StackExchange | Archived questions

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 cameraholder is the false frame. I have a transform between cameraholder 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":

Asked by Hakaishin on 2018-09-07 13:28:38 UTC

Comments

Do you mean that you need the tf_static topic?

Asked by stevemacenski on 2018-09-07 18:22:17 UTC

Answers

My question was purely worded, but what I was looking for was a duplicate of this question.

Asked by Hakaishin on 2018-09-09 15:12:02 UTC

Comments