Skip to content

ToF‐using‐SDK

naitiknakrani-eic edited this page Sep 20, 2023 · 5 revisions

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