-
Notifications
You must be signed in to change notification settings - Fork 11
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
Update "fetching_messages" example #115
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import datetime | ||
from datetime import datetime, timedelta | ||
|
||
from foxglove.client import Client | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import datetime | ||
from datetime import datetime, timedelta | ||
|
||
from foxglove.client import Client | ||
|
@@ -9,10 +8,9 @@ | |
|
||
# Make sure you've imported either the mcap-ros1-support or mcap-protobuf-support | ||
# libraries before making this call in order to get decoded messages. | ||
messages = client.get_messages( | ||
for schema, channel, message, decoded_message in client.iter_messages( | ||
device_id=device_id, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we do anything with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I started to, but doing anything useful seemed dependent on the data and implementation (per comment above). I could prefix with an underscore to indicate it's unused? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. I think it's fine to leave it as is to show it's there |
||
start=datetime.now() - timedelta(hours=3), | ||
end=datetime.now() - timedelta(hours=1), | ||
) | ||
|
||
print(f"downloaded {len(messages)} messages") | ||
): | ||
print(f"{message.log_time} | {channel.topic:<24} | {schema.name}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Staying on 22 for now to avoid build errors: https://github.com/foxglove/foxglove-python/actions/runs/12356809802/job/34535840957. Runners have been rolling out 24.04 as "latest" this month.