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

Reading the sequence number from a transform

asked 2012-08-27 12:25:55 -0600

0pc0 gravatar image

updated 2014-01-28 17:13:29 -0600

ngrennan gravatar image

Hi folks!

I'd like to be able to use the sequence number from a transform that I am getting from a motion capture vrpn. I use this piece of code to read the transform:

tf_listener.lookupTransform("/optitrak", "/quad",  ros::Time(0), quad);

and am attempting to read the sequence via:

 seq= quad.header.seq;

But, naturally, the transform does not include that header. How can I read get both the transform and it's associated sequence number?

Thanks, Parker

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2012-08-27 16:02:21 -0600

weiin gravatar image

As far as I know, it is not possible to get the sequence number due to the design of how tf works. Since there can be multiple producers of tf info, data can arrive out of order and may not be synchronized. It is the consumer's responsibility to check for the required tf using the timestamp, hence the lookupTransform with associated time (ros::Time(0) for example to get the latest tf)

If it is absolutely necessary to have a sequence number, it is probably best to go back to the producer (in your case, whoever broadcasts /optitrak->/quad) and publish that transform with stamp. But I'm wondering about the necessity of this, since by your tf lookup, you know it is the latest tf, and can just be seq+1 by default.

edit flag offensive delete link more

Comments

AFAIK tf even interpolates between frame, so there might not be any single message behind a tf request.

dornhege gravatar image dornhege  ( 2012-08-27 23:59:13 -0600 )edit

Question Tools

Stats

Asked: 2012-08-27 12:25:55 -0600

Seen: 458 times

Last updated: Aug 27 '12