I have a problem with using read_messages() to get topic messages in rosbag.
The number of messages in my bag is 101
When I use for topic, msg, t in patch_bag_.read_messages(topics=[topic]) to obtain, the number of msg obtained is 101
But when I use for topic, msg, t in bag.read_messages(topics=[topic], start_time=rospy.Time(start_time), end_time=rospy.Time(end_time))to specify start_time and end_time, the number of msgs obtained only 99
(Because of the problem of [https://github.com/ros/ros_comm/issues/952], I used
self.bag_start_time = bag_.get_start_time() self.bag_end_time = bag_.get_end_time() for _, _, t in bag.read_messages(raw=True): self.bag_start_time = min(t.to_sec(), self.bag_start_time) self.bag_end_time = max(t.to_sec(), self.bag_end_time)
to get the time)
I have a problem with using read_messages() to get topic messages in rosbag. The number of messages in my bag is 101
When I use
for topic, msg, t in patch_bag_.read_messages(topics=[topic])
to obtain, the number of msg obtained is 101But when I use
for topic, msg, t in bag.read_messages(topics=[topic], start_time=rospy.Time(start_time), end_time=rospy.Time(end_time))
to specify start_time and end_time, the number of msgs obtained only 99(Because of the problem of [https://github.com/ros/ros_comm/issues/952], I used
self.bag_start_time = bag_.get_start_time() self.bag_end_time = bag_.get_end_time() for _, _, t in bag.read_messages(raw=True): self.bag_start_time = min(t.to_sec(), self.bag_start_time) self.bag_end_time = max(t.to_sec(), self.bag_end_time)
to get the time)