ON THIS PAGE

  • RGBD Autocreate
  • Demo
  • Setup
  • Source code

RGBD Autocreate

This example demonstrates how to use the RGBD node with automatic creation of the required color and depth nodes. It greatly simplifies the setup by handling internal node linking and configuration, allowing for a quick and minimal RGB-D pipeline.

Demo

Setup

This example requires the DepthAI v3 API, see installation instructions.

Source code

Python

Python

Python
GitHub
1import depthai as dai
2from argparse import ArgumentParser
3
4# NOTE: Using autocreate takes over the cameras cannot be used in complex pipelines,
5# where cameras would be used in other nodes as well yet.
6
7parser = ArgumentParser()
8parser.add_argument("--webSocketPort", type=int, default=8765)
9parser.add_argument("--httpPort", type=int, default=8080)
10args = parser.parse_args()
11
12with dai.Pipeline() as p:
13    remoteConnector = dai.RemoteConnection(
14        webSocketPort=args.webSocketPort, httpPort=args.httpPort
15    )
16    rgbd = p.create(dai.node.RGBD).build(True, dai.node.StereoDepth.PresetMode.DEFAULT)
17    remoteConnector.addTopic("pcl", rgbd.pcl, "common")
18
19    p.start()
20    remoteConnector.registerPipeline(p)
21
22    while p.isRunning():
23        key = remoteConnector.waitKey(1)
24        if key == ord("q"):
25            print("Got q key from the remote connection!")
26            break

Need assistance?

Head over to Discussion Forum for technical support or any other questions you might have.