'프로그램 사용'에 해당되는 글 2263건

  1. 2022.05.04 libmodbus tcp 예제
  2. 2022.05.03 libmodbus
  3. 2022.05.03 modbus tcp 테스트 툴
  4. 2022.05.02 kinect skeleton tracking
  5. 2022.05.02 kinect 윈도우 vs 리눅스
  6. 2022.04.28 freenect on mac 실패
  7. 2022.04.27 kinect + rpi + ros = slam
  8. 2022.04.27 azure kinect
  9. 2022.04.27 kinect 360
  10. 2022.04.26 kinect for windows on ubuntu

유닛 테스트 하는 프로그램을 뜯어 보면 서비스 초기화 하는 코드를 분석하기 유리할 듯

 

[링크 : https://github.com/stephane/libmodbus/blob/master/tests/unit-test-server.c]

[링크 : https://github.com/stephane/libmodbus/blob/master/tests/unit-test-client.c]

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

modbus tcp  (0) 2022.05.04
libmodbus 예제 프로그램  (0) 2022.05.04
libmodbus  (0) 2022.05.03
modbus tcp 테스트 툴  (0) 2022.05.03
modbus tcp library  (0) 2022.04.25
Posted by 구차니

 

$ apt-cache search libmodbus
libmodbus5 - library for the Modbus protocol
libmodbus-dev - development files for the Modbus protocol library

 

libmodbus에서 기본으로 제공하는 예제인데

127.0.0.1의 1502번 포트로 접속을 해서 0번 address에 5바이트를 읽어 오도록 하는 명령이다

modbus로는 0x03(read holding register) 명령으로 5바이트 읽는 건데..

이게 modbus tcp의 master 라고 해야하나?

#include <stdio.h>
#include <modbus.h>

int main(void) {
  modbus_t *mb;
  uint16_t tab_reg[32];

  mb = modbus_new_tcp("127.0.0.1", 1502);
  modbus_connect(mb);

  /* Read 5 registers from the address 0 */
  modbus_read_registers(mb, 0, 5, tab_reg);

  modbus_close(mb);
  modbus_free(mb);
}

[링크 : https://libmodbus.org/documentation/]

[링크 : https://libmodbus.org/]

 

Client

The Modbus protocol defines different data types and functions to read and write them from/to remote devices. The following functions are used by the clients to send Modbus requests:

Server

The server is waiting for request from clients and must answer when it is concerned by the request. The libmodbus offers the following functions to handle requests:

[링크 : https://libmodbus.org/docs/v3.0.8/]

 

SYNOPSIS

int modbus_receive(modbus_t *ctx, uint8_t *req);

DESCRIPTION

The modbus_receive() function shall receive an indication request from the socket of the context ctx. This function is used by Modbus slave/server to receive and analyze indication request sent by the masters/clients.
If you need to use another socket or file descriptor than the one defined in the context ctx, see the function modbus_set_socket(3).
 

[링크 : https://libmodbus.org/docs/v3.0.8/modbus_receive.html]

 

SYNOPSIS

*int modbus_reply(modbus_t *ctx, const uint8_t *req, int req_length, modbus_mapping_t *mb_mapping);

DESCRIPTION

The modbus_reply() function shall send a response to received request. The request req given in argument is analyzed, a response is then built and sent by using the information of the modbus context ctx.
If the request indicates to read or write a value the operation will done in the modbus mapping mb_mapping according to the type of the manipulated data.
If an error occurs, an exception response will be sent.
This function is designed for Modbus server.
 

[링크 : https://libmodbus.org/docs/v3.0.8/modbus_reply.html]

 

MODBUS-TCP 통신규격에는 마스터(Client)와 슬레이브(Server)의 역할이 나누어져 있습니다. 슬레이브(Server)는 마스터(Client)가 요청하는 데이터에 대해 응답을 해줍니다. 주로 마스터(Client)에는 산업용터치 HMI 기기, 또는 PC 와 같은 상위 기기가 위치합니다. 그리고 슬레이브(Server)에는 TCPPORT 나 PLC 등이 위치합니다.
슬레이브(Server)는 상위기기에서 요청하는 동작만을 하는 수동적인 위치에 있습니다. 반면 마스터(Client)쪽에서는 원하는 데이터를 읽어오거나, 원하는 데이터를 기입하는 등 적극적으로 슬레이브(Server) 기기를 다루어 주어야 합니다.

[링크 : http://comfilewiki.co.kr/ko/doku.php?id=tcpport:modbus-tcp_프로토콜이란:index]

[링크 : https://gosuway.tistory.com/374]

 

+

int main(void)
{
  int i;
  int s = -1;
  modbus_t *ctx;
  modbus_mapping_t *mb_mapping;
  
  ctx = modbus_new_tcp("127.0.0.1", 1502);
  //    modbus_set_debug(ctx, TRUE); 
  
  mb_mapping = modbus_mapping_new(0, 0, 500, 500);
  if (mb_mapping == NULL) {
    fprintf(stderr, "Failed to allocate the mapping: %s\n",
    modbus_strerror(errno));
    modbus_free(ctx);
    return -1;
  }
  
  s = modbus_tcp_listen(ctx, 1);
  modbus_tcp_accept(ctx, &s);
  
  for (;;) {
    uint8_t query[MODBUS_TCP_MAX_ADU_LENGTH];
    int rc;
    
    rc = modbus_receive(ctx, query);
    printf("SLAVE: regs[] =\t");
    for(i = 1; i != 11; i++) { // looks like 1..n index
      printf("%d ", mb_mapping->tab_registers[i]);
    }
    printf("\n");
    
    if (rc > 0) {
      /* rc is the query size */
      modbus_reply(ctx, query, rc, mb_mapping);
    } else if (rc == -1) {
      /* Connection closed by the client or error */
      break;
    }
  }
  
  printf("Quit the loop: %s\n", modbus_strerror(errno));
  
  if (s != -1) {
    close(s);
  }
  modbus_mapping_free(mb_mapping);
  modbus_close(ctx);
  modbus_free(ctx);
  
  return 0;
}

[링크 : https://github.com/pjmaker/libmodbus-wee-example/blob/master/slave.c]

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

libmodbus 예제 프로그램  (0) 2022.05.04
libmodbus tcp 예제  (0) 2022.05.04
modbus tcp 테스트 툴  (0) 2022.05.03
modbus tcp library  (0) 2022.04.25
modbus 프로토콜  (0) 2015.09.16
Posted by 구차니

윈도우용 바이너리는 하나인데. 아마 32비트일 것 같고

linux용 바이너리는 arm/aarch64/x86/x64 용을 제공한다.

 

modbus TCP 라고해서 slave Address가 사라지는건 아닌가 보네

-m tcp        MODBUS/TCP protocol (default otherwise)
-a #          Slave address (1-255 for serial, 0-255 for TCP, 1 is default)\n
-r #          Start reference (1-65536, 1 is default)
-c #          Number of values to read (1-125, 1 is default), optional for writing (use -c 1 to force FC5 or FC6)

 

GUI는 아니지만 license가 일반적인 사용에는 완전 free 라서 유용하게 쓸 수 있을 지도 모르겠다

[링크 : https://www.modbusdriver.com/modpoll.html]

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

libmodbus 예제 프로그램  (0) 2022.05.04
libmodbus tcp 예제  (0) 2022.05.04
libmodbus  (0) 2022.05.03
modbus tcp library  (0) 2022.04.25
modbus 프로토콜  (0) 2015.09.16
Posted by 구차니

이래서 키넥트 게임이 인식이 구렸던 건가 -_-

뒤에 배경이 깔금하지 않고 거리가 많이 떨어지지 않은 것도 있긴 하지만

아무것도 없는 옷이나 배경에 사람으로 인식해버리니..

약 10년 전 기술이라 대단하면서도 어쩔수 없는 건가..

 

libfreenect는 저수준 드라이버라 고수준 드라이버 기능인 뼈대 추적 기능을 지원하지 않는 듯? 

Does libfreenect have any skeleton tracking feature?

  • Skeleton tracking is higher-level than drivers and libfreenect is basically a low-level driver within OpenKinect. The raw data is made available and a skeleton-tracking solution that takes data from libfreenect can be built. The project Roadmap calls for further developments as the focus should change at some point from low-level driver and API to higher level abstractions

[링크 : https://openkinect.org/wiki/FAQ#Does_libfreenect_have_any_skeleton_tracking_feature.3F]

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

kinect2 도착  (0) 2024.06.20
오늘의 충동구매 kinect v2 for windows  (0) 2024.06.19
kinect 윈도우 vs 리눅스  (0) 2022.05.02
freenect on mac 실패  (0) 2022.04.28
kinect + rpi + ros = slam  (0) 2022.04.27
Posted by 구차니

freenect 예제가 kinect SDK의 예제보다 입체정확도가 많이 떨어진다.

그게 드라이버의 데이터 파싱 능력의 차이인지

아니면 예제 프로그램의 처리 차이인진 모르겠지만 말이다.

 

그리고 kinect 시점으로는 libfreenect 쪽의 화면이 정상적인 것으로 보이고

윈도우 쪽은 좌우가 반전된 것으로 보인다. 무슨 옵션이 있으려나?

 

 

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

오늘의 충동구매 kinect v2 for windows  (0) 2024.06.19
kinect skeleton tracking  (0) 2022.05.02
freenect on mac 실패  (0) 2022.04.28
kinect + rpi + ros = slam  (0) 2022.04.27
azure kinect  (0) 2022.04.27
Posted by 구차니
프로그램 사용/kinect2022. 4. 28. 00:04

 

 

% brew install libfreenect
% ls -al /usr/local/Cellar/libfreenect/0.6.2/bin
total 1584
drwxr-xr-x  16 shin  admin    512  4 27 23:46 .
drwxr-xr-x   9 shin  admin    288  4 27 23:46 ..
-r-xr-xr-x   1 shin  admin   1897  4 27 23:46 fakenect
-r-xr-xr-x   1 shin  admin  76648  4 27 23:46 fakenect-record
-r-xr-xr-x   1 shin  admin  51080  4 27 23:46 freenect-camtest
-r-xr-xr-x   1 shin  admin  54768  4 27 23:46 freenect-chunkview
-r-xr-xr-x   1 shin  admin  87616  4 27 23:46 freenect-cpp_pcview
-r-xr-xr-x   1 shin  admin  88056  4 27 23:46 freenect-cppview
-r-xr-xr-x   1 shin  admin  52872  4 27 23:46 freenect-glpclview
-r-xr-xr-x   1 shin  admin  56312  4 27 23:46 freenect-glvi
-r-xr-xr-x   1 shin  admin  55672  4 27 23:46 freenect-hiview
-r-xr-xr-x   1 shin  admin  53152  4 27 23:46 freenect-micview
-r-xr-xr-x   1 shin  admin  50024  4 27 23:46 freenect-regtest
-r-xr-xr-x   1 shin  admin  55232  4 27 23:46 freenect-regview
-r-xr-xr-x   1 shin  admin  50064  4 27 23:46 freenect-tiltdemo
-r-xr-xr-x   1 shin  admin  50728  4 27 23:46 freenect-wavrecord

 

% ./freenect-glview 
Kinect camera test
Number of devices found: 1
Found sibling device [same parent]
Unable to claim interface LIBUSB_ERROR_NOT_FOUND
Found sibling device [same parent]
Trying to open ./audios.bin as firmware...
Trying to open /Users/shin/.libfreenect/audios.bin as firmware...
Trying to open /usr/local/share/libfreenect/audios.bin as firmware...
Trying to open /usr/share/libfreenect/audios.bin as firmware...
Trying to open ./../Resources/audios.bin as firmware...
upload_firmware: failed to find firmware file.
upload_firmware failed: -2
Could not open device

% ./freenect-glpclview
Unable to claim interface LIBUSB_ERROR_OTHER
Could not claim interface: LIBUSB_ERROR_OTHER
Error: Invalid index [0]
Error: Kinect not connected?


% ./freenect-camtest
Found sibling device [same parent]
Unable to claim interface LIBUSB_ERROR_NO_DEVICE
[Stream 70] Negotiated packet size 1920
write_register: 0x0105 <= 0x00
write_register: 0x0006 <= 0x00
write_register: 0x0012 <= 0x03
write_register: 0x0013 <= 0x01
write_register: 0x0014 <= 0x1e
write_register: 0x0006 <= 0x02
write_register: 0x0017 <= 0x00
[Stream 80] Negotiated packet size 1920
write_register: 0x000c <= 0x00
write_register: 0x000d <= 0x01
write_register: 0x000e <= 0x1e
write_register: 0x0005 <= 0x01
[Stream 70] Lost 185 total packets in 0 frames (inf lppf)
[Stream 70] Lost 192 total packets in 0 frames (inf lppf)
Received depth frame at 116502869
Received depth frame at 118505024
Received depth frame at 120507179
Received depth frame at 122509334
[Stream 70] Invalid magic ffff
[Stream 70] Lost 1 packets
[Stream 70] Lost 193 total packets in 4 frames (48.250000 lppf)
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Lost 7 packets
[Stream 70] Lost 200 total packets in 4 frames (50.000000 lppf)
[Stream 70] Lost too many packets, resyncing...
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Lost 2 packets
[Stream 70] Lost 202 total packets in 4 frames (50.500000 lppf)
[Stream 70] Lost 3 packets
[Stream 70] Lost 205 total packets in 4 frames (51.250000 lppf)
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Lost 6 packets
[Stream 70] Lost 211 total packets in 4 frames (52.750000 lppf)
[Stream 70] Lost too many packets, resyncing...
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Lost 4 packets
[Stream 70] Lost 215 total packets in 4 frames (53.750000 lppf)
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Lost 6 packets
[Stream 70] Lost 221 total packets in 4 frames (55.250000 lppf)
[Stream 70] Lost too many packets, resyncing...
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Expected 1748 data bytes, but got 948
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Lost 11 packets
[Stream 70] Lost 232 total packets in 4 frames (58.000000 lppf)
[Stream 70] Lost too many packets, resyncing...
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
Received depth frame at 132520109
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Lost 7 packets
[Stream 70] Lost 239 total packets in 5 frames (47.799999 lppf)
[Stream 70] Lost too many packets, resyncing...
Received depth frame at 136524419
Received depth frame at 138526574
[Stream 70] Invalid magic ffff
[Stream 70] Invalid magic ffff
[Stream 70] Lost 2 packets
[Stream 70] Lost 241 total packets in 7 frames (34.428570 lppf)
[Stream 70] Lost 3 packets
[Stream 70] Lost 244 total packets in 7 frames (34.857143 lppf)
[Stream 70] Inconsistent flag 75 with 239 packets in buf (242 total), resyncing...
write_register: 0x0047 <= 0x00
Received depth frame at 142530884
Received depth frame at 144533039
Received depth frame at 146535194
Received depth frame at 148537349
Received video frame at 150126226
Received depth frame at 150539504
Received video frame at 152123806
Received depth frame at 152541659
Received video frame at 154121386
Received depth frame at 154543814
Received video frame at 156118966
Received depth frame at 156545969
Received video frame at 158116546
Received depth frame at 158548124
Received video frame at 160114126
Received depth frame at 160550279
Received video frame at 162111706
Received depth frame at 162552434
Received video frame at 164109286
Received depth frame at 164554589
Received video frame at 166106866
Received depth frame at 166556744
Received video frame at 168104446
Received depth frame at 168558899
Received video frame at 170102026
Received depth frame at 170561054
Received video frame at 172099606
Received depth frame at 172563209
Received video frame at 174097186
Received depth frame at 174565364
Received video frame at 176094766
Received depth frame at 176567519
Received video frame at 178092346
Received depth frame at 178569674
Received video frame at 180089926
Received depth frame at 180571829
Received video frame at 182087506
Received depth frame at 182573984
Received video frame at 184085086
Received depth frame at 184576139
Received video frame at 186082666
Received depth frame at 186578294
Received video frame at 188080246
Received depth frame at 188580449
Received video frame at 190077826
Received depth frame at 190582604
Received video frame at 192075406
Received depth frame at 192584759
Received video frame at 194072986
Received depth frame at 194586914
Received video frame at 196070566
Received depth frame at 196589069
Received video frame at 198068146
Received depth frame at 198591224
Received video frame at 200065726
Received depth frame at 200593379
Received video frame at 202063306
Received depth frame at 202595534
Received video frame at 204060886
Received depth frame at 204597689
Received video frame at 206058466

[링크 : http://developkinect.com/resource/mac-os-x/install-libfreenect-drivers-mac-os-x]

[링크 : https://m.blog.naver.com/thevolcano/100118562350]

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

kinect skeleton tracking  (0) 2022.05.02
kinect 윈도우 vs 리눅스  (0) 2022.05.02
kinect + rpi + ros = slam  (0) 2022.04.27
azure kinect  (0) 2022.04.27
kinect 360  (0) 2022.04.27
Posted by 구차니
프로그램 사용/kinect2022. 4. 27. 14:35

라즈베리에서 성능이 얼마나 나오나 궁금해서 보는데 엉뚱한게 걸려나옴 ㅋ

 

[링크 : https://www.hackster.io/dmitrywat/rgb-d-slam-with-kinect-on-raspberry-pi-4-ros-melodic-ace795]

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

kinect 윈도우 vs 리눅스  (0) 2022.05.02
freenect on mac 실패  (0) 2022.04.28
azure kinect  (0) 2022.04.27
kinect 360  (0) 2022.04.27
kinect for windows on ubuntu  (0) 2022.04.26
Posted by 구차니
프로그램 사용/kinect2022. 4. 27. 12:38

여러개 사용가능한 키넥트가 있다고 하는데 그게 이녀석인 듯?

 

[링크 : https://docs.microsoft.com/ko-kr/azure/kinect-dk/multi-camera-sync]

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

freenect on mac 실패  (0) 2022.04.28
kinect + rpi + ros = slam  (0) 2022.04.27
kinect 360  (0) 2022.04.27
kinect for windows on ubuntu  (0) 2022.04.26
kinect for window 도착 그리고 윈도우10에서 시도  (0) 2022.04.26
Posted by 구차니
프로그램 사용/kinect2022. 4. 27. 00:10

맨날 키즈카페에 보다보니, 저 머리만 봤지 뒤에 어댑터가 있을줄은 상상도 못했네..

 

약간은.. 이빨 갯수가 많이 부족한 DP 느낌인데..

 

워후! 12V 1.08A -_-

 

34.99 달러나 받던 사악한 녀석이군.

[링크 : https://spacechild.net/129]

 

2A 사양도 넘고.. 은근히 전원을 많이 먹네

포터블 용으로 개조하기에는 무리인가. 그리고 커넥터도 전용이기도 하고 이래저래 귀찮네

 it's no surprise that its power demand (12 watts) is so much greater than what a standard USB port can offer (5 watts)

[링크 : https://www.engadget.com/2010-11-04-kinect-teardown-two-cameras-four-microphones-12-watts-of-powe.html]

 

+

오디오 컨트롤러와 가속도센서가 같이 달려있구나..

[링크 : https://medium.com/robotics-weekends/how-to-turn-old-kinect-into-a-compact-usb-powered-rgbd-sensor-f23d58e10eb0]

 

에잇 드러운 독점 커넥터 -_-

[링크 : https://electronics.stackexchange.com/questions/21939/proprietary-kinect-connector]

[링크 : https://www.pngwing.com/en/free-png-zcovf]

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

kinect + rpi + ros = slam  (0) 2022.04.27
azure kinect  (0) 2022.04.27
kinect for windows on ubuntu  (0) 2022.04.26
kinect for window 도착 그리고 윈도우10에서 시도  (0) 2022.04.26
freenect  (0) 2022.04.23
Posted by 구차니
프로그램 사용/kinect2022. 4. 26. 23:50

우분투에서 kinect for windows를 연결해보니 주렁주렁 연결된다.

$ lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/3p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M
        |__ Port 2: Dev 4, If 0, Class=Hub, Driver=hub/2p, 480M
            |__ Port 1: Dev 5, If 0, Class=Vendor Specific Class, Driver=, 480M
            |__ Port 2: Dev 6, If 0, Class=Vendor Specific Class, Driver=kinect, 480M
        |__ Port 4: Dev 3, If 1, Class=Video, Driver=uvcvideo, 480M
        |__ Port 4: Dev 3, If 0, Class=Video, Driver=uvcvideo, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/3p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M

 

dmesg는 아래와 같이 오디오와 카메라만 뜬다.

$ dmesg
[   66.521305] usb 2-1.2: new high-speed USB device number 4 using ehci-pci
[   66.629876] usb 2-1.2: New USB device found, idVendor=045e, idProduct=02c2, bcdDevice= 0.01
[   66.629884] usb 2-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[   66.630696] hub 2-1.2:1.0: USB hub found
[   66.630913] hub 2-1.2:1.0: 2 ports detected
[   67.752503] usb 2-1.2.1: new high-speed USB device number 5 using ehci-pci
[   67.863100] usb 2-1.2.1: New USB device found, idVendor=045e, idProduct=02be, bcdDevice= 1.00
[   67.863109] usb 2-1.2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   67.863113] usb 2-1.2.1: Product: Microsoft Kinect Audio, © 2011 Microsoft Corporation. All rights reserved.
[   67.863117] usb 2-1.2.1: Manufacturer: Microsoft
[   67.863120] usb 2-1.2.1: SerialNumber: A22597V00343314A
[   70.833403] usb 2-1.2.2: new high-speed USB device number 6 using ehci-pci
[   70.948864] usb 2-1.2.2: New USB device found, idVendor=045e, idProduct=02bf, bcdDevice= 2.05
[   70.948868] usb 2-1.2.2: New USB device strings: Mfr=2, Product=1, SerialNumber=3
[   70.948870] usb 2-1.2.2: Product: Microsoft Kinect Camera
[   70.948871] usb 2-1.2.2: Manufacturer: Microsoft
[   70.948873] usb 2-1.2.2: SerialNumber: 0000000000000000
[   70.969452] gspca_main: v2.14.0 registered
[   70.971380] gspca_main: kinect-2.14.0 probing 045e:02bf
[   70.971637] usbcore: registered new interface driver kinect

 

freenect 라는 키워드를 본적이 있으니 한번 설치하고 프로그램 실행!

$ apt-cache search freenect
freenect - library for accessing Kinect device -- metapackage
libfreenect-bin - library for accessing Kinect device -- utilities and samples
libfreenect-demos - library for accessing Kinect device -- dummy package
libfreenect-dev - library for accessing Kinect device -- development files
libfreenect-doc - library for accessing Kinect device -- documentation
libfreenect0.5 - library for accessing Kinect device
python-freenect - library for accessing Kinect device -- Python bindings

$ sudo apt-get install freenect
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다       
상태 정보를 읽는 중입니다... 완료
다음 패키지가 자동으로 설치되었지만 더 이상 필요하지 않습니다:
  linux-hwe-5.4-headers-5.4.0-105
Use 'sudo apt autoremove' to remove it.
다음의 추가 패키지가 설치될 것입니다 :
  libfreenect-bin libfreenect-dev libfreenect-doc libfreenect0.5
다음 새 패키지를 설치할 것입니다:
  freenect libfreenect-bin libfreenect-dev libfreenect-doc libfreenect0.5
0개 업그레이드, 5개 새로 설치, 0개 제거 및 4개 업그레이드 안 함.
249 k바이트 아카이브를 받아야 합니다.
이 작업 후 1,386 k바이트의 디스크 공간을 더 사용하게 됩니다.
계속 하시겠습니까? [Y/n] 

 

feenect-glpcview가 윈도우용 키넥트 sdk의 기본 어플과 그나마 유사하게 나온다.

권한이 부족한지 장치를 열 수 없다고 배째니 root 권한으로 실행해야 한다.

$ free
free                 freenect-cpp_pcview  freenect-glview      freenect-regtest     freenect-wavrecord   
freenect-camtest     freenect-cppview     freenect-hiview      freenect-regview     freetype-config      
freenect-chunkview   freenect-glpclview   freenect-micview     freenect-tiltdemo    

$ freenect-camtest 
Could not open camera: -3
Failed to open camera subdevice or it is not disabled.Failed to open motor subddevice or it is not disabled.Failed to open audio subdevice or it is not disabled.

$ sudo freenect-glview 
Kinect camera test
Number of devices found: 1
Could not open audio: -4
GL thread
[Stream 70] Negotiated packet size 1920
write_register: 0x0105 <= 0x00
write_register: 0x0006 <= 0x00
write_register: 0x0012 <= 0x03
write_register: 0x0013 <= 0x01
write_register: 0x0014 <= 0x1e
write_register: 0x0006 <= 0x02
write_register: 0x0017 <= 0x00
[Stream 80] Negotiated packet size 1920
write_register: 0x000c <= 0x00
write_register: 0x000d <= 0x01
write_register: 0x000e <= 0x1e
write_register: 0x0005 <= 0x01
write_register: 0x0047 <= 0x00
'w' - tilt up, 's' - level, 'x' - tilt down, '0'-'6' - select LED mode, '+' & '-' - change IR intensity 
'f' - change video format, 'm' - mirror video, 'o' - rotate video with accelerometer 
'e' - auto exposure, 'b' - white balance, 'r' - raw color, 'n' - near mode (K4W only) 
 raw acceleration:    0    0    0  mks acceleration: 0.000000 0.000000 0.000000 



$ sudo freenect-glpclview 
Could not open audio: -1
[Stream 70] Expected 1748 data bytes, but got 948


 

freenect로 접속을 하면 새로운 장치로 인식되고 종료하면 장치가 제거되는 것 처럼 보이네

$ dmesg
[  214.203283] usb 2-1.2: new high-speed USB device number 7 using ehci-pci
[  214.323880] usb 2-1.2: New USB device found, idVendor=045e, idProduct=02c2, bcdDevice= 0.01
[  214.323887] usb 2-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[  214.324627] hub 2-1.2:1.0: USB hub found
[  214.324732] hub 2-1.2:1.0: 2 ports detected
[  215.447259] usb 2-1.2.1: new high-speed USB device number 8 using ehci-pci
[  215.558332] usb 2-1.2.1: New USB device found, idVendor=045e, idProduct=02be, bcdDevice= 1.00
[  215.558340] usb 2-1.2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  215.558344] usb 2-1.2.1: Product: Microsoft Kinect Audio, © 2011 Microsoft Corporation. All rights reserved.
[  215.558348] usb 2-1.2.1: Manufacturer: Microsoft
[  215.558351] usb 2-1.2.1: SerialNumber: A22597V00343314A
[  218.375074] usb 2-1.2.2: new high-speed USB device number 9 using ehci-pci
[  218.495073] usb 2-1.2.2: New USB device found, idVendor=045e, idProduct=02bf, bcdDevice= 2.05
[  218.495079] usb 2-1.2.2: New USB device strings: Mfr=2, Product=1, SerialNumber=3
[  218.495082] usb 2-1.2.2: Product: Microsoft Kinect Camera
[  218.495084] usb 2-1.2.2: Manufacturer: Microsoft
[  218.495087] usb 2-1.2.2: SerialNumber: 0000000000000000
[  218.495827] gspca_main: kinect-2.14.0 probing 045e:02bf

[  243.488046] usb 2-1.2: USB disconnect, device number 7
[  243.488054] usb 2-1.2.1: USB disconnect, device number 8
[  243.488658] usb 2-1.2.2: USB disconnect, device number 9

 

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

kinect + rpi + ros = slam  (0) 2022.04.27
azure kinect  (0) 2022.04.27
kinect 360  (0) 2022.04.27
kinect for window 도착 그리고 윈도우10에서 시도  (0) 2022.04.26
freenect  (0) 2022.04.23
Posted by 구차니