Skip to content

Commit 3cffd3b

Browse files
author
Andrej Susnik
committed
Wait for pipeline to finish in read calibration example
1 parent 7942c5a commit 3cffd3b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

examples/Script/script_read_calibration.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import cv2
1+
#!/usr/bin/env python3
22
import depthai as dai
33

44
# Start defining a pipeline
@@ -8,6 +8,7 @@
88
script = pipeline.create(dai.node.Script)
99
script.setProcessor(dai.ProcessorType.LEON_CSS)
1010
script.setScript("""
11+
import time
1112
1213
cal = Device.readCalibration2()
1314
left_camera_id = cal.getStereoLeftCameraId()
@@ -19,9 +20,14 @@
1920
print(extrinsics)
2021
print(intrinsics_left)
2122
23+
time.sleep(1)
24+
node.io['end'].send(Buffer(32))
2225
""")
2326

27+
xout = pipeline.create(dai.node.XLinkOut)
28+
xout.setStreamName('end')
29+
script.outputs['end'].link(xout.input)
30+
2431
# Connect to device with pipeline
2532
with dai.Device(pipeline) as device:
26-
while True:
27-
pass
33+
device.getOutputQueue('end').get()

0 commit comments

Comments
 (0)