Template: OAK-D Quick Start

From Waveshare Wiki
Jump to: navigation, search

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.


Windows

  • 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.

Oak-windows-inputPath.png Oak-windows-install.png Oak-windows-meunDir.png Oak-windows-selectDir.png Oak-windows-success.png Oak-windows-depthaiDemoShow.png

Linux

If you use ubuntu system, you can take 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
  • OAK device used for the first time requires the rule configuration.
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 dependency library
python3 -m pip install -r depthai/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
  • Program test
python3 depthai/depthai_demo.py

OAK-D Quick Start001.png


Raspberry Pi

  • At the beginning, we provided a Raspberry Pi image with a configured environment, and users can directly download and burn it.
  • Download the tools

OAK-D Quick Start01.png

  • Open the software and choose the downloaded oak image (note: unzip .img file) and the programmed it to the SD card.

OAK-D Quick Start02.png

  • Enable the Raspberry Pi and run the following demo:
cd depthai
python3 depthai_demo.py

Ubuntu

  • Install depthai
git clone https://gitee.com/oakchina/depthai.git
  • Install dependent libraries
cd depthai
python3 install_requirements.py
  • Run the program
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 test again.

echo "export OPENBLAS_CORETYPE=ARMV8" >> ~/.bashrc
source ~/.bashrc

Jetson Platform

Note: Do not directly run the dependency scripts in the depthai package on the jetson platform, or OpenCV coverage that will cause other programs to fail to work properly.

  • Please program the system first according to the Jetson platform, and configure it completely and normally.
  • (Optional) If there is a problem with the subsequent configuration, you can update the package. Please do not do the second update 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 configure the virtual environment.
sudo -H pip3 install virtualenv virtualenvwrapper
  • Add the setting to bash script.
sudo vi ~/.bashrc

# Add the following to the open document
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source /usr/local/bin/virtualenvwrapper.sh
  • Reload the script and wear the virtual environment depthAI:
source ~/.bashrc
mkvirtualenv depthAI -p python3
  • Install depthai, note that the installation needs to be done 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 environment configuration:
echo "export OPENBLAS_CORETYPE=ARMV8" >> ~/.bashrc
  • Go to the example folder and run the script to install the dependency library:
cd examples/
sudo python install_requirements.py
  • Run the test script.
sudo python rgb_preview.py