프로그램 사용/kinect2024. 7. 14. 11:19

처음 실행하니 권한부족.. libusb가 권한이 필요한 녀석이었던가?

libfreenect2/build/bin$ ./Protonect 
Version: 0.2.0
Environment variables: LOGFILE=<protonect.log>
Usage: ./Protonect [-gpu=<id>] [gl | cl | clkde | cuda | cudakde | cpu] [<device serial>]
        [-noviewer] [-norgb | -nodepth] [-help] [-version]
        [-frames <number of frames to process>]
To pause and unpause: pkill -USR1 Protonect
[Info] [Freenect2Impl] enumerating devices...
[Info] [Freenect2Impl] 10 usb devices connected
[Error] [Freenect2Impl] failed to open Kinect v2: @4:3 LIBUSB_ERROR_ACCESS Access denied (insufficient permissions)
[Info] [Freenect2Impl] found 0 devices
no device connected!

 

짜잔~하고 먼가 나오길 기대했지만... 안된다 -_-

$ sudo ./Protonect 
Version: 0.2.0
Environment variables: LOGFILE=<protonect.log>
Usage: ./Protonect [-gpu=<id>] [gl | cl | clkde | cuda | cudakde | cpu] [<device serial>]
        [-noviewer] [-norgb | -nodepth] [-help] [-version]
        [-frames <number of frames to process>]
To pause and unpause: pkill -USR1 Protonect
[Info] [Freenect2Impl] enumerating devices...
[Info] [Freenect2Impl] 10 usb devices connected
[Info] [Freenect2Impl] found valid Kinect v2 @4:5 with serial 501441643042
[Info] [Freenect2Impl] found 1 devices
[Info] [Freenect2DeviceImpl] opening...
[Info] [Freenect2DeviceImpl] transfer pool sizes rgb: 20*16384 ir: 60*8*33792
[Info] [Freenect2DeviceImpl] opened
[Info] [Freenect2DeviceImpl] starting...
[Debug] [Freenect2DeviceImpl] status 0x090000: 9729
[Error] [protocol::UsbControl] failed to set ir interface state! LIBUSB_ERROR_OTHER Other error. Try debugging with environment variable: export LIBUSB_DEBUG=3 .
[Info] [Freenect2DeviceImpl] closing...
[Info] [Freenect2DeviceImpl] releasing usb interfaces...
[Info] [Freenect2DeviceImpl] deallocating usb transfer pools...
[Info] [Freenect2DeviceImpl] closing usb device...
[Info] [Freenect2DeviceImpl] closed

 

LIBUSB_DEBUG를 줘도 두 줄 추가 되는 것 외에는 별다른 에러 메시지가 없다.

# LIBUSB_DEBUG=3 ./Protonect 
Version: 0.2.0
Environment variables: LOGFILE=<protonect.log>
Usage: ./Protonect [-gpu=<id>] [gl | cl | clkde | cuda | cudakde | cpu] [<device serial>]
        [-noviewer] [-norgb | -nodepth] [-help] [-version]
        [-frames <number of frames to process>]
To pause and unpause: pkill -USR1 Protonect
libusb: warning [libusb_init] installing new context as implicit default
[Info] [Freenect2Impl] enumerating devices...
[Info] [Freenect2Impl] 10 usb devices connected
[Info] [Freenect2Impl] found valid Kinect v2 @4:7 with serial 501441643042
[Info] [Freenect2Impl] found 1 devices
[Info] [Freenect2DeviceImpl] opening...
[Info] [Freenect2DeviceImpl] transfer pool sizes rgb: 20*16384 ir: 60*8*33792
[Info] [Freenect2DeviceImpl] opened
[Info] [Freenect2DeviceImpl] starting...
libusb: error [udev_hotplug_event] ignoring udev action change
libusb: error [udev_hotplug_event] ignoring udev action change
[Debug] [Freenect2DeviceImpl] status 0x090000: 9731
libusb: error [op_set_interface] set interface failed, errno=28
[Error] [protocol::UsbControl] failed to set ir interface state! LIBUSB_ERROR_OTHER Other error. Try debugging with environment variable: export LIBUSB_DEBUG=3 .
[Info] [Freenect2DeviceImpl] closing...
[Info] [Freenect2DeviceImpl] releasing usb interfaces...
[Info] [Freenect2DeviceImpl] deallocating usb transfer pools...
[Info] [Freenect2DeviceImpl] closing usb device...
[Info] [Freenect2DeviceImpl] closed
libusb: warning [libusb_exit] device 4.7 still referenced
libusb: warning [libusb_exit] device 4.6 still referenced
libusb: warning [libusb_exit] device 4.1 still referenced

 

커널 메시지로는.... 엥? 왜 갑자기 대역폭 부족?

$ sudo dmesg -w
[  415.484074] usb 4-1.1: reset SuperSpeed USB device number 7 using xhci_hcd
[  415.595900] usb 4-1.1: Not enough bandwidth for new device state.
[  415.595907] usb 4-1.1: Not enough bandwidth for altsetting 1

 

라이브러리 홈페이지 가서 다시 보니 

make install 하고 udev rule을 복사한 뒤, 키넥트를 뽑았다 꽂으라고 한다.

Build (if you have run cd depends previously, cd .. back to the libfreenect2 root directory first.)
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/freenect2
make
make install
You need to specify cmake -Dfreenect2_DIR=$HOME/freenect2/lib/cmake/freenect2 for CMake based third-party application to find libfreenect2.
Set up udev rules for device access: sudo cp ../platform/linux/udev/90-kinect2.rules /etc/udev/rules.d/, then replug the Kinect.
Run the test program: ./bin/Protonect
Run OpenNI2 test (optional): sudo apt-get install openni2-utils && sudo make install-openni2 && NiViewer2. Environment variable LIBFREENECT2_PIPELINE can be set to cl, cuda, etc to specify the pipeline.

[링크 : https://github.com/OpenKinect/libfreenect2]

 

먼가 잔뜩 뜨긴 한데.. udev 쪽 먼가 실행하는 것 같진 않고..

[  517.098960] usb 3-1: new high-speed USB device number 5 using xhci_hcd
[  517.251097] usb 3-1: New USB device found, idVendor=045e, idProduct=02d9, bcdDevice= 0.70
[  517.251115] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  517.251122] usb 3-1: Product: NuiSensor Adaptor      
[  517.251127] usb 3-1: Manufacturer: Microsoft Corporation  
[  517.254367] hub 3-1:1.0: USB hub found
[  517.254752] hub 3-1:1.0: 1 port detected
[  517.704842] usb 4-1: new SuperSpeed USB device number 8 using xhci_hcd
[  520.690577] usb 4-1: New USB device found, idVendor=045e, idProduct=02d9, bcdDevice= 0.73
[  520.690597] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  520.690604] usb 4-1: Product: NuiSensor Adaptor      
[  520.690610] usb 4-1: Manufacturer: Microsoft Corporation  
[  520.694210] hub 4-1:1.0: USB hub found
[  520.694623] hub 4-1:1.0: 1 port detected
[  521.187545] usb 4-1.1: new SuperSpeed USB device number 9 using xhci_hcd
[  521.212947] usb 4-1.1: New USB device found, idVendor=045e, idProduct=02d8, bcdDevice= 1.00
[  521.212966] usb 4-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=4
[  521.212973] usb 4-1.1: Product: Xbox NUI Sensor
[  521.212977] usb 4-1.1: Manufacturer: Microsoft
[  521.212982] usb 4-1.1: SerialNumber: 501441643042

 

키넥트 관련은 MODE 주는 것 외에는 별다른게 없어 보인다.

src/libfreenect2/build/bin# cat ../../platform/linux/udev/90-kinect2.rules 
# this file belongs in /etc/udev/rules.d/
# ATTR{product}=="Kinect2"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02c4", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02d8", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02d9", MODE="0666"

 

에러는 동일하게 대역폭 부족이 뜬다.

$ sudo ./Protonect 
Version: 0.2.0
Environment variables: LOGFILE=<protonect.log>
Usage: ./Protonect [-gpu=<id>] [gl | cl | clkde | cuda | cudakde | cpu] [<device serial>]
        [-noviewer] [-norgb | -nodepth] [-help] [-version]
        [-frames <number of frames to process>]
To pause and unpause: pkill -USR1 Protonect
[Info] [Freenect2Impl] enumerating devices...
[Info] [Freenect2Impl] 10 usb devices connected
[Info] [Freenect2Impl] found valid Kinect v2 @4:13 with serial 501441643042
[Info] [Freenect2Impl] found 1 devices
[Info] [Freenect2DeviceImpl] opening...
[Info] [Freenect2DeviceImpl] transfer pool sizes rgb: 20*16384 ir: 60*8*33792
[Info] [Freenect2DeviceImpl] opened
[Info] [Freenect2DeviceImpl] starting...
[Debug] [Freenect2DeviceImpl] status 0x090000: 9731
[Error] [protocol::UsbControl] failed to set ir interface state! LIBUSB_ERROR_OTHER Other error. Try debugging with environment variable: export LIBUSB_DEBUG=3 .
[Info] [Freenect2DeviceImpl] closing...
[Info] [Freenect2DeviceImpl] releasing usb interfaces...
[Info] [Freenect2DeviceImpl] deallocating usb transfer pools...
[Info] [Freenect2DeviceImpl] closing usb device...
[Info] [Freenect2DeviceImpl] closed

 

[  786.203660] usb 4-2.1: reset SuperSpeed USB device number 13 using xhci_hcd
[  786.318931] usb 4-2.1: Not enough bandwidth for new device state.
[  786.318939] usb 4-2.1: Not enough bandwidth for altsetting 1

 

혹시나 해서 USB2.0에 꽂아보니 아래와 같이 에러가 발생한다.

$ sudo ./Protonect 
Version: 0.2.0
Environment variables: LOGFILE=<protonect.log>
Usage: ./Protonect [-gpu=<id>] [gl | cl | clkde | cuda | cudakde | cpu] [<device serial>]
        [-noviewer] [-norgb | -nodepth] [-help] [-version]
        [-frames <number of frames to process>]
To pause and unpause: pkill -USR1 Protonect
[Info] [Freenect2Impl] enumerating devices...
[Info] [Freenect2Impl] 9 usb devices connected
[Info] [Freenect2Impl] found valid Kinect v2 @2:5 with serial 501441643042
[Info] [Freenect2Impl] found 1 devices
[Info] [Freenect2DeviceImpl] opening...
[Error] [protocol::UsbControl] failed to claim interface with IrInterfaceId(=1)! LIBUSB_ERROR_BUSY Resource busy. Try debugging with environment variable: export LIBUSB_DEBUG=3 .
[Info] [Freenect2DeviceImpl] closing...
[Info] [Freenect2DeviceImpl] deallocating usb transfer pools...
[Info] [Freenect2DeviceImpl] closing usb device...
[Info] [Freenect2DeviceImpl] closed
[Error] [Freenect2Impl] failed to open Kinect v2: @2:5
failure opening device!

 

dmesg 상에는 아래와 같이 BOS desciptor 가 없거나 너무 짧다는게 그건 또 머냐..

[  683.513603] usb 2-1.1.1: reset high-speed USB device number 5 using ehci-pci
[  683.634757] usb 2-1.1.1: unable to get BOS descriptor or descriptor too short

 

expresscard to USB3.0 을 써서 생기는 문제인가.. 아니면 빌드라던가 다른 문제인가..

 

 

+

2024.07.15

usbfs 크기가 적으니 늘리는게 도움이 된다는데 해도 해결은 안된다.

기본은 ubutu 22.04 에서 16MB 인 듯한데 1000MB로 늘려도 안된다.

$ cat /etc/default/grub | grep GRUB_CMDLINE_LINUX_DEFAULT
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
$ cat /sys/module/usbcore/parameters/usbfs_memory_mb
16
$ sudo sh -c 'echo 1000 > /sys/module/usbcore/parameters/usbfs_memory_mb'
$ cat /sys/module/usbcore/parameters/usbfs_memory_mb
1000

[링크 : https://github.com/OpenKinect/libfreenect2/issues/971]

[링크 : https://importgeek.wordpress.com/2017/02/26/increase-usbfs-memory-limit-in-ubuntu/]

 

+

혹시나 해서 찾아보는데..

expresscard의 경우 PCIe 2 or USB 3 mode 일 경우 3.2Gbps로 USB3.0의 5Gbps 에는 어떤 모드던 부족하다.

그런데 풀 대역폭을 쓰진 않을수도 있긴한데.. USB 장치에서 필요로 하는 대역폭을 다 커버 할 수 없는건가?

 

Speed
480 Mbit/s effective (USB 2 mode)
1.6 Gbit/s effective (PCIe 1 mode)
3.2 Gbit/s effective (PCIe 2 or USB 3 mode)

[링크 : https://en.wikipedia.org/wiki/ExpressCard]

 

칩셋인 uPD720202도 스펙상 PCIe Gen2 1 lane 이고, 속도까진 나와있지 않다

System I/F: PCIe Gen2 x 1 Lane

[링크 : https://www.renesas.com/us/en/products/interface/usb-switches-hubs/upd720202-usb-30-host-controller#overview]

 

i5-2520m 도 PCIe Gen 2 라고 하는데

확장 옵션
PCI Express 개정판 2.0
PCI Express 구성 ‡ 1x16, 2x8, 1x8+2x4
최대 PCI Express 레인 수 16

[링크 : https://www.intel.co.kr/content/www/kr/ko/products/sku/52229/intel-core-i52520m-processor-3m-cache-up-to-3-20-ghz/specifications.html]

 

pci-e 2.0 lane 1은 5.0GT/s 이고 5Gbps로 계산이 되긴한다.

반대로 생각하면 USB3.0이 생각외로 빠른거구나..

[링크 : https://en.wikipedia.org/wiki/PCI_Express]

 

Depends on your thinkpad's generation of Expresscard
Gen 1 is 1.6gbps
Gen 2 is 3.2gbps
Gen 3 is 6.4gbps, but each usb port can only do a max of 5gbps
In this case it's a T420 so it has gen 2 expresscard

[링크 : https://www.reddit.com/r/thinkpad/comments/xy44zj/finally_got_the_cheapest_usb_30_express_card_for/]

 

expresscard 34 규격의 sony sxs pro 라는 저장장치 인데

우연인지 아니면 대역폭 한계인지 3.2Gbps가 검색되서 나온다. expresscard와 pci-e 와는 속도 차이가 존재하는건가?

Max. Speeds
Read speed 3.5Gbps (=440MB/s) (1)
Write Speed 3.2Gbps (=400MB/s) (1)

[링크 : https://ccktech.com/product/sony-sxs-pro/]

[링크 :  https://ccktech.com/product-interface/expresscard-34/]

'프로그램 사용 > kinect' 카테고리의 다른 글

libfreenect2 성공  (0) 2024.07.17
libfreenect2 실행 성공..  (0) 2024.07.15
libfreenect2 CUDA 끄고 빌드 성공  (0) 2024.07.13
kinect v2 / freenect 실패  (0) 2024.07.09
xbox one S / 기본형?  (0) 2024.06.25
Posted by 구차니
프로그램 사용/kinect2024. 7. 13. 23:05

귀찮으니 실행은 다음에 해보는 걸로 ㅋ

 

cmake .. -DENABLE_CUDA=OFF
CMake Deprecation Warning at CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- using tinythread as threading library
-- Checking for modules 'libva;libva-drm'
--   No package 'libva' found
--   No package 'libva-drm' found
-- Could NOT find TegraJPEG (missing: TegraJPEG_LIBRARIES TegraJPEG_INCLUDE_DIRS TegraJPEG_WORKS) 
CMake Warning (dev) at /home/minimonk/.local/lib/python3.10/site-packages/cmake/data/share/cmake-3.30/Modules/FindOpenGL.cmake:415 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  CMakeLists.txt:269 (FIND_PACKAGE)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find OpenCL (missing: OpenCL_LIBRARY OpenCL_INCLUDE_DIR) 
-- Linking with these libraries: 
 /usr/lib/x86_64-linux-gnu/libusb-1.0.so
 pthread
 /usr/lib/x86_64-linux-gnu/libturbojpeg.so.0
 /usr/lib/x86_64-linux-gnu/libglfw.so
 /usr/lib/x86_64-linux-gnu/libGL.so
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
-- Configurating examples
CMake Deprecation Warning at examples/CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Using in-tree freenect2 target
-- Feature list:
--   CUDA    disabled
--   CXX11    disabled
--   Examples    yes
--   OpenCL    no
--   OpenGL    yes
--   OpenNI2    yes
--   TegraJPEG    no
--   Threading    tinythread
--   TurboJPEG    yes
--   VAAPI    no
--   VideoToolbox    no (Apple only)
--   streamer_recorder    disabled
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /home/minimonk/src/libfreenect2/build

 

$ make -j4
[  2%] Building CXX object CMakeFiles/generate_resources_tool.dir/tools/generate_resources.cpp.o
[  5%] Linking CXX executable bin/generate_resources_tool
[  5%] Built target generate_resources_tool
[  8%] Generating resources.inc.h
[ 10%] Building CXX object CMakeFiles/freenect2.dir/src/transfer_pool.cpp.o
[ 13%] Building CXX object CMakeFiles/freenect2.dir/src/event_loop.cpp.o
[ 16%] Building CXX object CMakeFiles/freenect2.dir/src/usb_control.cpp.o
[ 18%] Building CXX object CMakeFiles/freenect2.dir/src/allocator.cpp.o
[ 21%] Building CXX object CMakeFiles/freenect2.dir/src/frame_listener_impl.cpp.o
[ 24%] Building CXX object CMakeFiles/freenect2.dir/src/packet_pipeline.cpp.o
[ 27%] Building CXX object CMakeFiles/freenect2.dir/src/rgb_packet_stream_parser.cpp.o
[ 29%] Building CXX object CMakeFiles/freenect2.dir/src/rgb_packet_processor.cpp.o
[ 32%] Building CXX object CMakeFiles/freenect2.dir/src/depth_packet_stream_parser.cpp.o
[ 35%] Building CXX object CMakeFiles/freenect2.dir/src/depth_packet_processor.cpp.o
[ 37%] Building CXX object CMakeFiles/freenect2.dir/src/cpu_depth_packet_processor.cpp.o
[ 40%] Building CXX object CMakeFiles/freenect2.dir/src/resource.cpp.o
[ 43%] Building CXX object CMakeFiles/freenect2.dir/src/command_transaction.cpp.o
[ 45%] Building CXX object CMakeFiles/freenect2.dir/src/registration.cpp.o
[ 48%] Building CXX object CMakeFiles/freenect2.dir/src/logging.cpp.o
/home/minimonk/src/libfreenect2/src/cpu_depth_packet_processor.cpp: In member function ‘virtual void libfreenect2::CpuDepthPacketProcessor::loadP0TablesFromCommandResponse(unsigned char*, size_t)’:
/home/minimonk/src/libfreenect2/src/cpu_depth_packet_processor.cpp:844:53: warning: taking address of packed member of ‘libfreenect2::protocol::P0TablesResponse’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  844 |     flipHorizontal(Mat(424, 512, p0table->p0table0), impl_->p0_table0);
      |                                            ~~~~~~~~~^~~~~~~~
/home/minimonk/src/libfreenect2/src/cpu_depth_packet_processor.cpp:845:53: warning: taking address of packed member of ‘libfreenect2::protocol::P0TablesResponse’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  845 |     flipHorizontal(Mat(424, 512, p0table->p0table1), impl_->p0_table1);
      |                                            ~~~~~~~~~^~~~~~~~
/home/minimonk/src/libfreenect2/src/cpu_depth_packet_processor.cpp:846:53: warning: taking address of packed member of ‘libfreenect2::protocol::P0TablesResponse’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  846 |     flipHorizontal(Mat(424, 512, p0table->p0table2), impl_->p0_table2);
      |                                            ~~~~~~~~~^~~~~~~~
/home/minimonk/src/libfreenect2/src/cpu_depth_packet_processor.cpp:850:42: warning: taking address of packed member of ‘libfreenect2::protocol::P0TablesResponse’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  850 |     Mat p00(424, 512, p0table->p0table0);
      |                                 ~~~~~~~~~^~~~~~~~
/home/minimonk/src/libfreenect2/src/cpu_depth_packet_processor.cpp:852:38: warning: taking address of packed member of ‘libfreenect2::protocol::P0TablesResponse’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  852 |     Mat(424, 512, p0table->p0table1).copyTo(impl_->p0_table1);
      |                             ~~~~~~~~~^~~~~~~~
/home/minimonk/src/libfreenect2/src/cpu_depth_packet_processor.cpp:853:38: warning: taking address of packed member of ‘libfreenect2::protocol::P0TablesResponse’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  853 |     Mat(424, 512, p0table->p0table2).copyTo(impl_->p0_table2);
      |                             ~~~~~~~~~^~~~~~~~
[ 51%] Building CXX object CMakeFiles/freenect2.dir/src/libfreenect2.cpp.o
[ 54%] Building CXX object CMakeFiles/freenect2.dir/src/tinythread/tinythread.cpp.o
[ 56%] Building CXX object CMakeFiles/freenect2.dir/src/turbo_jpeg_rgb_packet_processor.cpp.o
[ 59%] Building CXX object CMakeFiles/freenect2.dir/src/flextGL.cpp.o
[ 62%] Building CXX object CMakeFiles/freenect2.dir/src/opengl_depth_packet_processor.cpp.o
[ 64%] Linking CXX shared library lib/libfreenect2.so
[ 64%] Built target freenect2
[ 70%] Building CXX object examples/CMakeFiles/Protonect.dir/Protonect.cpp.o
[ 72%] Building CXX object CMakeFiles/freenect2-openni2.dir/src/openni2/ColorStream.cpp.o
[ 72%] Building CXX object examples/CMakeFiles/Protonect.dir/__/src/flextGL.cpp.o
[ 75%] Building CXX object examples/CMakeFiles/Protonect.dir/viewer.cpp.o
[ 78%] Building CXX object CMakeFiles/freenect2-openni2.dir/src/openni2/DepthStream.cpp.o
/home/minimonk/src/libfreenect2/examples/Protonect.cpp: In function ‘int main(int, char**)’:
/home/minimonk/src/libfreenect2/examples/Protonect.cpp:157:7: warning: variable ‘deviceId’ set but not used [-Wunused-but-set-variable]
  157 |   int deviceId = -1;
      |       ^~~~~~~~
[ 81%] Building CXX object CMakeFiles/freenect2-openni2.dir/src/openni2/DeviceDriver.cpp.o
[ 83%] Building CXX object CMakeFiles/freenect2-openni2.dir/src/openni2/IrStream.cpp.o
[ 86%] Building CXX object CMakeFiles/freenect2-openni2.dir/src/openni2/Registration.cpp.o
[ 89%] Linking CXX executable ../bin/Protonect
[ 89%] Built target Protonect
[ 91%] Building CXX object CMakeFiles/freenect2-openni2.dir/src/openni2/Utility.cpp.o
[ 94%] Building CXX object CMakeFiles/freenect2-openni2.dir/src/openni2/VideoStream.cpp.o
[ 97%] Building CXX object CMakeFiles/freenect2-openni2.dir/src/tinythread/tinythread.cpp.o
In file included from /usr/include/string.h:535,
                 from /usr/include/openni2/Linux-x86/OniPlatformLinux-x86.h:34,
                 from /usr/include/openni2/OniPlatform.h:42,
                 from /usr/include/openni2/Driver/OniDriverAPI.h:24,
                 from /home/minimonk/src/libfreenect2/src/openni2/DeviceDriver.cpp:35:
In function ‘char* strncpy(char*, const char*, size_t)’,
    inlined from ‘void Freenect2Driver::Driver::register_uri(std::string)’ at /home/minimonk/src/libfreenect2/src/openni2/DeviceDriver.cpp:404:14:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:95:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ specified bound 256 equals destination size [-Wstringop-truncation]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
   96 |                                   __glibc_objsize (__dest));
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
[100%] Linking CXX shared library lib/libfreenect2-openni2.so
[100%] Built target freenect2-openni2

 

~/src/libfreenect2/build$ tree -L 2 
.
├── CMakeCache.txt
├── CMakeFiles
│   ├── 3.30.0
│   ├── CMakeConfigureLog.yaml
│   ├── CMakeDirectoryInformation.cmake
│   ├── CMakeRuleHashes.txt
│   ├── CMakeScratch
│   ├── Makefile.cmake
│   ├── Makefile2
│   ├── TargetDirectories.txt
│   ├── cmake.check_cache
│   ├── freenect2-openni2.dir
│   ├── freenect2.dir
│   ├── generate_resources_tool.dir
│   ├── install-openni2.dir
│   ├── pkgRedirects
│   └── progress.marks
├── Makefile
├── bin
│   ├── Protonect
│   └── generate_resources_tool
├── cmake_install.cmake
├── doc
│   ├── CMakeFiles
│   ├── Makefile
│   └── cmake_install.cmake
├── examples
│   ├── CMakeFiles
│   ├── Makefile
│   └── cmake_install.cmake
├── freenect2.pc
├── freenect2Config.cmake
├── freenect2ConfigVersion.cmake
├── lib
│   ├── libfreenect2-openni2.so -> libfreenect2-openni2.so.0
│   ├── libfreenect2-openni2.so.0
│   ├── libfreenect2.so -> libfreenect2.so.0.2
│   ├── libfreenect2.so.0.2 -> libfreenect2.so.0.2.0
│   └── libfreenect2.so.0.2.0
├── libfreenect2
│   ├── config.h
│   └── export.h
└── resources.inc.h

15 directories, 28 files

 

bin/Protonect 를 실행하면 스트리밍 된다고 한다.

[링크 : https://www.notaboutmy.life/posts/run-kinect-2-on-ubuntu-20-lts/]

 

소스를 뒤져보니 glfw 라는 접두로 된 녀석을 통해 그리는데, openGL ES와 vulkan으로 그리는 듯?

[링크 : https://www.glfw.org/]

'프로그램 사용 > kinect' 카테고리의 다른 글

libfreenect2 실행 성공..  (0) 2024.07.15
libfreenect2 실행 실패  (0) 2024.07.14
kinect v2 / freenect 실패  (0) 2024.07.09
xbox one S / 기본형?  (0) 2024.06.25
kinect for windows v2 설치  (0) 2024.06.24
Posted by 구차니

이번에 구매한 usb3.0 확장 카드를 연결하고 케이블들을 낑낑대면서 연결하니 뜨긴 한다.

$ sudo dmesg
[  437.911262] pcieport 0000:00:1c.1: pciehp: Slot(1): Card present
[  437.911269] pcieport 0000:00:1c.1: pciehp: Slot(1): Link Up
[  438.044260] pci 0000:02:00.0: [1912:0015] type 00 class 0x0c0330
[  438.044330] pci 0000:02:00.0: reg 0x10: [mem 0x00000000-0x00001fff 64bit]
[  438.044672] pci 0000:02:00.0: PME# supported from D0 D3hot D3cold
[  438.044800] pci 0000:02:00.0: 2.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s PCIe x1 link at 0000:00:1c.1 (capable of 4.000 Gb/s with 5.0 GT/s PCIe x1 link)
[  438.045216] pci 0000:02:00.0: BAR 0: assigned [mem 0xd0000000-0xd0001fff 64bit]
[  438.045250] pcieport 0000:00:1c.1: PCI bridge to [bus 02-22]
[  438.045256] pcieport 0000:00:1c.1:   bridge window [io  0x2000-0x3fff]
[  438.045263] pcieport 0000:00:1c.1:   bridge window [mem 0xd0000000-0xd3ffffff]
[  438.045269] pcieport 0000:00:1c.1:   bridge window [mem 0xbfb00000-0xbfcfffff 64bit pref]
[  438.045301] pci 0000:02:00.0: enabling device (0000 -> 0002)
[  438.064367] xhci_hcd 0000:02:00.0: failed to load firmware renesas_usb_fw.mem, fallback to ROM
[  438.064525] xhci_hcd 0000:02:00.0: xHCI Host Controller
[  438.064539] xhci_hcd 0000:02:00.0: new USB bus registered, assigned bus number 3
[  438.069936] xhci_hcd 0000:02:00.0: hcc params 0x014051cf hci version 0x100 quirks 0x0000001100000090
[  438.070598] xhci_hcd 0000:02:00.0: xHCI Host Controller
[  438.070606] xhci_hcd 0000:02:00.0: new USB bus registered, assigned bus number 4
[  438.070613] xhci_hcd 0000:02:00.0: Host supports USB 3.0 SuperSpeed
[  438.076171] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
[  438.076179] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[  438.076181] usb usb3: Product: xHCI Host Controller
[  438.076183] usb usb3: Manufacturer: Linux 5.15.0-113-generic xhci-hcd
[  438.076185] usb usb3: SerialNumber: 0000:02:00.0
[  438.076795] hub 3-0:1.0: USB hub found
[  438.076819] hub 3-0:1.0: 2 ports detected
[  438.077339] usb usb4: We don't know the algorithms for LPM for this host, disabling LPM.
[  438.077384] usb usb4: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.15
[  438.077388] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[  438.077391] usb usb4: Product: xHCI Host Controller
[  438.077393] usb usb4: Manufacturer: Linux 5.15.0-113-generic xhci-hcd
[  438.077395] usb usb4: SerialNumber: 0000:02:00.0
[  438.077862] hub 4-0:1.0: USB hub found
[  438.077883] hub 4-0:1.0: 2 ports detected
[  633.299719] usb 3-1: new high-speed USB device number 2 using xhci_hcd
[  633.451210] usb 3-1: New USB device found, idVendor=045e, idProduct=02d9, bcdDevice= 0.70
[  633.451228] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  633.451235] usb 3-1: Product: NuiSensor Adaptor      
[  633.451240] usb 3-1: Manufacturer: Microsoft Corporation  
[  633.454348] hub 3-1:1.0: USB hub found
[  633.454783] hub 3-1:1.0: 1 port detected
[  633.909291] usb 4-1: new SuperSpeed USB device number 2 using xhci_hcd
[  636.898560] usb 4-1: New USB device found, idVendor=045e, idProduct=02d9, bcdDevice= 0.73
[  636.898577] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  636.898584] usb 4-1: Product: NuiSensor Adaptor      
[  636.898590] usb 4-1: Manufacturer: Microsoft Corporation  
[  636.902320] hub 4-1:1.0: USB hub found
[  636.902758] hub 4-1:1.0: 1 port detected
[  637.392541] usb 4-1.1: new SuperSpeed USB device number 3 using xhci_hcd
[  637.421621] usb 4-1.1: New USB device found, idVendor=045e, idProduct=02d8, bcdDevice= 1.00
[  637.421649] usb 4-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=4
[  637.421654] usb 4-1.1: Product: Xbox NUI Sensor
[  637.421657] usb 4-1.1: Manufacturer: Microsoft
[  637.421661] usb 4-1.1: SerialNumber: 501441643042
[  637.493029] usbcore: registered new interface driver snd-usb-audio

 

일단.. 5Gbps로 USB3.0으로 잘 붙긴한데

$ lsusb -t -v
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 5000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/1p, 5000M
        ID 045e:02d9 Microsoft Corp. 
        |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=, 5000M
            ID 045e:02d8 Microsoft Corp. 
        |__ Port 1: Dev 3, If 1, Class=Vendor Specific Class, Driver=, 5000M
            ID 045e:02d8 Microsoft Corp. 
        |__ Port 1: Dev 3, If 2, Class=Audio, Driver=snd-usb-audio, 5000M
            ID 045e:02d8 Microsoft Corp. 
        |__ Port 1: Dev 3, If 3, Class=Audio, Driver=snd-usb-audio, 5000M
            ID 045e:02d8 Microsoft Corp. 
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/1p, 480M
        ID 045e:02d9 Microsoft Corp. 
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/3p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M
        ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
        |__ Port 4: Dev 3, If 0, Class=Video, Driver=uvcvideo, 480M
            ID 04f2:b242 Chicony Electronics Co., Ltd 
        |__ Port 4: Dev 3, If 1, Class=Video, Driver=uvcvideo, 480M
            ID 04f2:b242 Chicony Electronics Co., Ltd 
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/3p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M
        ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
        |__ Port 4: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
            ID 04b4:6560 Cypress Semiconductor Corp. CY7C65640 USB-2.0 "TetraHub"
        |__ Port 6: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 480M
            ID 049f:0081 Compaq Computer Corp. 

 

이전에 실행했던 녀석을 실행하니.. 어...?!

$ freenect-camtest 
No device found!

 

검색해보니 libfreenect2 라는걸 설치해야 하는 것 같은데..

일단 패키지 설치 안하고 하니 먼가 에러가 나서

-- Could NOT find TegraJPEG (missing: TegraJPEG_LIBRARIES TegraJPEG_INCLUDE_DIRS TegraJPEG_WORKS) 
CMake Error at /home/minimonk/.local/lib/python3.10/site-packages/cmake/data/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find TurboJPEG (missing: TurboJPEG_LIBRARIES
  TurboJPEG_INCLUDE_DIRS TURBOJPEG_WORKS)
Call Stack (most recent call first):
  /home/minimonk/.local/lib/python3.10/site-packages/cmake/data/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  cmake_modules/FindTurboJPEG.cmake:66 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:243 (FIND_PACKAGE)

 

패키지들 왕창 설치!!

$ sudo apt-get install libusb-1.0-0-dev libturbojpeg0-dev libglfw3-dev libva-dev libjpeg-dev libopenni2-dev
$ pip3 install cmake

 

make 하는데 gcc 버전이 낮아서 안되는 듯...

귀찮으니 나중에 다시 시도.. 키넥트2 정리하기 귀찮은디.. ㅠㅠ

(다시보니 cuda 때문인데 cuda 지원을 뺄까?)

In file included from /usr/local/cuda/include/cuda_runtime.h:83,
                 from <command-line>:
/usr/local/cuda/include/crt/host_config.h:138:2: error: #error -- unsupported GNU version! gcc versions later than 8 are not supported!
  138 | #error -- unsupported GNU version! gcc versions later than 8 are not supported!
      |  ^~~~~
CMake Error at cuda_compile_1_generated_cuda_depth_packet_processor.cu.o.RelWithDebInfo.cmake:220 (message):
  Error generating
  /home/minimonk/src/libfreenect2/build/CMakeFiles/cuda_compile_1.dir/src/./cuda_compile_1_generated_cuda_depth_packet_processor.cu.o


CMake Error at cuda_compile_1_generated_cuda_kde_depth_packet_processor.cu.o.RelWithDebInfo.cmake:220 (message):
  Error generating
  /home/minimonk/src/libfreenect2/build/CMakeFiles/cuda_compile_1.dir/src/./cuda_compile_1_generated_cuda_kde_depth_packet_processor.cu.o


make[2]: *** [CMakeFiles/freenect2.dir/build.make:87: CMakeFiles/cuda_compile_1.dir/src/cuda_compile_1_generated_cuda_depth_packet_processor.cu.o] 오류 1
make[2]: *** 끝나지 않은 작업을 기다리고 있습니다....
make[2]: *** [CMakeFiles/freenect2.dir/build.make:94: CMakeFiles/cuda_compile_1.dir/src/cuda_compile_1_generated_cuda_kde_depth_packet_processor.cu.o] 오류 1
make[1]: *** [CMakeFiles/Makefile2:148: CMakeFiles/freenect2.dir/all] 오류 2
make: *** [Makefile:136: all] 오류 2

[링크 : https://github.com/OpenKinect/libfreenect2]

[링크 : https://www.notaboutmy.life/posts/run-kinect-2-on-ubuntu-20-lts/]

 

[링크 : https://scazlab.github.io/kinect2_setup_guide.html]

 

+

-DENABLE_CUDA=OFF

[링크 : https://github.com/OpenKinect/libfreenect2/issues/1119]

'프로그램 사용 > kinect' 카테고리의 다른 글

libfreenect2 실행 실패  (0) 2024.07.14
libfreenect2 CUDA 끄고 빌드 성공  (0) 2024.07.13
xbox one S / 기본형?  (0) 2024.06.25
kinect for windows v2 설치  (0) 2024.06.24
kinect2 도착  (0) 2024.06.20
Posted by 구차니
프로그램 사용/kinect2024. 6. 25. 11:37

Xbox One S

얘는.. PC에서 연결하는거랑 똑같네?

 

XBox One 기본형

전용 커넥터가 본체에 똭!

[링크 : https://support.xbox.com/ko-KR/help/hardware-network/kinect/kinect-sensor-not-recognized-by-console]

'프로그램 사용 > kinect' 카테고리의 다른 글

libfreenect2 CUDA 끄고 빌드 성공  (0) 2024.07.13
kinect v2 / freenect 실패  (0) 2024.07.09
kinect for windows v2 설치  (0) 2024.06.24
kinect2 도착  (0) 2024.06.20
오늘의 충동구매 kinect v2 for windows  (0) 2024.06.19
Posted by 구차니
프로그램 사용/kinect2024. 6. 24. 23:22

설치 중에는 딱히 v2 라는 이야기가 없어서 실망(?)

 

먼가.. 먼가.. 밋밋하게 끝 -_-

 

SDK v1.8 과 v2.0 이라..

 

장치 관리자에는 WDF KinectSensor interface 라고 인식된다.

 

설정 확인용 프로그램

처음에 kinect studio를 실행해도 영상이 획득이 안되길래 해봤는데

별 도움은 안되었지만.. 아무튼 USB3.0으로 정상적으로 접속되어야

Kinect Depth and Color Streams 등이 녹색으로 체크가 된다.

최소한 USB 포트가 2.0인지 3.0인지 정상적으로 연결된걸 확인했으니 도움은 된듯

 

 

 

'프로그램 사용 > kinect' 카테고리의 다른 글

kinect v2 / freenect 실패  (0) 2024.07.09
xbox one S / 기본형?  (0) 2024.06.25
kinect2 도착  (0) 2024.06.20
오늘의 충동구매 kinect v2 for windows  (0) 2024.06.19
kinect skeleton tracking  (0) 2022.05.02
Posted by 구차니
프로그램 사용/kinect2024. 6. 20. 23:22

뜯어볼 체력이 없..다 ㅠㅠ

일단 풀박스로 온 듯(!!)

 

 

체력을 끌어모아 열어보는데 무겁고 크다

어딘가의 AR/VR 개발팀에서 써보지도 않고 묵혀놓다고 방출한 듯


열면 키넥트의 상단이 똭!

 

키넥트 층(?)을 빼내면 아래쪽에

메뉴얼과 usb3.0 케이블 그리고 전용 케이블 연결을 위한 허브(?)가 위치한다.

 

메뉴얼은 먼가.. 다른 제품껏도 끌려온거 아닌가 싶은.. 두셋트

그 와중에 110V 식 2구 전원이 2개나 왔네 -_-

전원 / usb3.0 / 전원 / 어댑터(상) / 허브(하) / 메뉴얼 / 메뉴얼

 

문제(?)의 전용 커넥터.

얘는 키넥트 본체와 연결된다. 대충 보면 USB3.0 B 타입 전원형 비슷하게 생겨 먹긴했는데

그렇다고 커넥터가 같은건 또 아님.

 

키넥트 쪽은 말랑말랑 고무로 덧데어져 있긴한데 분해는 안된다.

 

KINECT for WINDOWS HUB

음.. 엑박원에 이걸로는 연결이 안되겠...지?

어댑터는 다행히 100~240V 프리볼트 모델. 빔프로젝터용 220V 2구나 꽂아서 해봐야 할 듯.

'프로그램 사용 > kinect' 카테고리의 다른 글

xbox one S / 기본형?  (0) 2024.06.25
kinect for windows v2 설치  (0) 2024.06.24
오늘의 충동구매 kinect v2 for windows  (0) 2024.06.19
kinect skeleton tracking  (0) 2022.05.02
kinect 윈도우 vs 리눅스  (0) 2022.05.02
Posted by 구차니

테스트 필요

 

현재 경로에서 서브모듈로 다른 프로젝트 추가하기

$ git submodule add https://github.com/chaconinc/DbConnector

 

서브모듈 초기화하고 받아오기 (저장소만 업데이트)

$ git submodule init
Submodule 'DbConnector' (https://github.com/chaconinc/DbConnector) registered for path 'DbConnector'
$ git submodule update

 

혹은 받아올 때 서브모듈 초기화 같이 하기(이게 편리할 듯)

$ git clone --recurse-submodules https://github.com/chaconinc/MainProject

 

서브모듈의 저장소 갱신시 최신버전을 가져오기(git pull ?)

$ git submodule update --remote

 

make 할때 git submodlue update --remote를 추가해두니 편하긴 한데

이래저래 귀찮다. -ㅁ-

 

[링크 : https://git-scm.com/book/ko/v2/Git-도구-서브모듈]

'프로그램 사용 > Version Control' 카테고리의 다른 글

git stash drop , clear  (0) 2024.09.19
git diff --staged  (0) 2022.09.05
git reset 서버 commit  (0) 2021.09.14
git blame  (0) 2021.06.21
git pull rebase 설정  (0) 2021.06.02
Posted by 구차니
프로그램 사용/kinect2024. 6. 19. 12:16

얘는 xbox one 용인가?

xbox 360 용도 있으니 웬지(?) xbox one용도 하나 가지고 싶어지는(!!) ㅋㅋ

그나저나 일본향이라 110V 코드라는데 프리볼트 어댑터면 코드만 바꾸면 되니 머.. 어떻게 되겠지?

 

괜한 욕심이려나?

(4만원에 지름 ㅋㅋ)

'프로그램 사용 > kinect' 카테고리의 다른 글

kinect for windows v2 설치  (0) 2024.06.24
kinect2 도착  (0) 2024.06.20
kinect skeleton tracking  (0) 2022.05.02
kinect 윈도우 vs 리눅스  (0) 2022.05.02
freenect on mac 실패  (0) 2022.04.28
Posted by 구차니

특이하게 설치한다고 바로 되는건 아니고

wireshark - 메뉴 - 도움말 - about - 폴더

에서 extcap 디렉토리가 없으면 생성하고

 

winpcap 설치 경로에서 USBPcapCMD.exe를 복사해 주고 wireshark를 재시작하면

C:\Program Files\USBPcap

 

아래와 같이 USBPcap1 장치가 생겨난다.

 

wireshark가 파란색이 아닌 녹색으로 뜨면서 먼가 캡쳐가 되긴 한다.

[링크 : https://desowin.org/usbpcap/tour.html]

 

usb.dst usb.src==1.4.0 이런식으로 필터링 가능하다

[링크 : https://stackoverflow.com/questions/73715190/wireshark-usb-filtering]

Posted by 구차니
프로그램 사용/nginx2024. 6. 13. 10:41

리버스프록시로 사용중에 이런 에러가 발생하면

clinet body 크기 문제로 아래와 같이 늘려주면 된다.

If you do not see this directive in nginx.conf, you can add it to the end of a server, location, or http block like so:

 
server {
...
client_max_body_size 64M;
}

 

[링크 : https://blog.hubspot.com/website/413-request-entity-too-large]

[링크 : https://blog.leocat.kr/notes/2020/04/21/nginx-413-request-entity-too-large]

Posted by 구차니