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

Revision history [back]

It sounds like you want to serialize and the deserialize all the tf data in a tf2_ros Buffer, which doesn't look supported.

One possibly glitchy approach is to record the /tf and /tf_static topics into a bag for 10-20 seconds, then play it back in a loop, then do tf lookups. There may be glitches for lookups around when the bag loops, or around anything on tf_static.

To do better than that you would iterate through all the tf messages in the bag file and load them into a BufferCore object, which can be private and unchanging once your are done loading transforms into it (as opposed to listening to and overwriting stored transforms with whatever is on /tf with a regular buffer and transform listener). Then you can query the BufferCore. See #289323

There is a get_frames method in Buffer that has a tf2_frames service- but it only returns what the frames are named and their parent child relationship in yaml, not their spatial relationship (and there would need to be a corresponding set_frames method to turn yaml back into a query-able Buffer). It looks like it was mainly meant to support the view_frames visualization.

It sounds like you want to serialize and the deserialize all the tf data in a tf2_ros Buffer, which doesn't look supported.

One possibly glitchy approach is to record the /tf and /tf_static topics into a bag for 10-20 seconds, then play it back in a loop, then do tf lookups. There may be glitches for lookups around when the bag loops, or around anything on tf_static.

To do better than that you would iterate through all the tf messages in the bag file and load them into a BufferCore object, which can be private and unchanging once your are done loading transforms into it (as opposed to listening to and overwriting stored transforms with whatever is on /tf with a regular buffer and transform listener). Then you can query the BufferCore. See #289323#q289323

There is a get_frames method in Buffer that has a tf2_frames service- but it only returns what the frames are named and their parent child relationship in yaml, not their spatial relationship (and there would need to be a corresponding set_frames method to turn yaml back into a query-able Buffer). It looks like it was mainly meant to support the view_frames visualization.

It sounds like you want to serialize and the deserialize all the tf data in a tf2_ros Buffer, which doesn't look supported.

One possibly glitchy approach is to record the /tf and /tf_static topics into a bag for 10-20 seconds, then play it back in a loop, then do tf lookups. There may be glitches for lookups around when the bag loops, or around anything on tf_static.

To do better than that you would iterate through all the tf messages in the bag file (http://wiki.ros.org/rosbag/Code%20API#Python_API) and load them into a BufferCore object, which can be private and unchanging once your are done loading transforms into it (as opposed to listening to and overwriting stored transforms with whatever is on /tf with a regular buffer and transform listener). listener, and forgetting transforms as they get too old). Then you can query the BufferCore. See #q289323

There is a get_frames method in Buffer that has a tf2_frames service- but it only returns what the frames are named and their parent child relationship in yaml, not their spatial relationship (and there would need to be a corresponding set_frames method to turn yaml back into a query-able Buffer). It looks like it was mainly meant to support the view_frames visualization.

It sounds like you want to serialize and the deserialize all the tf data in a tf2_ros Buffer, which doesn't look supported.

One possibly glitchy approach is to record the /tf and /tf_static topics into a bag for 10-20 seconds, then play it back in a loop, then do tf lookups. There may be glitches for lookups around when the bag loops, or around anything on tf_static.

To do better than that you would iterate through all the tf messages in the bag file (http://wiki.ros.org/rosbag/Code%20API#Python_API) and load them into a BufferCore object, which can be private and unchanging once your are done loading transforms into it (as opposed to listening to and overwriting stored transforms with whatever is on /tf with a regular buffer and transform listener, and forgetting transforms as they get too old). old with a regular paired buffer and transform listener). Then you can query the BufferCore. See #q289323

There is a get_frames method in Buffer that has a tf2_frames service- but it only returns what the frames are named and their parent child relationship in yaml, not their spatial relationship (and there would need to be a corresponding set_frames method to turn yaml back into a query-able Buffer). It looks like it was mainly meant to support the view_frames visualization.

It sounds like you want to serialize and the deserialize all the tf data in a tf2_ros Buffer, which doesn't look supported.

One possibly glitchy approach is to record the /tf and /tf_static topics into a bag for 10-20 seconds, then play it back in a loop, then do tf lookups. There may be glitches for lookups around when the bag loops, or around anything on tf_static.

To do better than that you would iterate through all the tf messages in the bag file (http://wiki.ros.org/rosbag/Code%20API#Python_API) and load them into a BufferCore object, which can be private and unchanging once your are done loading setting transforms into it (as opposed to listening to and overwriting stored transforms with whatever is on /tf and forgetting transforms as they get too old with a regular paired buffer and transform listener). Then you can query the BufferCore. See #q289323

There is a get_frames method in Buffer that has a tf2_frames service- but it only returns what the frames are named and their parent child relationship in yaml, not their spatial relationship (and there would need to be a corresponding set_frames method to turn yaml back into a query-able Buffer). It looks like it was mainly meant to support the view_frames visualization.

It sounds like you want to serialize and the deserialize all the tf data in a tf2_ros Buffer, which doesn't look supported.

One possibly glitchy approach is to record the /tf and /tf_static topics into a bag for 10-20 seconds, then play it back in a loop, then do tf lookups. There may be glitches for lookups around when the bag loops, or around anything on tf_static.

To do better than that you would iterate through all the tf messages in the bag file (http://wiki.ros.org/rosbag/Code%20API#Python_API) and load them into a BufferCore object, which can be private and unchanging once your are done setting transforms into it (as opposed to listening to /tf and overwriting stored transforms with whatever is on /tf new ones, and forgetting transforms as they get too old with a regular paired buffer and transform listener). Then you can query the BufferCore. See #q289323

There is a get_frames method in Buffer that has a tf2_frames service- but it only returns what the frames are named and their parent child relationship in yaml, not their spatial relationship (and there would need to be a corresponding set_frames method to turn yaml back into a query-able Buffer). It looks like it was mainly meant to support the view_frames visualization.