Programming/android2012. 2. 4. 21:36
eclipse에서 ADT plugin을 설치 하려는데 요런 에러가 발생 -_- 


Cannot complete the install because one or more required items could not be found.
  Software being installed: Android Traceview 16.0.1.v201112150204-238534 (com.android.ide.eclipse.traceview.feature.group 16.0.1.v201112150204-238534)
  Missing requirement: Android Traceview 16.0.1.v201112150204-238534 (com.android.ide.eclipse.traceview.feature.group 16.0.1.v201112150204-238534) requires 'org.eclipse.ui 3.6.2' but it could not be found 

 검색을 해보니 우분투에서는 갈릴레오 버전이고
현재 eclipse.org에서 받을수 있는 건 인디고 버전이다.
즉, 갈릴레오 버전이 낮아서 버전을 업해야지 가능하다는 이야기

[링크 : http://forjustin.egloos.com/1070695]
2010/08/25 - [Programming/android] - 좌충우돌 안드로이드 개발환경 설치하기 - 캡쳐하나 때문에 이 고생이라니! 
Posted by 구차니
Programming/openCV2012. 2. 4. 21:19
2012년 2월 에 포함된 녀석은 opencv 2.0 버전 같은데
별도로 opencvlibrary에서 받는게 나으려나?
[링크 : http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.3.1/]

$ apt-cache search opencv
libcv-dev - development files for libcv
libcv4 - computer vision library
libcvaux-dev - development files for libcvaux
libcvaux4 - computer vision extension library
libhighgui-dev - development files for libhighgui
libhighgui4 - computer vision GUI library
opencv-doc - OpenCV documentation and examples
python-opencv - Python bindings for the computer vision library
harpia - Image Processing/Computer Vision Automatic Prgm. Tool 


[링크 : http://jaehwacho.springnote.com/pages/5657783]

'Programming > openCV' 카테고리의 다른 글

Cmake로 openCV 컴파일 설정 및 설치하기  (0) 2012.02.12
ubuntu opencv 패키지 버전 정보  (0) 2012.02.12
우분투에서 openCV 카메라 영상받기 예제  (0) 2012.02.04
openCV  (0) 2012.02.04
openCV OCR 예제  (0) 2011.07.17
Posted by 구차니
Linux API/usb2012. 2. 4. 18:24
심심(?)해서 USB 조이스틱 2개를 연결해서 본 목록

$ cat /proc/bus/usb/devices 
$ cat /sys/kernel/debug/usb/devices
에는 토폴로지 별로 상세하게 출력되고 

lsusb를 통해서도 볼수는 있는데
$ lsusb -d 12bd:a02f -v 식으로 하나의 장치만을 자세히 볼수도 있다.
$ lsusb
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 005: ID 0583:206f Padix Co., Ltd (Rockfire) 
Bus 003 Device 004: ID 12bd:a02f  
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


$ tree -a /dev/bus
/dev/bus
`-- usb
    |-- 001
    |   `-- 001
    |-- 002
    |   `-- 001
    |-- 003
    |   |-- 001
    |   |-- 004
    |   `-- 005
    |-- 004
    |   `-- 001
    `-- 005
        `-- 001

6 directories, 7 files 


















 
$ tree -a /proc/bus
/proc/bus
|-- input
|   |-- devices
|   `-- handlers
|-- pccard
|   `-- drivers
`-- pci
    |-- 00
    |   |-- 00.0
    |   |-- 02.0
    |   |-- 02.1
    |   |-- 1b.0
    |   |-- 1c.0
    |   |-- 1c.2
    |   |-- 1d.0
    |   |-- 1d.1
    |   |-- 1d.2
    |   |-- 1d.3
    |   |-- 1d.7
    |   |-- 1e.0
    |   |-- 1f.0
    |   |-- 1f.1
    |   |-- 1f.2
    |   `-- 1f.3
    |-- 02
    |   `-- 00.0
    |-- 06
    |   |-- 00.0
    |   |-- 00.2
    |   |-- 00.3
    |   |-- 00.4
    |   `-- 02.0
    `-- devices

6 directories, 26 files 
$ tree -a /sys/kernel/debug/usb/
/sys/kernel/debug/usb/
|-- devices
`-- usbmon
    |-- 0s
    |-- 0u
    |-- 1s
    |-- 1t
    |-- 1u
    |-- 2s
    |-- 2t
    |-- 2u
    |-- 3s
    |-- 3t
    |-- 3u
    |-- 4s
    |-- 4t
    |-- 4u
    |-- 5s
    |-- 5t
    `-- 5u

1 directory, 18 files 












 

$ tree -a /dev/input
/dev/input
|-- by-id
|   |-- usb-0583_USB_2-axis_8-button_gamepad-event-joystick -> ../event10
|   |-- usb-0583_USB_2-axis_8-button_gamepad-joystick -> ../js1
|   |-- usb-12bd_5-Axis_12-Button_with_POV-event-joystick -> ../event6
|   `-- usb-12bd_5-Axis_12-Button_with_POV-joystick -> ../js0
|-- by-path
|   |-- pci-0000:00:1d.1-usb-0:1:1.0-event-joystick -> ../event6
|   |-- pci-0000:00:1d.1-usb-0:1:1.0-joystick -> ../js0
|   |-- pci-0000:00:1d.1-usb-0:2:1.0-event-joystick -> ../event10
|   |-- pci-0000:00:1d.1-usb-0:2:1.0-joystick -> ../js1
|   |-- platform-i8042-serio-0-event-kbd -> ../event5
|   |-- platform-i8042-serio-2-event-mouse -> ../event8
|   `-- platform-i8042-serio-2-mouse -> ../mouse1
|-- event0
|-- event1
|-- event10
|-- event2
|-- event3
|-- event4
|-- event5
|-- event6
|-- event7
|-- event8
|-- event9
|-- js0
|-- js1
|-- mice
|-- mouse0
`-- mouse1

2 directories, 27 files 

아무튼, 개략적으로 USB 연결시 확인해야 할 경로는 위에 녀석들 뿐이려나?

[링크 : http://docs.blackfin.uclinux.org/kernel/generated/usb/index.html] << USB API
[링크 : http://www.linux-usb.org/USB-guide/book1.html]
Posted by 구차니
Programming/openCV2012. 2. 4. 14:54
CV는 Computer Vision이라 하여 컴퓨터를 통해 영상인식을 하는 학문이고
openCV는 이녀석을 손쉽게 사용할 수 있도록 개발된 라이브러리의 모음이다.

심심해서 받아보니
OpenCV-2.3.1-win-superpack.exe 127MB 짜리가 압축을 풀어서 1.2GB 정도를 차지한다 -_-
많이 업그레이드 되어서 안드로이드 / mac / win / python / gpu 등을 지원한다.
아무튼 openCV / openCL 의 합작은 꽤나 고무적인 방향인데 언제 공부하나 ㅠ.ㅠ


[링크 : http://sourceforge.net/projects/opencvlibrary/ ] << library download
[링크 : http://opencv.willowgarage.com/wiki/ ] << openCV 공식
[링크 : http://letzrock.tistory.com/199 ]  
Posted by 구차니
Linux API/joystick2012. 2. 4. 14:37
CCTV(PTZ) 업체에 있다 보니 리눅스에서도 조이스틱을 이용해서
컨트롤러를 대체할수 있을까 라는 생각에 조이스틱 관련 API를 찾아보는데
의외로 단순한 구조 같은 느낌..

요즘에는 USB로도 많이 쓰니 USB목록에서 장치명을 찾아서 열거하는 것도 필요할 듯 하고
아무튼 중요한건 js_event 구조체 이녀석인듯.
int fd = open ("/dev/js0", O_RDONLY);
struct js_event e;
read (fd, &e, sizeof(struct js_event));

struct js_event {
__u32 time;     /* event timestamp in milliseconds */
__s16 value;    /* value */
__u8 type;      /* event type */
__u8 number;    /* axis/button number */
}; 

[링크 : http://www.mjmwired.net/kernel/Documentation/input/joystick-api.txt] 3.2 kernel
[링크 :  http://archives.seul.org/linuxgames/Aug-1999/msg00107.html] 2.2 kernel

----
curse.h가 없다고 에러날 경우는 아래와 같이 설치해주고
$ sudo apt-get install libncurses5-dev  

소스는 이런식으로 수정하고 컴파일을 하면된다.
#define JOY_DEV "/dev/input/js0"  

#include "pthread.h"
#include "sys/timeb.h"
#include "curses.h"
#include "fcntl.h"
#include "linux/joystick.h"

#define NUM_THREADS	3
#define JOY_DEV		"/dev/input/js0"
#define HZ				12

const char FILENAME[] = "./joystickLog.out";
char axisDesc[15][5] = {"X", "Y", "Z", "R", "A", "B", "C", "D", "E", "F", "G", "H", "I" };
char numAxis[20], numButtons[20], value[20][20], timeSec[20], timeMilli[20];
int num_of_axis;

void write_to_log(){
	sleep(1);
	int cnt;
	FILE * daFile;
	daFile = fopen(FILENAME, "w+");

//	WRITE A HEADER ON THE OUPUT FILE
	fprintf(daFile, "#,");
	for(cnt = 0; cnt < num_of_axis; cnt++)
		if(cnt < num_of_axis -1)	fprintf(daFile, "%s,", axisDesc[cnt]);
		else								fprintf(daFile, "%s", axisDesc[cnt]);
	fprintf(daFile, "\r\n");

	while(1){
		fprintf(daFile, "%s.%s, ", timeSec, timeMilli);
		for(cnt = 0; cnt < num_of_axis; cnt++){
			if(cnt < num_of_axis -1)	fprintf(daFile, "%s, ", value[cnt]);
			else								fprintf(daFile, "%s ", value[cnt]);
		}
		fprintf(daFile, "\r\n");
		usleep(83333);
	}
	
	fprintf(daFile, "%s.%s Len = %d ", timeSec, timeMilli,strlen(timeMilli));

	fprintf(daFile, "\r\n");
	fflush(daFile);
}

void write_to_screen(){
	struct timeb seconds;
	int cnt, joy_fd, *axis=NULL, num_of_buttons=0, x;
	char *button=NULL, name_of_joystick[80];
	struct js_event js;
	time_t theTime;

	wmove(stdscr, 8, 0);
	addstr("Type \"q\" to quit.\n");

	if( ( joy_fd = open( JOY_DEV , O_RDONLY)) == -1 ){
		wmove(stdscr, 3,0);
		addstr( "Couldn't open joystick " );
		addstr( JOY_DEV );
		wmove(stdscr, 10,0);
		while(1)usleep(16666);
	}

	ioctl( joy_fd, JSIOCGAXES, &num_of_axis );				//	GET THE NUMBER OF AXIS ON JS
	ioctl( joy_fd, JSIOCGBUTTONS, &num_of_buttons );		//	GET THE NUMBER OF BUTTONS ON THE JS
	ioctl( joy_fd, JSIOCGNAME(80), &name_of_joystick );	//	GET THE NAME OF THE JS

	axis = (int *) calloc( num_of_axis, sizeof( int ) );
	button = (char *) calloc( num_of_buttons, sizeof( char ) );

	sprintf(numAxis, "%d", num_of_axis);
	sprintf(numButtons, "%d", num_of_buttons);

	wmove(stdscr, 0,0);
	addstr("Joystick detected: ");

	wmove(stdscr, 0, 19);
	addstr(name_of_joystick);

	wmove(stdscr, 1, 0);
	addstr("Number of axis   :");

	wmove(stdscr, 1, 19);
	addstr(numAxis);
	
	wmove(stdscr, 2, 0);
	addstr("Number of buttons:");

	wmove (stdscr, 2, 19);
	addstr(numButtons);

//	CHANGE THE STATUS FLAG OF THE FILE DESCRIPTOR TO NON-BLOCKING MODE
	fcntl( joy_fd, F_SETFL, O_NONBLOCK );   

	while( 1 ){
		usleep(16666);
	
	//	READ THE JOYSTICK STATE, IT WILL BE RETURNED IN THE JS_EVENT STRUCT
		read(joy_fd, &js, sizeof(struct js_event));

	//	GET THE NUMBER OF SECONDS SINCE EPOCH
		ftime(&seconds);
		theTime = time(NULL);
		sprintf(timeSec, "%d", seconds.time);						
		sprintf(timeMilli, "%d", seconds.millitm);
               
	//	CHECK THE EVENT
		switch (js.type & ~JS_EVENT_INIT){
			case JS_EVENT_AXIS:
				axis   [ js.number ] = js.value;
				break;
			case JS_EVENT_BUTTON:
				button [ js.number ] = js.value;
				break;
		}
		//	ADD LEADING 0'S TO THE MILLISECOND STRING (IF NECESSARY)
			char temp[10] = "";
			while(strlen(temp) < (3 - strlen(timeMilli)))
				strcat(temp, "0");
			strcat(temp,timeMilli);
			strcpy(timeMilli, temp);

		//	PRINT THE RESULTS
			wmove(stdscr, 4, 0);
			for(cnt = 0; cnt < num_of_axis; cnt++)
				addstr("            ");
			for(cnt = 0; cnt < num_of_axis && cnt < 13; cnt++){
				sprintf(value[cnt], "%d", axis[cnt]);
				wmove(stdscr, 4, cnt * 10);
				addstr(axisDesc[cnt]);
				addstr(": ");
				wmove(stdscr, 4, (cnt * 10) + 2);
				addstr(value[cnt]);
			}
			
			wmove(stdscr, 6, 0);
			addstr(timeSec);
			wmove(stdscr, 6,10);
			addstr(".");
			wmove(stdscr, 6, 11);
			addstr(timeMilli);
			wmove(stdscr, 6, 15);
			addstr("=");
			wmove(stdscr, 6, 17);
			addstr(ctime(&theTime));
                       
			wmove(stdscr, 10, 0);
			refresh();
	}
}

void *ThreadProcs(void *threadid){
	int thread_id = (int)threadid;
	
	if(thread_id == 0){
		write_to_screen();
	}
	
	if(thread_id == 1){
	//	THIS THREAD WILL MAKE THE PROGRAM EXIT
		int ch;
		nodelay(stdscr, TRUE);				//	SETUP NON BLOCKING INPUT
		while(1) {
			if ((ch = getch()) == ERR) usleep(16666);		//	USER HASN'T RESPONDED
			else if( ch == 'q'){			
				endwin();
				exit(0);			//	QUIT ALL THREADS
			}
		}
	}
	if(thread_id == 2){
		write_to_log();
	}
}

int main(int argc, char *argv[]){
	initscr(); 									//	INIT THE SCREEN FOR CURSES
	pthread_t threads[NUM_THREADS];
	int rc, t;
	for(t = 0; t < NUM_THREADS; t++){	//	MAKE 2 NEW THREADS
		rc = pthread_create(&threads[t], NULL, ThreadProcs, (void *)t);
		if (rc){
			printf("ERROR; return code from pthread_create() is %d\n", rc);
			exit(-1);pthread_exit(NULL);
		}
	}
	
	for(t = 0; t < NUM_THREADS; t++)
		pthread_join(threads[t], NULL);		//	WAIT FOR THREADS TO EXIT OR IT WILL RACE TO HERE.

	endwin();
	return 0;
}


[링크 : http://www.linuxquestions.org/questions/programming-9/joystick-347292/]
 + [링크 : http://sukwoo.blogspot.com/2008/07/ubuntu-804-ncurses.html]
---
[링크 : http://msdn.microsoft.com/en-us/library/windows/desktop/dd743596(v=vs.85).aspx] << 윈도우용

'Linux API > joystick' 카테고리의 다른 글

linux force feedback  (0) 2022.06.15
linux/joystick.h 파일  (0) 2012.02.05
Posted by 구차니
개소리 왈왈2012. 2. 3. 23:10
애 보는게 쉽지는 않구나 ㅠ.ㅠ
귀에다 대고 앵앵 울어대니 급격히 체력 감소 ㅠ.ㅠ 
Posted by 구차니
차이는 없다


reason 21 에서 31로 바뀐거 외에는 에러 메시지도 동일하다 -ㅁ-

2011/09/25 - [하드웨어/Server Case/board] - NMI on Linux
Posted by 구차니
42 + 34 + 17 = 93
33 + 32 + 15 = 80

제목은 페이스 북을 찬양하다 시피하는데
통계값은 쇄락하는 느낌인디...


[링크 :  http://media.daum.net/digital/view.html?cateid=1077&newsid=20120202203321758&p=mk]


으엇? 다시 보니 절대 값이 아니라 퍼센트군! OTL 

'개소리 왈왈 > 블로그' 카테고리의 다른 글

요즘 스팸댓글이 왜케 많이 달려?  (0) 2012.03.30
블로그 에디터 카테고리를 돌려줘!!!  (0) 2012.03.27
우비 woobi.co.kr  (2) 2012.01.26
왈도체 댓글?  (0) 2011.12.15
내 블로그 사고친거 있나?  (0) 2011.11.29
Posted by 구차니
NMI는 일종의 진단 / 디버깅용도로 사용되는 녀석인데
완전히 뻗어버려서 디버깅에 응답이 없을때 크래시 덤프를 빼낼수 있도록 하는 용도라고 한다.

NMI Crash Dump overview 
Non-Maskable Interrupt (NMI) Crash Dump is a diagnostic mechanism. It allows for crash dump files 
to be created in situations when a system is hung and not able to respond to traditional debug 
mechanisms.

[링크 : http://h20000.www2.hp.com/bc/docs/support/SupportManual/c00797875/c00797875.pdf]  

아무래도 서버에서는 다시 발생을 하지 않도록 해야하니
이런류의 디버깅 방법론을 제공해주는 듯? 
Posted by 구차니
새누리당 듣고 떠오른 생각

1. '신'한국당 에서 신을 한글로 바꾸었군 -_-
2. 누리 에서 누리꾼이 떠오름


제 2차 키배가 시작되었다!
SNS 점령 똭!
미디어 점령 똭!
난 알바가 아니다! 정직원이다! 파문




웬지 이런 느낌?

[링크 : http://news.nate.com/view/20120202n08212&NC=TB]
Posted by 구차니