Skip to content

Commit

Permalink
Revert wrong file change
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermedemouraa committed Jul 25, 2024
1 parent 7086fea commit 18e0f75
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions py/examples/file_reader_can/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,18 @@ def main(file_name: str) -> None:
events_dict: dict[str, list[EventLogPosition]] = build_events_dict(events_index)
print(f"All available topics: {sorted(events_dict.keys())}")

can_events = events_dict["/data_collectiondata_collection/annotation"]
can_events = events_dict["/canbus/raw_messages"]
print(f"Found {len(can_events)} packets of canbus_pb2.RawCanbusMessages")

for event_log in can_events:
# parse the message
sample: canbus_pb2.RawCanbusMessages = event_log.read_message()

print(sample)
msg: canbus_pb2.RawCanbusMessage
for msg in sample.messages:
if msg.id == AmigaTpdo1.cob_id + DASHBOARD_NODE_ID:
tpdo1: AmigaTpdo1 = AmigaTpdo1.from_raw_canbus_message(msg)
print(tpdo1)

assert reader.close()

Expand Down

0 comments on commit 18e0f75

Please sign in to comment.