Hello everyone,
I've been running around code APIs, forums and other wells of knowledge but I can't find the solution to my problem.
Here's what I want to do:
- open a .mat file (Done)
- read the structure and fetch the data (Done)
- create a rosbag with a topic for each message in the mat file (Fail)
I can write to the bag file with
for t in range(MESSAGE_SIZE):
ros_msg.data = MESSAGE[t]
t_msg.secs = t_vec.sec
t_msg.nsecs = t_vec.nsec
bag.write("/topic", ros_msg, t_msg)
Where t_vec is an array, filled with timestamps of said messages. It's under the same format as the ROS time.
Execution of the code is done smoothly.
However, when I try to replay the bag to check what has been written down in it, I got these issues:
- rosbag info tells me that bag duration is 0.0s
- rosbag info tells me that the start and end date are the same (final value of the time vector used in the bag creation)
- when I play the bag, the duration displayed in the terminal is 17s, whereas the time vector is 89 seconds long.
- all messages of all topics are published only when the bag reaches its end.
- the /clock topic is well published and its time is correct.
I honestly don't know where to look now...
Any help would be greatly appreciated.
Thanks in advance!
↧
[Python][Rosbag] Written rosbag has same start and end dates - All topics are published at the end
↧