Ask Your Question

Dynamically adding a static transformation to tf

asked 2015-06-22 13:10:52 -0500

Sebastian gravatar image

I have written an object in C++ which contains position and orientation information in member variables. These variables are not likely to change over the lifetime of the object. I am using these variables to perform my own hard-coded transforms between the world and the frame defined by each object.

I realize now that this is probably not the correct way to do things, and I should be using tf to do this work for me.

My question is how do I setup a static frame for each object when it is constructed?

I know I can create a static_transform_publisher node to do this, but I'm not too excited about creating a bunch of nodes during program operation that don't really do anything. It seems opposed to the ROS design philosophy.

Is there some object I can create that will do this for me?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-06-22 17:56:21 -0500

updated 2015-06-23 15:16:03 -0500

multistatic_transform_publisher from lscr_tf_tools can help with this. You can run a single transform publisher node, and use messages to tell it to set transforms.

edit flag offensive delete link more

answered 2015-06-22 18:27:48 -0500

tfoote gravatar image

You can publish the static transforms from within your code just like regular transforms. I recommend using the StaticTransformPublisher class which is all that the command line tool does.

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: 2015-06-22 13:10:52 -0500

Seen: 2,261 times

Last updated: Jun 23 '15