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

/tf_static wait for all static transforms?

asked 2019-05-06 02:52:49 -0500

Hendrik Wiese gravatar image

Hi everyone,

is there any way to determine whether all so far available static transforms have been captured by a subscriber? /tf_static seems to be a latched topic. So I'll assume there's some way to check if there are latched messages available, is that correct?

Cheers, Hendrik

edit retag flag offensive close merge delete

Comments

Latched publishers should send "all" messages upon connection of a (late) subscriber. Immediately.

I don't believe there is a way to check how many "outstanding messages" there are, but I could be wrong.

(it's also conceptually difficult I believe: msgs can be published at any time, even with latched publishers, so when would you know that you've received "all of them"?)

gvdhoorn gravatar image gvdhoorn  ( 2019-05-06 03:10:11 -0500 )edit

I just need a way to detect whether I've gotten all statically defined tf frames. One alternative solution might be to have them configured in a central place and rely on that configuration everywhere I can instead of rostopics...

Hendrik Wiese gravatar image Hendrik Wiese  ( 2019-05-13 02:47:40 -0500 )edit

I just need a way to detect whether I've gotten all statically defined tf frames

at a particular point in time then and for a given a priori known set, you mean? Conceptually "whether I've gotten all statically defined tf frames" seems impossible, in general. TF is a distributed system. That makes it difficult (but not impossible) to achieve a guaranteed, deterministic and coherent view of a shared state.

One alternative solution might be to have them configured in a central place and rely on that configuration everywhere I can instead of rostopics...

this sounds like you have another issue, which prompted you to ask this question.

gvdhoorn gravatar image gvdhoorn  ( 2019-05-13 03:01:21 -0500 )edit

Probably have, yes. The problem is that I have a project that interacts with ROS but does not really rely on ROS. It has its own representation of coordinate systems that I'm trying to synchronize with ROS (TF) the moment it starts. The start-up procedure includes synchronizing the TF frames with the internal representation. The reason I do that is to be able to use the project without ROS/TF in completely different setups and completely different data sources (such as ROS topics).

Hendrik Wiese gravatar image Hendrik Wiese  ( 2019-05-13 03:18:35 -0500 )edit

And that is not working for you? I expect it doesn't, otherwise you wouldn't be posting here, but your last comment does not seem to contain any description of a problem.

gvdhoorn gravatar image gvdhoorn  ( 2019-05-13 03:21:55 -0500 )edit

It kind of works by ignoring errors that occur as long as some tf_static frames are not processed yet. It's kind of a race condition, where my script is trying to work with frames that my synchronization callback hasn't received yet. The errors of course vanish after all expected frames have been processed from tf_static. It's just that I would like to streamline this so that these errors really only occur if a frame is actually missing for whatever reason (I don't necessarily configure the frames all by myself) and not just because they are not yet processed. I don't want to rely on time to consider the corresponding frames missing. I would like to be sure. The static frames are usually known in a certain environment but I, as the developer, don't have to know the setup, however, the script should. That's ...(more)

Hendrik Wiese gravatar image Hendrik Wiese  ( 2019-05-14 07:47:51 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-05-14 07:53:31 -0500

gvdhoorn gravatar image

updated 2019-05-14 07:58:04 -0500

It's kind of a race condition, where my script is trying to work with frames that my synchronization callback hasn't received yet.

Afaik there is no difference between static or regular transforms in this case: in all cases consumers should check whether transforms are available before trying to use them. TF2 provides infrastructure for that: tf2_ros::Buffer::canTransform(..) fi, TF1 had waitForTransform(..).

Even if it were just a regular ROS application (ie: not an integration) consumer code should check before use.

I don't want to rely on time to consider the corresponding frames missing. I would like to be sure

and you could, if you'd use the appropriate functionality for that (ie: canTransform(..) and/or waitForTransform(..)).

edit flag offensive delete link more

Comments

Ah, some waitForTransform or canTransform is a good idea, actually. I haven't thought about that yet... I'll just have to implement it for my own transform manager... shouldn't be that big of a deal.

Thanks!

Hendrik Wiese gravatar image Hendrik Wiese  ( 2019-05-24 10:07:28 -0500 )edit

Question Tools

Stats

Asked: 2019-05-06 02:52:49 -0500

Seen: 730 times

Last updated: May 06 '19