Template: OAK-D Quick Start
From Waveshare Wiki
Hardware Connection
OAK-D
- Connect the power supply to the OAK-D's power connector.
- Use a Type-C cable to connect OAK-D to the USB3.0 port of a computer or other hosts.
OAK-D-PoE
- To use OAK-D-PoE, you need to use a switch or router that complies with the 802.3af POE power supply standard.
- Remove the plastic waterproof casing and connect the matching network cable to the switch. OAK-D-PoE needs to be connected to the Internet for normal use.
- Note that OAK-D-PoE needs to be connected to the same LAN as the host computer, otherwise the program cannot identify the device.
OAK-D-Lite
- Use a Type-C cable to connect OAK-D to the USB3.0 port of a computer or other hosts.
OAK-D-Pro
- Connect the Y-Adapter to the OAK-D-Pro.
- Use two Type-C cables to connect the Y-type connector, on the other side, connect a UB cable to the USB3,0 interface of other hosts, and connect the other one to the 5V/2A power supply.
OAK-D-S2
- Use Type-C to connect OAK-D-S2 to the USB3.0 interface of the computer or other host.
User Guides
Windows
- Click to download Oak D Windows software.
- Unzip the downloaded zip.
- Double-click the "exe" file.
- Follow the prompts to install the OAKEnvironment software.
- It is recommended to change the installation directory to another location.
- Check to add environment variables.
- Click "Install" and wait for the installation to complete.
- After the installation is complete, a shortcut will be added to the desktop. Double-click to run the "depthai-demo.py" program directly.
Linux
If you use the Ubuntu system, you can operate it according to the following steps:
- Install depthai:
git clone https://gitee.com/oakchina/depthai.git
- Install depthai-python:
git clone https://gitee.com/oakchina/depthai-python.git
- Install depthai-experiments:
git clone https://gitee.com/oakchina/depthai-experiments.git
- If you are using the OAK device for the first time, you need to configure the rules first.
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="03e7", MODE="0666"' | sudo tee /etc/udev/rules.d/80-movidius.rules sudo udevadm control --reload-rules && sudo udevadm trigger
- Install dependecy:
python3 -m pip install -r depthai/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
- Test the demo:
python3 depthai/depthai_demo.py
Raspberry Pi
- At the beginning, we provided a Raspberry Pi image with an already configured environment, and users can directly download and program it.
- Download Raspberry Pi Official Programming Tool
- Open the software, select the downloaded oak image (note that the .img file is decompressed), and then program it into the SD card.
- Boot the Raspberry Pi and use the following commands to run the demo.
cd depthai python3 depthai_demo.py
Ubuntu
- Install depthai:
git clone https://gitee.com/oakchina/depthai.git
- Install dependency:
cd depthai python3 install_requirements.py
- Run the demo:
python3 depthai-demo.py
Note: If opencv reports an error and displays an illegal command after installation, please run the command to add the environment, and then retest.
cho "export OPENBLAS_CORETYPE=ARMV8" >> ~/.bashrc source ~/.bashrc
Jetson
Note: Do not directly run the dependent scripts in the depthhai package on the jetson platform to avoid OpenCV coverage and cause other programs to fail to use normally.
Please program the system according to the Jetson platform first, and complete the normal configuration.
(Optional) If there is a problem with the subsequent configuration, you can update the software package. Please do not update it for the first configuration.
sudo apt update && sudo apt upgrade sudo reboot
- s set SWAP:
# disable ZRAM: sudo systemctl disable nvzramconfig # create 4GB swap file sudo fallocate -l 4G /mnt/4GB.swap sudo chmod 600 /mnt/4GB.swap sudo mkswap /mnt/4GB.swap
- Install pip3:
sudo -H apt install -y python3-pip
- Install and config the virtual environment
sudo -H pip3 install virtualenv virtualenvwrapper
- Add the setting to the bash script:
sudo vi ~/.bashrc # add the following content to the opened file export WORKON_HOME=$HOME/.virtualenvs export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 source /usr/local/bin/virtualenvwrapper.sh
- Load the script again and create the virtual environment depthAI
source ~/.bashrc mkvirtualenv depthAI -p python3
- Install depthai, note that the installation needs to be performed in a virtual environment, please enter the virtual environment first.
#download and install the dependencies script sudo wget -qO- http://docs.luxonis.com/_static/install_dependencies.sh | bash #clone depthai respository git clone https://github.com/luxonis/depthai-python.git cd depthai-python
- Add the environment config
echo "export OPENBLAS_CORETYPE=ARMV8" >> ~/.bashrc
- Enter the example file and then run the script to install the dependency.
cd examples/ sudo python install_requirements.py
- Run the test script.
sudo python rgb_preview.py