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

Playback of rosbag with tf2-static transforms

asked 2017-02-21 11:12:29 -0600

Tobias Neumann gravatar image

updated 2017-02-21 11:14:47 -0600

Hello ROS users,

I've got a robot setup where (most) of the static transforms are defined by an URDF (which results in tf2-static tfs). During a testrun we recoded plenty of bag-files which where splitted after 1 min.

The static transforms are only contained in the 1. bagfile.

(1. Question) Is there a way to record splitted bagfiles with static-tfs, that the static-tfs are contained in each bag-file?

Furthermore (2. question), if the bagfile containing the static-tfs is played, they are only received by rviz (and probably other nodes as well) if rviz was started prior the playback of the bag-file, which seems for me like a bug. Is there a solution to fix that (e.g. have rviz receiving the static-tfs even when its started lets say 2sec after the rosbag playback started)?

regards
Tobias

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2017-02-21 13:24:06 -0600

tfoote gravatar image

updated 2017-02-22 11:09:00 -0600

For splitting bags, you'll likely want to use the rosbag API to push the static transform message into the separate bags.

A few other resources: http://answers.ros.org/question/20755... which links to https://github.com/ros/ros_comm/issue... and some proposed solutions here: https://github.com/ros/ros_comm/issue...

With respect to the startup order there are a few issues relating to latched values: https://github.com/ros/ros_comm/issue... https://github.com/ros/ros_comm/issue... and https://github.com/ros/ros_comm/issue... I'm not sure if any apply to your case without more details.

edit flag offensive delete link more

Comments

And unfortunately rosbag doesn't support

does not support what? :)

gvdhoorn gravatar image gvdhoorn  ( 2017-02-22 01:05:45 -0600 )edit

Thanks for the answer, it seems like a common problem ;)

For the 2. case, the relevant output from rosbag info:

/tf_static          2 msgs    : tf2_msgs/TFMessage              (2 connections)
Tobias Neumann gravatar image Tobias Neumann  ( 2017-02-22 10:49:29 -0600 )edit

So if I understand your linked topics correctly, https://github.com/ros/ros_comm/issue... does apply and only the 2. msg is received by RVIZ (or other nodes) (the 1. is probably the URDF and the 2. is one tf2 static-tf-publisher)

Tobias Neumann gravatar image Tobias Neumann  ( 2017-02-22 10:51:27 -0600 )edit

@gvdhoorn sorry fragment from earlier draft.

tfoote gravatar image tfoote  ( 2017-02-22 11:09:28 -0600 )edit

@ToXeR if you have two static transform publishers that can be a problem with rosbag as it will only latch one on playback.

tfoote gravatar image tfoote  ( 2017-02-22 11:10:40 -0600 )edit
1

answered 2022-01-17 07:44:30 -0600

ticotico gravatar image

Good news for your first question:

In Noetic, this PR has been merged and thus you can do the following:

rosbag record -a --repeat-latched --duration 5 --split

Note, some issues with the --repeat-latched option will hopefully be resolved by this PR.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-02-21 11:12:29 -0600

Seen: 1,651 times

Last updated: Jan 17 '22