Ask Your Question

How to insert static transforms when reading a rosbag?

asked 2018-09-07 13:28:38 -0500

Hakaishin gravatar image

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":

edit retag flag offensive close merge delete


Do you mean that you need the tf_static topic?

stevemacenski gravatar image stevemacenski  ( 2018-09-07 18:22:17 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-09-09 15:12:02 -0500

Hakaishin gravatar image

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

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2018-09-07 13:28:38 -0500

Seen: 306 times

Last updated: Sep 09 '18