Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.
This repository was archived by the owner on May 31, 2025. It is now read-only.

Incorrect number of messages obtained using read_messages() #2343

Closed
@Mentaixg

Description

@Mentaixg

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//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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions