Rosanswers logo

Hi All,

I've been struggling with this issue ever since upgrading our kinetic/indigo systems. Brief outline of our software/hardware; 7 laptops (3 on indigo and 4 on kinetic), 3 turtlebot2 platforms and 1 workstation (on indigo). Prior to Dec 2017 everything was working okay and ROS-indigo was used system-wide. However, since Jan 2018 we have been doing a lot of software updates and changes (updated 4 laptops to kinetic). The experiment; we have 3 robots and the workstation PC connected via multimaster-fkie (all on the same network and interacting). We send a bunch of messages from the workstation and the robots perform a bunch of tasks. This all works fine, so I doubt it is a multimaster-fkie problem. We run the following command on the workstation PC

rosbag record -j -o Tasks.yaml_ /experiment /tasks/announce /tasks/award /tasks/status /tasks/new /debug /robot_1/amcl_pose /robot_2/amcl_pose /robot_3/amcl_pose

The /tasks/status topic is the most crucial as it records (time stamp) when the robots perform any action, furthermore all the devices subscribe to this topic. During an experiment if I use rostopic echo /tasks/status (from the workstation) I see all the messages that I should be getting from all the robots. However, later when I play back the rosbag file messages sent to /tasks/status one or more of an entire robot's messages are missing from this topic. When I check the rosbag for other topics there exists messages from all robots (e.g. amcl messages from robot 1,2 etc.). I made a simple script that counts the amount of messages from different topics, from a rosbag file and prints in terminal. Below is the result from one bag file recording -

tasks/status/robot1: 0

tasks/status/robot2: 5

experiment: 8

robot1_amcl: 27

robot2_amcl: 43

I hope the names are easy enough to understand which topic is being referring to, but as can be seen tasks/status contains 0 messages for robot1. Could anyone please let me know their thoughts? Any further information I can supply to help with explaining the problem do let me know!

Please note: The problem with rosbag recording occurs regardless whether only using indigo machines, kinetic machines or a mix of both.

Thank you,


Originally posted by Tiz on ROS Answers with karma: 13 on 2018-04-10

Post score: 0

Original comments

Comment by jayess on 2018-04-10:
Welcome! Is this any different from your other question #q288187?

Comment by Tiz on 2018-04-11:
Hi, there was an issue when I created my account and I thought the original question didn't post. But I deleted it now (hopefully). Thanks for notifying me!


1 Answer 1


Rosanswers logo

Hi All,

I believe I figured out the issue I had with the binary (and API) rosbag record. I realised from here ROS-rosbag-API that the binary and API are not thread-safe. But I had the topic tasks/status which was concurrently being updated by the robot team and workstation. I wrote a python script using the python API, which "proved" to be thread-safe. I have already done tests using my script for recording and it works. Below is a code snippet example:

   # callback function that handles writing to the bag file
   # makes use of 'mutex = Lock()' to acquire and release when the file is being written to
   def tasks_cb(task_msg):
    # subscribe to the topic and call tasks_cb
    tasks_stat = rospy.Subscriber('/tasks/status',

Originally posted by Tiz with karma: 13 on 2018-04-23

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by gvdhoorn on 2018-04-24:
Just trying to understand this: are you using rosbag (ie: the command line tool), or a custom script that makes use of the rosbag infrastructure (ie: the Python/C++ libraries)?

Concurrent publishing to the same topic should not matter for rosbag (the tool).

Comment by Tiz on 2018-04-24:
The rosbag binary as I mention above is the command line tool. You're right that concurrent publishing to the same topic SHOULDN'T matter for rosbag. But it does and it did for my experiments. If you wish to replicate it I suggest using +3 machines connected via FKIE publishing to the same topic.

Comment by gvdhoorn on 2018-04-24:
Seeing as you report this same setup as working under Indigo this might be a regression. It would be good to report it over at ros/ros_comm/issues.

Comment by Tiz on 2018-04-24:
Thanks for the advice. I was considering this, but I wasn't sure it is a significant issue. I might report it later when I have time to sit down and explain the problem in a more concise way.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.