# RGBD Autocreate

This example demonstrates how to use the [RGBD](https://docs.luxonis.com/software-v3/depthai/depthai-components/nodes/rgbd.md)
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

This example requires the DepthAI v3 API, see [installation instructions](https://docs.luxonis.com/software-v3/depthai.md).

## Source code

#### Python

```python
import depthai as dai
from argparse import ArgumentParser

# NOTE: Using autocreate takes over the cameras cannot be used in complex pipelines,
# where cameras would be used in other nodes as well yet.

parser = ArgumentParser()
parser.add_argument("--webSocketPort", type=int, default=8765)
parser.add_argument("--httpPort", type=int, default=8082)
args = parser.parse_args()

with dai.Pipeline() as p:
    remoteConnector = dai.RemoteConnection(
        webSocketPort=args.webSocketPort, httpPort=args.httpPort
    )
    rgbd = p.create(dai.node.RGBD).build(True, dai.node.StereoDepth.PresetMode.DEFAULT)
    remoteConnector.addTopic("pcl", rgbd.pcl, "common")

    p.start()
    remoteConnector.registerPipeline(p)

    while p.isRunning():
        key = remoteConnector.waitKey(1)
        if key == ord("q"):
            print("Got q key from the remote connection!")
            break
```

### Need assistance?

Head over to [Discussion Forum](https://discuss.luxonis.com/) for technical support or any other questions you might have.
