亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? aflock.cpp

?? FreeWRLduneInputDevice和FreeWRL一起可以讓用戶用帶有6DoF的輸入設備檢索3D VRML/X3D數據。它基于FreeWRL的"/tmp/inpdev"擴展傳感器輸入接口和w
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
        if (_usingCorrectionTable)	   this->positionCorrect( xPos(flock), yPos(flock), zPos(flock));        j++;        }     return 1;}// error timeout to wait between drain and flush (in usleep units)#define ERROR_TIMEOUT 1000//// destroy remaining dirt on the port to recover from errorsvoid Aflock::destroyDirt(){     tcdrain(_portId);     usleep(ERROR_TIMEOUT);     tcdrain(_portId);}//: stop the flockint Aflock::stop(){    char   bird_command[4];    AFLOCK_PRINT("Aflock: Try stopping the flock...");    bird_command[0] = 'B';    write( _portId, bird_command, 1 );    usleep( 500 * Aflock::mSleepFactor );    bird_command[0] = 'G';    write( _portId, bird_command, 1 );    usleep( 200 * Aflock::mSleepFactor );    tcdrain(_portId);    tcflush(_portId, TCIOFLUSH);    tcdrain(_portId);    close( _portId );    _portId = -1;    // flock is not active now.    _active = false;    AFLOCK_PRINT(" STOPPED \n");    return 1;}//: Set the hemisphere that the transmitter transmits from.//  NOTE: flock.isActive() must be false to use this functionvoid Aflock::setHemisphere( const BIRD_HEMI& h ){    if (_active)    {	fprintf(stderr,"Aflock: Cannot change the hemisphere\n");	return;    } else {	// Set it.        _hemisphere = h;    }}//: Set the type of filtering that the flock uses//  NOTE: flock.isActive() must be false to use this functionvoid Aflock::setFilterType( const BIRD_FILT& f ){    if (_active)    {	fprintf(stderr,"Aflock: Cannot change filter type while active\n");	return;    } else {	// Set it.	_filter = f;    }}//: Set if sudden output changes of a bird should be locked//  NOTE: flock.isActive() must be false to use this functionvoid Aflock::setSuddenOutputChangeLock( const bool& b ){    if (_active)    {	fprintf(stderr,"Aflock: Cannot change sudden lock while active\n");	return;    } else {	// Set it.	_sudden_output_change_lock = b;    }}//: Set the report rate that the flock uses//  NOTE: flock.isActive() must be false to use this functionvoid Aflock::setReportRate( const char& rRate ){    if (_active)    {	fprintf(stderr,"Aflock: Cannot change report rate while active\n");	return;    } else {	// Set it.	_reportRate = rRate;    }}//: Set the unit number of the transmitter//  give - an integer that is the same as the dip switch//         setting on the transmitter box (for the unit number) <BR>//  NOTE: flock.isActive() must be false to use this functionvoid Aflock::setTransmitter( const int& Transmit ){  if (_active)  {      fprintf(stderr,"Aflock: Cannot change transmitter while active\n");      return;  } else {      // Set it.      _xmitterUnitNumber = Transmit;  }}//: Set the number of birds to use in the flock.//  give - an integer number not more than the number of//         birds attached to the system <BR>//  NOTE: flock.isActive() must be false to use this functionvoid Aflock::setNumBirds( const int& n ){    if (_active)    {	fprintf(stderr,"Aflock: Cannot change num birds while active\n");	return;    } else {	// Set it.	_numBirds = n;    }}//: set the video sync type//  this option allows the Flock to syncronize its pulses with//  your video display.  This will eliminate most flicker caused//  by the magnetic distortion. <BR>//  - Refer to your flock manual for what number to use.//  NOTE: flock.isActive() must be false to use this functionvoid Aflock::setSync(const int& sync){  if (_active)  {      fprintf(stderr,"Aflock: Cannot change report rate while active\n");      return;  } else {      // Set it.      _syncStyle = sync;  }}//: set blocking of flock//  see flock manual for details.//  NOTE: flock.isActive() must be false to use this functionvoid Aflock::setBlocking( const int& blVal ){  if (_active)  {      fprintf(stderr,"Aflock: Cannot change blocking while active\n");      return;  } else {      // Set it.      _blocking = blVal;  }}//: with the calibration table info, correct a given position//  give - a position in x, y, z euclidian coordinates//  returns - a corrected position in x, y, z euclidian coordinatesvoid Aflock::positionCorrect( float& x, float& y, float& z ){    int xlo,ylo,zlo,xhi,yhi,zhi;    float a,b,c,a1,b1,c1;    // Find corners    xlo = (int)(x-caltable.xmin);    ylo = (int)(y-caltable.ymin);    zlo = (int)(z-caltable.zmin);    xhi = xlo+1;    yhi = ylo+1;    zhi = zlo+1;    a1 = 1 - (a = caltable.xmin + xhi - x);    b1 = 1 - (b = caltable.ymin + yhi - y);    c1 = 1 - (c = caltable.zmin + zhi - z);    x = a * b* c*caltable.xloc[xlo][ylo][zlo] +        a * b*c1*caltable.xloc[xlo][ylo][zhi] +        a *b1* c*caltable.xloc[xlo][yhi][zlo]+        a *b1*c1*caltable.xloc[xlo][yhi][zhi]+        a1* b* c*caltable.xloc[xhi][ylo][zlo]+        a1* b*c1*caltable.xloc[xhi][ylo][zhi]+        a1*b1* c*caltable.xloc[xhi][yhi][zlo]+        a1*b1*c1*caltable.xloc[xhi][yhi][zhi];    y = a * b* c*caltable.yloc[xlo][ylo][zlo] +        a * b*c1*caltable.yloc[xlo][ylo][zhi] +        a *b1* c*caltable.yloc[xlo][yhi][zlo]+        a *b1*c1*caltable.yloc[xlo][yhi][zhi]+        a1* b* c*caltable.yloc[xhi][ylo][zlo]+        a1* b*c1*caltable.yloc[xhi][ylo][zhi]+        a1*b1* c*caltable.yloc[xhi][yhi][zlo]+        a1*b1*c1*caltable.yloc[xhi][yhi][zhi];    z = a * b* c*caltable.zloc[xlo][ylo][zlo] +        a * b*c1*caltable.zloc[xlo][ylo][zhi] +        a *b1* c*caltable.zloc[xlo][yhi][zlo]+        a *b1*c1*caltable.zloc[xlo][yhi][zhi]+        a1* b* c*caltable.zloc[xhi][ylo][zlo]+        a1* b*c1*caltable.zloc[xhi][ylo][zhi]+        a1*b1* c*caltable.zloc[xhi][yhi][zlo]+        a1*b1*c1*caltable.zloc[xhi][yhi][zhi];    return;}/// Warning: initCorrectionTable is untested//: init the correction table from a file//  give - a file name of the calibration file.//  result - initializes the correction table with the file's infovoid Aflock::initCorrectionTable( const char* const fName ){  int i,j,k, xsize,ysize,zsize;  float dump;  FILE* inFile;  AFLOCK_PRINT("	  Initializing calibration table ... ");  AFLOCK_PRINT(fName);  inFile=fopen(fName,"r");  if (!inFile)  {	fprintf(stderr,"Unable to open calibration.table\n");        return;  } else {     AFLOCK_PRINT( "   Calibration table opened sucessfully.");  }  fscanf(inFile,"%f %f %f %f %f %f",                &caltable.xmin,&caltable.xmax,                &caltable.ymin,&caltable.ymax,                &caltable.zmin,&caltable.zmax);  xsize = (int) (caltable.xmax - caltable.xmin) + 1;  ysize = (int) (caltable.ymax - caltable.ymin) + 1;  zsize = (int) (caltable.zmax - caltable.zmin) + 1;  for (i = 0; i < xsize; i++)    for (j = 0; j < ysize; j++)      for (k = 0; k < zsize; k++)         {            fscanf(inFile,"%f %f %f %f %f %f",	           &dump , &dump , &dump,		   &caltable.xloc[i][j][k],		   &caltable.yloc[i][j][k],		   &caltable.zloc[i][j][k]);	 }   fclose(inFile);} float& Aflock::xPos( const int& i )  { assert( i < MAX_SENSORS ); return _position[i][0]; } float& Aflock::yPos( const int& i )  { assert( i < MAX_SENSORS ); return _position[i][1]; } float& Aflock::zPos( const int& i )  { assert( i < MAX_SENSORS ); return _position[i][2]; }#ifdef USE_AFLOCK_QUATERNION float& Aflock::xQuat( const int& i )  { assert( i < MAX_SENSORS ); return _orientation[i][0]; } float& Aflock::yQuat( const int& i )  { assert( i < MAX_SENSORS ); return _orientation[i][1]; } float& Aflock::zQuat( const int& i )  { assert( i < MAX_SENSORS ); return _orientation[i][2]; } float& Aflock::wQuat( const int& i )  { assert( i < MAX_SENSORS ); return _orientation[i][3]; }#else float& Aflock::zRot( const int& i )  { assert( i < MAX_SENSORS ); return _orientation[i][0]; } float& Aflock::yRot( const int& i )  { assert( i < MAX_SENSORS ); return _orientation[i][1]; } float& Aflock::xRot( const int& i )  { assert( i < MAX_SENSORS ); return _orientation[i][2]; }#endif///////////////////////////////////////////////////////////////////// Local functions to Aflock.cpp//////////////////////////////////////////////////////////////////float Aflock::rawToFloat( char& r1, char& r2 ){    // I3Stick has something like    // ((float)((short)((buff[1] & 0x7F) << 9) |    //          (short)((buff[0] & 0x7F) << 2)) / 0x7FFF);   short int ival1,ival2,val;   ival1 = r1 & 0x7f;   ival2 = r2 & 0x7f;   val = (ival1 << 9) | ival2<<2;   return ((float)val) / 0x7fff;}float Aflock::rawToQuat(char& r1, char& r2){     signed short int val;     unsigned short int ival1, ival2;      ival1 = r1 ;     ival2 = r2 ;     val = (ival1 << 8) | ival2;     float ret= ((float)val) / (float)0x7fff ;printf("ret %f\n",ret);     return ret;}//: RS232 To FBB Command //  adress next RS232 command to bird number "birdID"void  Aflock::pickBird( const int& birdID, const int& port ){    char buff = 0xF0 + birdID;    write( port, &buff, 1 );    usleep ( 100 * Aflock::mSleepFactor );    tcdrain(_portId);    AFLOCK_ERROR_CHECK(port,"RS232 command",birdID);}//: Open the port.//  give - a serial port//  give - a baud rate//  returns portId twice (created by the open function)//  NOTE: portId is returned from both ends of this function.//  if portId == -1 then function failed to open the port.int Aflock::open_port( const char* const serialPort,			const int& baud,			int& portId ){    ///////////////////////////////////////////////////////////////////    // Open and close the port to reset the tracker, then    // Open the port    ///////////////////////////////////////////////////////////////////    portId = open( serialPort, O_RDWR | O_NDELAY);    if (portId == -1)    {	fprintf(stderr,"  port reset failed (because port open failed)\n");	return portId;    } else {	sleep(2);	close( portId );	AFLOCK_PRINT( "  port reset successfully (port opened then closed)\n");    }    portId = open( serialPort, O_RDWR | O_NDELAY);    if (portId == -1)    {	fprintf(stderr,"  port open failed\n");	return portId;    } else {	AFLOCK_PRINT( "  port open successfully\n");    }    //////////////////////////////////////////////////////////////////    // Setup the port, current setting is 38400 baud    //    //////////////////////////////////////////////////////////////////    AFLOCK_PRINT( "  Getting current term setting\n");    termios termIoPort;    /* Initialize to all zeroes so there is no risk memcmp will report a       spurious difference in an uninitialized portion of the structure.  */    memset (&termIoPort, 0, sizeof(termIoPort));    if (tcgetattr(portId, &termIoPort))       perror(serialPort);         // Set the flags to 0 to clear out any cruft and to ensure that we are    // setting fresh values.    termIoPort.c_iflag = termIoPort.c_oflag = termIoPort.c_lflag = 0;#ifndef __sgi    termIoPort.c_lflag = N_TTY;#endif    // get the B* format baud rate    // i.e.: B38400 is baud = 38400    int magicBaudRate = 0;    switch (baud)    {	case 150: magicBaudRate = B150; break;	case 200: magicBaudRate = B200; break;	case 300: magicBaudRate = B300; break;	case 600: magicBaudRate = B600; break;	case 1200: magicBaudRate = B1200; break;	case 1800: magicBaudRate = B1800; break;	case 2400: magicBaudRate = B2400; break;	case 4800: magicBaudRate = B4800; break;	case 9600: magicBaudRate = B9600; break;	case 19200: magicBaudRate = B19200; break;	#ifndef _POSIX_SOURCE	case 57600: magicBaudRate = B57600; break;#   ifdef B76800	    case 76800: magicBaudRate = B76800; break;#   endif	case 115200: magicBaudRate = B115200; break;#endif        case 38400:        default:          magicBaudRate = B38400;          break;    }    termIoPort.c_cflag = CS8 | CLOCAL | CREAD;//    termIoPort.c_iflag = IGNBRK;    termIoPort.c_cc[0] = 0;			/* no delete/interrupt */    termIoPort.c_cc[VMIN]  = 0;			/* character or timeout                                                    satisfies read */    termIoPort.c_cc[VTIME] = 1;			/* 100 millisecond timeout */#ifdef __linux__    cfsetispeed (&termIoPort, magicBaudRate);    cfsetospeed (&termIoPort, magicBaudRate);    struct termios new_mode;    if (tcsetattr (portId, TCSADRAIN, &termIoPort))       perror(serialPort);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区和二区| 欧美激情艳妇裸体舞| 欧美va亚洲va国产综合| 精品久久久久一区二区国产| 国产精品女人毛片| 亚洲小说欧美激情另类| 免费久久精品视频| 色综合久久中文综合久久牛| 欧美一级黄色录像| 日韩理论电影院| 日本成人在线不卡视频| 色94色欧美sute亚洲线路一久| 欧美日韩在线直播| 国产精品美女久久久久久| 午夜国产不卡在线观看视频| 99久久免费精品高清特色大片| 欧美日韩激情一区二区三区| 国产精品美女久久福利网站| 亚洲成人福利片| 色呦呦国产精品| 久久精品夜色噜噜亚洲aⅴ| 在线不卡欧美精品一区二区三区| 国产精品久久久久久亚洲伦| 日韩av一级片| 欧美日韩成人在线| |精品福利一区二区三区| 国产一区二区三区免费| 色狠狠av一区二区三区| 成人免费小视频| 久草这里只有精品视频| 3d动漫精品啪啪一区二区竹菊| 欧美极品另类videosde| 国产91富婆露脸刺激对白| 欧美日本一区二区三区四区 | 97se亚洲国产综合自在线不卡| 777xxx欧美| 婷婷国产v国产偷v亚洲高清| 色婷婷久久一区二区三区麻豆| 亚洲欧美一区二区视频| 精品一区二区免费| 久久综合九色综合97婷婷女人| 亚洲成人av在线电影| 欧美肥胖老妇做爰| 国产一区视频在线看| 欧美日本一区二区三区| 亚洲v日本v欧美v久久精品| 在线看国产一区二区| 日韩理论片在线| 成人性生交大合| 综合久久综合久久| 波多野结衣中文一区| 亚洲同性gay激情无套| 国产精品一品视频| 国产精品九色蝌蚪自拍| 丁香激情综合国产| 亚洲色图色小说| 91蝌蚪porny九色| 亚洲r级在线视频| 欧美浪妇xxxx高跟鞋交| 美女在线观看视频一区二区| 精品久久国产字幕高潮| 国产成a人亚洲精| 久久久久国产一区二区三区四区 | 一卡二卡三卡日韩欧美| 国产精品综合网| 亚洲日本在线a| 色悠悠久久综合| 老司机免费视频一区二区三区| 在线观看91视频| 亚洲电影一区二区三区| 欧美va亚洲va在线观看蝴蝶网| 精品一区二区三区免费毛片爱| 久久久99精品久久| 暴力调教一区二区三区| 日本三级韩国三级欧美三级| 欧美一卡2卡三卡4卡5免费| 国产综合久久久久影院| 久久亚洲精品小早川怜子| 国产 欧美在线| 亚洲午夜激情网站| 91麻豆国产福利在线观看| 午夜精品一区二区三区免费视频| 精品久久一区二区三区| 日本精品视频一区二区| 蜜桃视频在线观看一区二区| 亚洲日本欧美天堂| 欧美一区二区三区白人| 91免费在线播放| 久久99国内精品| 亚洲成人资源网| 久久久精品人体av艺术| 欧美三级资源在线| 麻豆成人91精品二区三区| 亚洲欧洲日产国产综合网| 日韩免费视频一区二区| 91免费在线视频观看| 不卡的av网站| 久久精品国产99国产精品| 亚洲123区在线观看| 欧美韩日一区二区三区四区| 欧美mv和日韩mv的网站| 色婷婷综合中文久久一本| 国产成人超碰人人澡人人澡| 国产精品九色蝌蚪自拍| 久久久噜噜噜久噜久久综合| youjizz久久| 国产精品一二三四五| 日本亚洲视频在线| 亚洲一区二区三区在线播放| 国产精品久久久久影院老司| 欧美一区二区视频在线观看| 精品婷婷伊人一区三区三| 日韩一区二区免费电影| 欧美无乱码久久久免费午夜一区| 国产精品一卡二卡| 国产做a爰片久久毛片 | 国产精品国产自产拍在线| 久久一区二区三区国产精品| 91久久国产综合久久| 91成人网在线| 99热99精品| jlzzjlzz欧美大全| 国产99久久久精品| 国产一区二区调教| 久久电影网站中文字幕| 日韩激情视频在线观看| 日韩成人精品在线观看| 亚洲成人精品在线观看| 视频一区二区欧美| 亚洲日本在线看| 亚洲同性gay激情无套| 国产亚洲一本大道中文在线| 欧美成人艳星乳罩| 日韩一区二区三区免费观看| 欧美剧情片在线观看| 欧美日韩三级在线| 欧美乱妇15p| 欧美久久免费观看| 91麻豆精品国产无毒不卡在线观看 | 丰满岳乱妇一区二区三区| 国内成+人亚洲+欧美+综合在线| 久久99国产精品久久99| 男人的j进女人的j一区| 免费观看日韩电影| 亚洲精品一区二区三区蜜桃下载| 欧美一区二区视频免费观看| 国产欧美日韩另类一区| 久久久久国色av免费看影院| 亚洲欧美激情视频在线观看一区二区三区 | 国产成人一区在线| 国产精品色哟哟| 7777精品伊人久久久大香线蕉的 | 中文字幕成人网| 91精品国产综合久久国产大片| 欧美日韩国产首页| 欧美日韩一区二区在线观看 | 欧美日韩中文精品| 91啦中文在线观看| 欧美日韩一区成人| 91麻豆精品91久久久久久清纯| 久久久三级国产网站| 国产视频一区二区在线| 亚洲男同性恋视频| 日韩av在线发布| av网站免费线看精品| 欧美三级中文字| 精品久久久久久久久久久院品网 | 欧美激情在线免费观看| 亚洲欧美另类久久久精品2019| 亚洲一级电影视频| 男人的天堂久久精品| 日韩一二三区视频| 久久这里只有精品6| 一区二区三区四区精品在线视频| 婷婷丁香激情综合| 成人黄色免费短视频| 4438x成人网最大色成网站| 国产精品福利影院| 肉丝袜脚交视频一区二区| 国产成人自拍高清视频在线免费播放| 色婷婷av一区二区三区大白胸| 欧美在线视频你懂得| 亚洲国产电影在线观看| 日本不卡一二三| 99久久综合国产精品| 2020国产精品自拍| 国产精品国产三级国产普通话99| 亚洲综合视频网| 中文av一区特黄| 午夜久久久影院| 欧美丝袜自拍制服另类| 久久综合久色欧美综合狠狠| 国产精品日韩精品欧美在线| 麻豆成人av在线| 97超碰欧美中文字幕| 国产色爱av资源综合区| 国产精品1区二区.| 欧美zozozo| 国产99精品在线观看| 中文字幕在线一区免费|