Skip to content

ToF‐using‐SDK

naitiknakrani-eic edited this page Sep 20, 2023 · 5 revisions
  1. Enable Wi-Fi inside i.MX8 board and connect it with local router.

    • We can generate Wifi Connection by two methods but first make these common changes mentioned below:

    $ cd Workspace/Tools/
    $ vi adi-enable-wifi.sh 
    

    • Open adi-enable-wifi.sh file inside it make following changes:

    1. comment "sudo reboot"
    2. above "sudo reboot" line add “sudo systemctl restart wpa_supplicant@wlan0”.

    • After changes it will look like below:

    image

    • To Apply these changes permanently, make the changes in extlinux.conf. Write "rw" instead of "ro = init/...." in whole file where you see "ro =init/..." as seen in below image.

    image

    • Execute following command:

    $ ./adi-enable-wifi.sh <SSID> <password> 
    

    For example, ( i.e. ./adi-enable-wifi.sh TP-Link abcd#*999)

    • Your connection breaks after running the above command so reconnect ToF camera.

    image

    • Run "ip addr" command after connecting and see in wlan0 connection established.

    image

    Note: In case of troubleshooting, try “sh adi-enable-wifi.sh

  2. If there is not Wi-FI available that one can enable network over ethernet. Connect host machine with ethernet cable and your i.MX8 board will access network from host device.

Running a TOF using ToF viewer app from ToF SDK on NVIDIA Jetson/Linux Host machine.

• Check first if ToF is connected and ping is coming by following command:

$ ping 10.42.0.1

Note: If ping is not coming then reconnect the camera and try again.

• Installing the dependencies Cmake, OpenGL, OpenCV:

$ sudo apt install cmake
$ sudo apt install libgl1-mesa-dev libglfw3-dev
$ sudo apt install libopencv-contrib-dev
$ sudo apt install libopencv-dev

• Make one directory using below command and perform all steps in that folder:

$ mkdir tof_sdk_4.2.0 && cd tof_sdk_4.2.0 

• Install Glog:

$ git clone --branch v0.6.0 --depth 1 https://github.com/google/glog
$ cd glog
$ mkdir build_0_6_0 && cd build_0_6_0
$ cmake -DWITH_GFLAGS=off -DCMAKE_INSTALL_PREFIX=/opt/glog ..
$ sudo cmake --build . --target install

• Install Libwebsockets:

    $ cd tof_sdk_4.2.0 
    $ git clone --branch v3.1-stable --depth 1 https://github.com/warmcat/libwebsockets
    $ cd libwebsockets
    $ mkdir build_3_1 && cd build_3_1
    $ cmake -DLWS_WITH_SSL=OFF -DLWS_STATIC_PIC=ON -DCMAKE_INSTALL_PREFIX=/opt/websockets .. 
    $ sudo cmake --build . --target install

• Install Protobuf:

$ cd tof_sdk_4.2.0
$ git clone --branch v3.9.0 --depth 1 https://github.com/protocolbuffers/protobuf
$ cd protobuf
$ mkdir build_3_9_0 && cd build_3_9_0
$ cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=/opt/protobuf ../cmake
$ sudo cmake --build . --target install

• Download and build SDK version 4.2.0 only

$ cd tof_sdk_4.2.0
$ git clone --branch v4.2.0 --depth 1 https://github.com/analogdevicesinc/ToF
$ cd ToF
$ mkdir build && cd build
$ cmake -DWITH_EXAMPLES=on -DWITH_NETWORK=on -DCMAKE_PREFIX_PATH="/opt/glog;/opt/protobuf;/opt/websockets" -DUSE_DEPTH_COMPUTE_OPENSOURCE=on ..
$ sudo make install

• Now go to below mentioned path: $ cd tof_sdk_4.2.0/ToF/build/examples/tof-viewer

• Now here you get one file named ADIToFGUI run that file using below command $ ./ADIToFGUI

• You will see the following view on GUI viewer.

image

Clone this wiki locally