How to build a showPointCloud example of aditof_sdk?

Hello,

 I want to run the showPointCloud example. It has follow error, when built.

./scripts/linux/setup.sh -bo
# .... omit ....
-- Up-to-date: /work/dragon/aditof_sdk/deps/installed/opencv-3.4.1/bin/opencv_createsamples
-- Up-to-date: /work/dragon/aditof_sdk/deps/installed/opencv-3.4.1/bin/opencv_annotation
-- Up-to-date: /work/dragon/aditof_sdk/deps/installed/opencv-3.4.1/bin/opencv_visualisation
-- Up-to-date: /work/dragon/aditof_sdk/deps/installed/opencv-3.4.1/bin/opencv_interactive-calibration
-- Up-to-date: /work/dragon/aditof_sdk/deps/installed/opencv-3.4.1/bin/opencv_version
/work/dragon/aditof_sdk
/work/dragon/aditof_sdk/build /work/dragon/aditof_sdk
-- The dnn example will be built (OpenCV version >= 3.4.1)
-- Could NOT find Open3D (missing: Open3D_DIR)
CMake Error at bindings/open3D/CMakeLists.txt:47 (message):
  Open3D not found


-- Open3D 
-- Configuring incomplete, errors occurred!
See also "/work/dragon/aditof_sdk/build/CMakeFiles/CMakeOutput.log".
See also "/work/dragon/aditof_sdk/build/CMakeFiles/CMakeError.log".
-- The dnn example will be built (OpenCV version >= 3.4.1)
-- Could NOT find Open3D (missing: Open3D_DIR)
CMake Error at bindings/open3D/CMakeLists.txt:47 (message):
  Open3D not found


-- Open3D 
-- Configuring incomplete, errors occurred!
See also "/work/dragon/aditof_sdk/build/CMakeFiles/CMakeOutput.log".
See also "/work/dragon/aditof_sdk/build/CMakeFiles/CMakeError.log".
Makefile:280: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1

 

I modified the setup.sh file which '-DWITH_OPEN3D=on' option append to CMAKE_OPTIONS parameter.

Please let me know how to build it.

Thanks.

Parents
  • I downloaded the Open3D source from github, built and installed to a deps/installed/Open3D path on ubuntu 18.04.

    showPointCloud/main.cpp is builted successfully. But it shows a message as 'No camera found'. Question #1) How to connect  the dragon board with ToF as USB device?

    I changed the main.cpp file from 'system.getCameraList(cameras);' to 'system.getCameraListAtIp(cameras, ip);'.

    But it failed compile.  Question #2) How to solve the compile error ? I can't make sense it.

    $ make
    [ 61%] Built target aditof
    [ 72%] Built target aditof-demo
    [ 77%] Built target first-frame
    [ 81%] Built target first-frame-ethernet
    [ 86%] Built target aditofpython
    [ 90%] Built target aditof-opencv-dnn
    [ 95%] Built target aditof-opencv-imshow
    Scanning dependencies of target aditof-open3d-showPointCloud
    [ 97%] Building CXX object bindings/open3D/showPointCloud/CMakeFiles/aditof-open3d-showPointCloud.dir/main.cpp.o
    [100%] Linking CXX executable aditof-open3d-showPointCloud
    CMakeFiles/aditof-open3d-showPointCloud.dir/main.cpp.o: In function `main':
    main.cpp:(.text+0xb1c): undefined reference to `aditof::System::getCameraListAtIp(std::vector<std::shared_ptr<aditof::Camera>, std::allocator<std::shared_ptr<aditof::Camera> > >&, std::string const&) const'
    collect2: error: ld returned 1 exit status
    bindings/open3D/showPointCloud/CMakeFiles/aditof-open3d-showPointCloud.dir/build.make:97: recipe for target 'bindings/open3D/showPointCloud/aditof-open3d-showPointCloud' failed
    make[2]: *** [bindings/open3D/showPointCloud/aditof-open3d-showPointCloud] Error 1
    CMakeFiles/Makefile2:571: recipe for target 'bindings/open3D/showPointCloud/CMakeFiles/aditof-open3d-showPointCloud.dir/all' failed
    make[1]: *** [bindings/open3D/showPointCloud/CMakeFiles/aditof-open3d-showPointCloud.dir/all] Error 2
    Makefile:129: recipe for target 'all' failed
    make: *** [all] Error 2
    

  • 0
    •  Analog Employees 
    on Mar 26, 2020 11:33 AM 8 months ago in reply to HyunSuk

    Hi,

    For question #1: Please see https://wiki.analog.com/resources/eval/user-guides/ad-96tof1-ebz/ug_linux

    For question #2: With how many parameters are you calling getCameraListAtIp() ?

  • For Question #2)

    I just called as follow:

        std::string ip = "192.168.113.231";
    
        std::vector<std::shared_ptr<Camera>> cameras;
        system.getCameraListAtIp(cameras, ip);
        if (cameras.empty()) {
            LOG(WARNING) << "No cameras found";
            return 0;
        }

    I just copied the part from the first-frame-ethernet example.

  • For Question #1)

    I connected the USB device and detected successfully.

    But it has a Segmentation fault.  dumped core file and checked with the gdb.

    Please help me run the program.

    $ ./aditof-open3d-showPointCloud 
    I0327 09:14:02.399243  2553 device_enumerator_linux.cpp:48] Looking for USB connected devices
    I0327 09:14:02.516445  2553 system_impl.cpp:62] System initialized
    I0327 09:14:02.516502  2553 main.cpp:67] main@67
    I0327 09:14:02.516510  2553 camera_96tof1.cpp:78] Initializing camera
    I0327 09:14:02.516515  2553 usb_device_linux.cpp:115] Opening device
    I0327 09:14:03.304183  2553 calibration.cpp:261] EEPROM calibration data size 64940 bytes
    I0327 09:14:10.190385  2553 camera_96tof1.cpp:95] Camera initialized
    Segmentation fault (core dumped)
    

    $ gdb ./aditof-open3d-showPointCloud ./core 
    GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git
    Copyright (C) 2018 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-linux-gnu".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>.
    Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.
    For help, type "help".
    Type "apropos word" to search for commands related to "word"...
    Reading symbols from ./aditof-open3d-showPointCloud...(no debugging symbols found)...done.
    
    warning: core file may not match specified executable file.
    [New LWP 74824]
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    Core was generated by `./aditof-open3d-showPointCloud'.
    Program terminated with signal SIGSEGV, Segmentation fault.
    #0  __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:225
    225	../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No such file or directory.
    (gdb) 
    (gdb) 
    (gdb) bt
    #0  __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:225
    #1  0x00007f32ffc1b720 in float* std::__copy_move<true, true, std::random_access_iterator_tag>::__copy_m<float>(float const*, float const*, float*) () from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #2  0x00007f32ffc1b662 in float* std::__copy_move_a<true, float*, float*>(float*, float*, float*) ()
       from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #3  0x00007f32ffc1b576 in float* std::__copy_move_a2<true, float*, float*>(float*, float*, float*) ()
       from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #4  0x00007f32ffc1b2c0 in float* std::copy<std::move_iterator<float*>, float*>(std::move_iterator<float*>, std::move_iterator<float*>, float*) () from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #5  0x00007f32ffc1ab49 in float* std::__uninitialized_copy<true>::__uninit_copy<std::move_iterator<float*>, float*>(std::move_iterator<float*>, std::move_iterator<float*>, float*) () from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #6  0x00007f32ffc19ffb in float* std::uninitialized_copy<std::move_iterator<float*>, float*>(std::move_iterator<float*>, std::move_iterator<float*>, float*) () from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #7  0x00007f32ffc18c21 in float* std::__uninitialized_copy_a<std::move_iterator<float*>, float*, float>(std::move_iterator<float*>, std::move_iterator<float*>, float*, std::allocator<float>&) () from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #8  0x00007f32ffc189be in float* std::__uninitialized_move_a<float*, float*, std::allocator<float> >(float*, float*, float*, std::allocator<float>&) () from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #9  0x00007f32ffc16821 in void std::vector<float, std::allocator<float> >::_M_range_insert<std::_List_const_iterator<float> >(__gnu_cxx::__normal_iterator<float*, std::vector<float, std::allocator<float> > >, std::_List_const_iterator<float>, std::_List_const_iterator<float>, std::forward_iterator_tag) () from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #10 0x00007f32ffc14b55 in void std::vector<float, std::allocator<float> >::_M_insert_dispatch<std::_List_const_iterator<float> >(__gnu_cxx::__normal_iterator<float*, std::vector<float, std::allocator<float> > >, std::_List_const_iterator<float>, std::_List_const_iterator<float>, std::__false_type) () from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #11 0x00007f32ffc135aa in __gnu_cxx::__normal_iterator<float*, std::vector<float, std::allocator<float> > > std::vector<float, std::allocator<float> >::insert<std::_List_const_iterator<float>, void>(__gnu_cxx::__normal_iterator<float const*, std::vector<float, std::allocator<float> > >, std::_List_const_iterator<float>, std::_List_const_iterator<float>) () from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #12 0x00007f32ffc11930 in Calibration::getIntrinsic(float, std::vector<float, std::allocator<float> >&) const ()
       from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #13 0x00007f32ffc1bcfc in Camera96Tof1::initialize() () from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #14 0x00005561aa488605 in main ()
    (gdb) 
    

    ======================================

    I traced aditof-open3d-showPointCloud program which inserted LOG(INFO) to each step after "Camera initialized" message.

    Camera96Tof1::initialize()

        >>> m_calibration.getIntrinsic(INTRINSIC, m_details.intrinsics.cameraMatrix); (camera_96tof1.cpp)

          >>> data.insert(data.begin(), valList.begin(), valList.end()); (calibration.cpp in Calibration::getIntrinsic)

    The message show before calling data.insert(), but it occurred the segmentation fault, after run it.

    I do not modified the code except to insert LOG(INFO).

    And Build options for Open3D as follow:

    INSTALL_DIR=/work/dragon/aditof_sdk/deps/installed/Open3D
    cmake .. -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}
    make -j6
    sudo make install

Reply
  • For Question #1)

    I connected the USB device and detected successfully.

    But it has a Segmentation fault.  dumped core file and checked with the gdb.

    Please help me run the program.

    $ ./aditof-open3d-showPointCloud 
    I0327 09:14:02.399243  2553 device_enumerator_linux.cpp:48] Looking for USB connected devices
    I0327 09:14:02.516445  2553 system_impl.cpp:62] System initialized
    I0327 09:14:02.516502  2553 main.cpp:67] main@67
    I0327 09:14:02.516510  2553 camera_96tof1.cpp:78] Initializing camera
    I0327 09:14:02.516515  2553 usb_device_linux.cpp:115] Opening device
    I0327 09:14:03.304183  2553 calibration.cpp:261] EEPROM calibration data size 64940 bytes
    I0327 09:14:10.190385  2553 camera_96tof1.cpp:95] Camera initialized
    Segmentation fault (core dumped)
    

    $ gdb ./aditof-open3d-showPointCloud ./core 
    GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git
    Copyright (C) 2018 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-linux-gnu".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>.
    Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.
    For help, type "help".
    Type "apropos word" to search for commands related to "word"...
    Reading symbols from ./aditof-open3d-showPointCloud...(no debugging symbols found)...done.
    
    warning: core file may not match specified executable file.
    [New LWP 74824]
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    Core was generated by `./aditof-open3d-showPointCloud'.
    Program terminated with signal SIGSEGV, Segmentation fault.
    #0  __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:225
    225	../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No such file or directory.
    (gdb) 
    (gdb) 
    (gdb) bt
    #0  __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:225
    #1  0x00007f32ffc1b720 in float* std::__copy_move<true, true, std::random_access_iterator_tag>::__copy_m<float>(float const*, float const*, float*) () from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #2  0x00007f32ffc1b662 in float* std::__copy_move_a<true, float*, float*>(float*, float*, float*) ()
       from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #3  0x00007f32ffc1b576 in float* std::__copy_move_a2<true, float*, float*>(float*, float*, float*) ()
       from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #4  0x00007f32ffc1b2c0 in float* std::copy<std::move_iterator<float*>, float*>(std::move_iterator<float*>, std::move_iterator<float*>, float*) () from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #5  0x00007f32ffc1ab49 in float* std::__uninitialized_copy<true>::__uninit_copy<std::move_iterator<float*>, float*>(std::move_iterator<float*>, std::move_iterator<float*>, float*) () from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #6  0x00007f32ffc19ffb in float* std::uninitialized_copy<std::move_iterator<float*>, float*>(std::move_iterator<float*>, std::move_iterator<float*>, float*) () from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #7  0x00007f32ffc18c21 in float* std::__uninitialized_copy_a<std::move_iterator<float*>, float*, float>(std::move_iterator<float*>, std::move_iterator<float*>, float*, std::allocator<float>&) () from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #8  0x00007f32ffc189be in float* std::__uninitialized_move_a<float*, float*, std::allocator<float> >(float*, float*, float*, std::allocator<float>&) () from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #9  0x00007f32ffc16821 in void std::vector<float, std::allocator<float> >::_M_range_insert<std::_List_const_iterator<float> >(__gnu_cxx::__normal_iterator<float*, std::vector<float, std::allocator<float> > >, std::_List_const_iterator<float>, std::_List_const_iterator<float>, std::forward_iterator_tag) () from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #10 0x00007f32ffc14b55 in void std::vector<float, std::allocator<float> >::_M_insert_dispatch<std::_List_const_iterator<float> >(__gnu_cxx::__normal_iterator<float*, std::vector<float, std::allocator<float> > >, std::_List_const_iterator<float>, std::_List_const_iterator<float>, std::__false_type) () from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #11 0x00007f32ffc135aa in __gnu_cxx::__normal_iterator<float*, std::vector<float, std::allocator<float> > > std::vector<float, std::allocator<float> >::insert<std::_List_const_iterator<float>, void>(__gnu_cxx::__normal_iterator<float const*, std::vector<float, std::allocator<float> > >, std::_List_const_iterator<float>, std::_List_const_iterator<float>) () from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #12 0x00007f32ffc11930 in Calibration::getIntrinsic(float, std::vector<float, std::allocator<float> >&) const ()
       from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #13 0x00007f32ffc1bcfc in Camera96Tof1::initialize() () from /work/dragon/aditof_sdk/build/sdk/libaditof.so.1.0
    #14 0x00005561aa488605 in main ()
    (gdb) 
    

    ======================================

    I traced aditof-open3d-showPointCloud program which inserted LOG(INFO) to each step after "Camera initialized" message.

    Camera96Tof1::initialize()

        >>> m_calibration.getIntrinsic(INTRINSIC, m_details.intrinsics.cameraMatrix); (camera_96tof1.cpp)

          >>> data.insert(data.begin(), valList.begin(), valList.end()); (calibration.cpp in Calibration::getIntrinsic)

    The message show before calling data.insert(), but it occurred the segmentation fault, after run it.

    I do not modified the code except to insert LOG(INFO).

    And Build options for Open3D as follow:

    INSTALL_DIR=/work/dragon/aditof_sdk/deps/installed/Open3D
    cmake .. -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}
    make -j6
    sudo make install

Children