ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Does tf::StampedTransform create a parent and child frame if they both do not exist?

asked 2018-03-27 12:01:11 -0500

MechLc gravatar image

Hi everyone! Quick question on tf::StampedTransform. By using that function in C++ does it create parent frame and child frame automatically? EX:

 br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "banana", "basket"));

In this case does the frame banana and basket get created? Thanks!

edit retag flag offensive close merge delete

Comments

That depends on how you define when a frame is "created".

gvdhoorn gravatar image gvdhoorn  ( 2018-03-27 12:08:38 -0500 )edit

I guess my question is where is a frame defined? Within the broadcasters CPP file or somewhere else?

MechLc gravatar image MechLc  ( 2018-03-27 12:12:35 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-03-27 15:04:20 -0500

tfoote gravatar image

updated 2018-03-27 15:04:44 -0500

After publishing the transform between 'banana' and 'basket' you can lookup the transform between them on a TransformListener as soon as the message has been received.

There is no explicit creation of a frame, there are only transforms stored between frames. That's why @gvdhoorn is referencing. It will automatically traverse any existing transforms to attempt to find any frame for which there is information.

The availability of a transform that references a frame will avoid the LookupException and cause a ConnectivityException or an ExtrapolationException so in that kind of reference the frame is "created" when published. It does not matter if it's a child or parent.

edit flag offensive delete link more

Comments

so what is the origin of banana(parent frame)?

MechLc gravatar image MechLc  ( 2018-03-27 15:11:37 -0500 )edit

There is none (or it is zero, depending on how you view it). You can look up the transform from banana to basket, but as long as neither banana nor basket have transforms available to any other frames, they are completely independent of anything else.

mgruhler gravatar image mgruhler  ( 2018-03-28 01:09:52 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-03-27 12:01:11 -0500

Seen: 910 times

Last updated: Mar 27 '18