Skip to content

Instantly share code, notes, and snippets.

@merlin-quix
Last active February 28, 2023 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save merlin-quix/9084b02852e58dda8f74f4c827ec34bb to your computer and use it in GitHub Desktop.
Save merlin-quix/9084b02852e58dda8f74f4c827ec34bb to your computer and use it in GitHub Desktop.
OSS announcement
# 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