Skip to content

Commit

Permalink
Make small changes to force tag changes
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermedemouraa committed Jul 25, 2024
1 parent 776e6b7 commit 7086fea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 4 additions & 4 deletions py/examples/camera_client/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async def main(service_config_path: Path) -> None:
Args:
service_config_path (Path): The path to the camera service config.
"""
# create a client to the camera service
# Create a client to the camera service
config: EventServiceConfig = proto_from_json_file(service_config_path, EventServiceConfig())

async for event, message in EventClient(config).subscribe(config.subscriptions[0], decode=True):
Expand All @@ -43,17 +43,17 @@ async def main(service_config_path: Path) -> None:
or event.timestamps[0].stamp
)

# print the timestamp and metadata
# Print the timestamp and metadata
print(f"Timestamp: {stamp}\n")
print(f"Meta: {message.meta}")
print("###################\n")

# cast image data bytes to numpy and decode
# Cast image data bytes to numpy and decode
image = cv2.imdecode(np.frombuffer(message.image_data, dtype="uint8"), cv2.IMREAD_UNCHANGED)
if event.uri.path == "/disparity":
image = cv2.applyColorMap(image * 3, cv2.COLORMAP_JET)

# visualize the image
# Visualize the image
cv2.namedWindow("image", cv2.WINDOW_NORMAL)
cv2.imshow("image", image)
cv2.waitKey(1)
Expand Down
8 changes: 2 additions & 6 deletions py/examples/file_reader_can/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,14 @@ 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["/canbus/raw_messages"]
can_events = events_dict["/data_collectiondata_collection/annotation"]
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()

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)
print(sample)

assert reader.close()

Expand Down

0 comments on commit 7086fea

Please sign in to comment.