Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected EndOfFile Error When Running iter_messages #113

Open
kwesiRutledge-aescape opened this issue Oct 23, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@kwesiRutledge-aescape
Copy link

Description

  • Version: 0.15.2
  • Platform: Linux (VS Code Devcontainer inside of Linux)

We've previously used the client to analyze some TriangleMesh data from our robot via this API. The script we were using was working a month or so ago, but I returned yesterday to see that the part of the code that extracts TriangleMesh messages is now breaking for a reason that I can't seem to understand.

Steps To Reproduce
Here is the problematic code block:

# Setup
msgs_found = []

for _, _, _, decoded_message in client.iter_messages(
    device_id=coverage["device_id"],
    start=coverage["start"],
    end=coverage["end"],
    topics=["/topic/containing/triangle/meshes"],
):
    msgs_found += [decoded_message]

whenever the iter_messages() method is run, we now receive this error:

for _, _, _, decoded_message in client.iter_messages(
  File "/home/ros/.local/lib/python3.10/site-packages/mcap/reader.py", line 191, in iter_decoded_messages
    for schema, channel, message in message_iterator:
  File "/home/ros/.local/lib/python3.10/site-packages/mcap/reader.py", line 494, in iter_messages
    for t in sorted(
  File "/home/ros/.local/lib/python3.10/site-packages/mcap/reader.py", line 508, in _iter_messages_internal
    for record in self._stream_reader.records:
  File "/home/ros/.local/lib/python3.10/site-packages/mcap/stream_reader.py", line 156, in records
    opcode = self._stream.read1()
  File "/home/ros/.local/lib/python3.10/site-packages/mcap/data_stream.py", line 41, in read1
    [value] = struct.unpack("<B", self.read(1))
  File "/home/ros/.local/lib/python3.10/site-packages/mcap/data_stream.py", line 31, in read
    raise EndOfFile()
mcap.exceptions.EndOfFile

I'm not sure why this is now occurring. Doing some digging, I can see that at some point the following header is read

ipdb> record
Header(profile='', library='mcap go v1.4.1; fg-data-platform-daf59710')

I'm not familiar with the message that has that Header, but the empty profile might be what's causing this strange EndOfFile exception?

Expected Behavior

I had previously designed a script so that we could extract some Triangle Mesh data data from our Foxglove sessions, but it looks like that script has recently broken and I can't seem to figure out why.

@kwesiRutledge-aescape kwesiRutledge-aescape added the bug Something isn't working label Oct 23, 2024
@defunctzombie
Copy link

@kwesiRutledge-aescape kwesiRutledge-aescape changed the title Unexpected Error When Running iter_messages Unexpected EndOfFile Error When Running iter_messages Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants