Last active
February 28, 2023 17:02
-
-
Save merlin-quix/9084b02852e58dda8f74f4c827ec34bb to your computer and use it in GitHub Desktop.
OSS announcement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Open the producer topic where to publish data. | |
topic_producer = client.get_topic_producer("data") | |
# Create a new stream for each device. | |
stream = topic_producer.create_stream("bus-123AAAV") | |
telemetry = BusVehicle.get_vehicle_telemetry("bus-123AAAV") | |
def on_new_camera_frame(frame_bytes): | |
stream.timeseries \ | |
.buffer \ | |
.add_timestamp(datetime.datetime.utcnow()) \ | |
.add_value("camera_frame", frame_bytes) \ | |
.add_value("speed", telemetry.get_speed()) \ | |
.publish() | |
telemetry.on_new_camera_frame = on_new_camera_frame |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment