I've been working on a functionality for the rosbag recorder (forked) that allows you to split the bags according to the wall clock (e.g. split every five minutes, at 13:00:00, at 13:05:00, 13:10:00, etc).
On rare occasions, it happened that the rosbag filename was inconsistent with the selected modulo. Instead of having the name 2022-07-29-13-05-00 it had the name 2022-07-29-13-04-59.
After some digging through the recorder.cpp file, I realized that even if we see the following snippet inside the updateFilenames function
...
if (options_.append_date)
parts.push_back(timeToStr(ros::WallTime::now()));
...
the ros::WallTime::now() does not get used inside the timeToStr function:
I see this is as the only possible reason for this kind of behavior.
This is not a bug report because it does not affect any of the functionalities of the rosbag recorder as it currently is. This is merely a question to understand the reasoning behind this implementation.
I've been working on a functionality for the rosbag recorder (forked) that allows you to split the bags according to the wall clock (e.g. split every five minutes, at 13:00:00, at 13:05:00, 13:10:00, etc).
On rare occasions, it happened that the rosbag filename was inconsistent with the selected modulo. Instead of having the name
2022-07-29-13-05-00
it had the name2022-07-29-13-04-59
.After some digging through the
recorder.cpp
file, I realized that even if we see the following snippet inside theupdateFilenames
functionthe
ros::WallTime::now()
does not get used inside thetimeToStr
function:I see this is as the only possible reason for this kind of behavior.
This is not a bug report because it does not affect any of the functionalities of the rosbag recorder as it currently is. This is merely a question to understand the reasoning behind this implementation.