get keyboard inputs without blocking
블럭킹없이 키보드 입력 받는 코드.. #include #include char getch() { fd_set set; struct timeval timeout; int rv; char buff = 0; int len = 1; int filedesc = 0; FD_ZERO(&set); FD_SET(filedesc, &set); timeout.tv_sec = 0; timeout.tv_usec = 1000; rv = select(filedesc + 1, &set, NULL, NULL, &timeout); struct termios old = {0}; if (tcgetattr(filedesc, &old) < 0) ROS_ERROR("tcsetattr()"); old.c_lflag &= ~ICANON; old.c..