import depthai as dai
import numpy as np
pipeline = dai.Pipeline()
cam_tof = pipeline.create(dai.node.Camera)
tof = pipeline.create(dai.node.ToF)
pointcloud = pipeline.create(dai.node.PointCloud)
xOut_pcl = pipeline.create(dai.node.XLinkOut)
xOut_depth = pipeline.create(dai.node.XLinkOut)
cam_tof.raw.link(tof.input)
tof.depth.link(pointcloud.inputDepth)
tof.depth.link(xOut_depth.input)
pointcloud.outputPointCloud.link(xOut_pcl.input)
xOut_depth.setStreamName("depth")
xOut_pcl.setStreamName("pcl")
with dai.Device(pipeline) as device:
qDepth = device.getOutputQueue(name="depth", maxSize=4, blocking=False)
qPci = device.getOutputQueue(name="pcl", maxSize=4, blocking=False)
inDepth = qDepth.get()
inPointCloud = qPci.get()
depth = inDepth.getFrame()
points = inPointCloud.getPoints().astype(np.float64)
print(depth)
print(points)