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

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

?? ndirect.c

?? 卡內基梅隆大學(CMU)開發的移動機器人控制開發軟件包。可對多種機器人進行控制
?? C
?? 第 1 頁 / 共 5 頁
字號:
  int i, length = 0, chk_sum = 0;  unsigned char ichar, ichar2;  if (!(serial_ready (fd, wait_time))) {    errorp = SERIAL_TIMEOUT_ERROR;    return(FALSE);  }  errorp = 0;    /* read the begin packet character, it should be 1 */  ichar = (unsigned char)GETC(fd, conn_type);  if (!errorp) {    if (ichar != 1) {      printf("start byte error: %u\n", ichar);      errorp = SERIAL_PKG_ERROR;    }    else {      chk_sum = 1;    }  }    if (!errorp) {    /* read length, it should be >0 */    ichar = GETC(fd, conn_type);     if (!errorp) {      chk_sum = chk_sum + (int)ichar;    }    ichar2 = GETC(fd, conn_type);    if (!errorp) {      length = two_bytes_to_unsigned_int (ichar, ichar2);      if (length < 1) {	printf("length byte error\n");	errorp = SERIAL_PKG_ERROR;      }      else {	chk_sum = chk_sum + (int)ichar2;      }    }  }    /* get the data portion of the message */  i = 0;  while ((!errorp) && (i<=length)) {    ichar = GETC(fd, conn_type);    if (!errorp) {      inbuf[i] = ichar;      /* printf("%u\n",  ichar); */      chk_sum = chk_sum + (int)(ichar);    }    i++;  }    if (!errorp) {    /* check chk_sum and end_pkg */    if (((chk_sum - inbuf[length-1] - 92) % 256) != inbuf[length-1]) {      printf("check sum error\n");      errorp = SERIAL_PKG_ERROR;    }        if (inbuf[length] != 92) {      printf("packet end error\n");      errorp = SERIAL_PKG_ERROR;    }  }    if ((errorp) && (errorp != SERIAL_TIMEOUT_ERROR)) {    printf("emptying buffer\n");    buf_fill(Fd, conn_type);  /* read everything else in the serial line into		    buffer */    bufp = bufe; /* and flush it */  }    if (errorp)    return(FALSE);  else    return (TRUE);}/********************************************************* * *   Laser Calibration Stuff  * *********************************************************//* Transformation function accordingly to the calibration *//* xi1 = pixel; yi1 = scanline */static void ProjectPhy(double xi1, double yi1, double *x, double *y){  double xi,yi;  double den;		    xi = xi1 - 254.5;  yi = yi1 - 240.5;     den = (LASER_CALIBRATION[0]*xi + LASER_CALIBRATION[1]*yi + 1);    *x = (LASER_CALIBRATION[2]*xi + LASER_CALIBRATION[3]*yi +	LASER_CALIBRATION[4])/den + LASER_OFFSET[0];  *y = (LASER_CALIBRATION[5]*xi + LASER_CALIBRATION[6]*yi +	LASER_CALIBRATION[7])/den + LASER_OFFSET[1];}  static void convert_laser(int *laser){  int i, num_points, offset, interval;  double line_num;  double laserx[483], lasery[483];    num_points = laser[0];  interval = NUM_LASER/(num_points-1);  offset = 3 + (NUM_LASER-(num_points * interval))/2;  for (i=1; i<=num_points; i++) {    line_num = (double)(offset+(i-1)*interval);    ProjectPhy((double)laser[i], line_num, &laserx[i], &lasery[i]);   }  for (i=1; i<=num_points; i++) {    laser[2*i-1] = (int)(laserx[i]*10.0);    laser[2*i] = (int)(lasery[i]*10.0);  }  return;}/********************************************************* * *   Processing different types of packages received from the robot  * *********************************************************//* process the response received from the robot which   encodes the state of the robot according to the mask */static void Process_State_Pkg(unsigned char inbuf[BUFSIZE]){  int i, byte_count = 1;  int low_half_used = FALSE;    /* infrared */  for (i = STATE_IR_0 ; i <= STATE_IR_15; i++)    if (usedSmask[i] > 0)       {	if (low_half_used == FALSE)	  {	    State[i] = low_half(inbuf[byte_count]);	    low_half_used = TRUE;	  }	else	  {	    State[i] = high_half(inbuf[byte_count]);	    byte_count++;	    low_half_used = FALSE;	  }      }  if (low_half_used == TRUE)    byte_count++;    /*   * if the pos attachment was required we read it   */    if (POS_INFRARED_PI(usedSmask[SMASK_POS_DATA]))    for (i = 0; i < INFRAREDS; i++)      if (usedSmask[SMASK_IR_1 + i] > 0) 	byte_count += posPackageProcess(&inbuf[byte_count], 					&(posDataAll.infrared[i]));    /* sonars */  for (i = STATE_SONAR_0; i <= STATE_SONAR_15; i++) {    if ( usedSmask[i] > 0 )       {	State[i] = inbuf[byte_count];	byte_count++;      }  }    /*   * if the pos attachment was required we read it   */    if (POS_SONAR_PI(usedSmask[SMASK_POS_DATA]))    for (i = 0; i < SONARS; i++)       if (usedSmask[SMASK_SONAR_1 + i] > 0)	byte_count += posPackageProcess(&inbuf[byte_count], 					&(posDataAll.sonar[i]));  if (usedSmask[ SMASK_BUMPER ] > 0)  {    if (model == MODEL_SCOUT)    {      State[ STATE_BUMPER ] = combine_bumper_vector(inbuf[byte_count + 0], 						    inbuf[byte_count + 1],						    inbuf[byte_count + 2]);    }    else    {      State[ STATE_BUMPER ] = combine_bumper_vector(inbuf[byte_count + 2], 						    inbuf[byte_count + 1],						    inbuf[byte_count + 0]);    }        byte_count = byte_count + 3;        /*     * if the position attachment was requested for the bumper     * we have to unpack the package.      */        if (POS_BUMPER_PI(usedSmask[SMASK_POS_DATA]))      byte_count += posPackageProcess(&inbuf[byte_count], 				      &(posDataAll.bumper));  }    /* the position data */    if (usedSmask[SMASK_CONF_X] > 0)  {    State[STATE_CONF_X] =  two_bytes_to_signed_int(inbuf[byte_count],						   inbuf[byte_count+1]);    byte_count = byte_count + 2;  }    if (usedSmask[SMASK_CONF_Y] > 0)  {    State[STATE_CONF_Y] = two_bytes_to_signed_int(inbuf[byte_count],						  inbuf[byte_count+1]);    byte_count = byte_count + 2;  }    if (usedSmask[SMASK_CONF_STEER] > 0)  {    State[STATE_CONF_STEER] = two_bytes_to_signed_int(inbuf[byte_count], 						      inbuf[byte_count+1]);    byte_count = byte_count + 2;  }    if (usedSmask[SMASK_CONF_TURRET] > 0)  {    State[STATE_CONF_TURRET] = two_bytes_to_signed_int(inbuf[byte_count], 						       inbuf[byte_count+1]);    byte_count = byte_count + 2;  }    /* the velocities */    if (usedSmask[SMASK_VEL_TRANS] > 0)  {    State[STATE_VEL_TRANS] = two_bytes_to_signed_int(inbuf[byte_count], 						     inbuf[byte_count+1]);    byte_count = byte_count + 2;  }    if (usedSmask[SMASK_VEL_STEER] > 0)  {    State[SMASK_VEL_STEER] = two_bytes_to_signed_int(inbuf[byte_count],						     inbuf[byte_count+1]);    byte_count = byte_count + 2;  }    if (usedSmask[SMASK_VEL_TURRET] > 0)  {    State[STATE_VEL_TURRET] = two_bytes_to_signed_int(inbuf[byte_count],						      inbuf[byte_count+1]);    byte_count = byte_count + 2;  }    /* the compass value */  if (usedSmask[SMASK_COMPASS] > 0)  {    State[STATE_COMPASS] = two_bytes_to_signed_int(inbuf[byte_count],						   inbuf[byte_count+1]);    byte_count = byte_count + 2;          /*     * if the position attachment was requested for the compass     * we have to unpack the package.      */        if (POS_COMPASS_PI(usedSmask[SMASK_POS_DATA]))      byte_count += posPackageProcess(&inbuf[byte_count], 				      &(posDataAll.compass));  }  /* laser */  if (usedSmask[SMASK_LASER] > 0)  {    /* the number of points */    Laser[0] = two_bytes_to_unsigned_int(inbuf[byte_count],					 inbuf[byte_count+1]);    byte_count = byte_count + 2;        /* check the laser mode */    if ((laser_mode&0x1e) == 0) /* Line mode */    {      if (Laser[0] > NUM_LASER/2)      {	printf("error in processing laser reply (1).\n");	errorp = SERIAL_READ_ERROR;	Laser[0] = 0;	return;      }      for (i=1; i<=4*Laser[0]; i++)       {	Laser[i] = two_bytes_to_signed_int(inbuf[byte_count],					   inbuf[byte_count+1]);	byte_count = byte_count+2;      }    }    else /* Points of some kind */    {      if (Laser[0] > NUM_LASER)       {	printf("error in processing laser reply (2).\n");	errorp = SERIAL_READ_ERROR;	Laser[0] = 0;	return;      }      for (i=1; i<=Laser[0]; i++)       {	Laser[i] = two_bytes_to_unsigned_int(inbuf[byte_count],					     inbuf[byte_count+1]);	byte_count = byte_count+2;      }    }    if ((laser_mode&0x1e) == 19)      convert_laser(Laser);        /*     * if the position attachment was requested for the laser     * we have to get it from somewhere else      */        if (POS_LASER_PI(usedSmask[SMASK_POS_DATA]))      byte_count += posPackageProcess(&inbuf[byte_count], 				      &(posDataAll.laser));  }  /* motor active */  State[STATE_MOTOR_STATUS] = (long)inbuf[byte_count++];    /* process the 6811 time */  byte_count += timePackageProcess(&inbuf[byte_count], &posDataTime);  /* process the voltages of motor/CPU */  byte_count += voltPackageProcess(&inbuf[byte_count], 				   &voltageCPU, &voltageMotor);}/* process the response from the robot which encodes the   active infrared reading */static void Process_Infrared_Pkg(unsigned char inbuf[BUFSIZE]){  int i, byte_count = 1;  int low_half_used = FALSE;  /*    * the ir datum from one sensor is only a nibble,    * two of them are merged into one byte    */    for (i = STATE_IR_0 ; i <=  STATE_IR_15; i++)    if (low_half_used == FALSE)       {	State[i] = low_half(inbuf[byte_count]);	low_half_used = TRUE;      }    else       {	State[i] = high_half(inbuf[byte_count]);	byte_count++;	low_half_used = FALSE;      }  /* align with next byte */  if ( low_half_used )    byte_count++;  /*   * if the pos attachment was required we read it   */  if ( POS_INFRARED_PI ( usedSmask[ SMASK_POS_DATA ] ) )  {    for (i=0; i<16; i++)      byte_count += posPackageProcess ( &inbuf[byte_count], 				        &( posDataAll.infrared[i] ) );  }  /* extract the time data for the 6811 */  byte_count += timePackageProcess ( &inbuf[byte_count], &posDataTime );}/* process the response from the robot which encodes the   active sonar reading */static void Process_Sonar_Pkg(unsigned char inbuf[BUFSIZE]){  int i, byte_count = 1;  /*   * read the sensory data from the buffer   */  for (i = STATE_SONAR_0; i <= STATE_SONAR_15; i++)     {      State[i] = inbuf[byte_count];      byte_count++;    }  /*   * if the pos attachment was required we read it   */  if ( POS_SONAR_PI ( usedSmask[ SMASK_POS_DATA ]) )    for (i=0; i<16; i++)       byte_count += posPackageProcess ( &inbuf[byte_count], 				        &( posDataAll.sonar[i] ) );      /* extract the time data for the 6811 */  byte_count += timePackageProcess ( &inbuf[byte_count], &posDataTime );}/* process the response from the robot which encodes the   configuration of the robot */static void Process_Configuration_Pkg(unsigned char inbuf[BUFSIZE]){  int byte_count = 1;    State[ STATE_CONF_X ] = two_bytes_to_signed_int(inbuf[byte_count],						  inbuf[byte_count+1]);  byte_count = byte_count + 2;    State[ STATE_CONF_Y ] = two_bytes_to_signed_int(inbuf[byte_count],						  inbuf[byte_count+1]);  byte_count = byte_count + 2;    State[ STATE_CONF_STEER ] = two_bytes_to_signed_int(inbuf[byte_count],						      inbuf[byte_count+1]);  byte_count = byte_count + 2;    State[ STATE_CONF_TURRET ] = two_bytes_to_signed_int(inbuf[byte_count],						       inbuf[byte_count+1]);}static void Process_Velocity_Pkg(unsigned char inbuf[BUFSIZE]){  int byte_count = 1;    State[ STATE_VEL_TRANS ] = two_bytes_to_signed_int(inbuf[byte_count],						     inbuf[byte_count+1]);  byte_count = byte_count + 2;    State[ STATE_VEL_STEER ] = two_bytes_to_signed_int(inbuf[byte_count],						     inbuf[byte_count+1]);  byte_count = byte_count + 2;    State[ STATE_VEL_TURRET ] = two_bytes_to_signed_int(inbuf[byte_count],						      inbuf[byte_count+1]);}static void Process_Acceleration_Pkg(unsigned char inbuf[BUFSIZE] __attribute__ ((unused))){}/* process the response from the robot which encodes the   compass reading of the robot */static void Process_Compass_Pkg(unsigned char inbuf[BUFSIZE]){  int byte_count = 1;    State[ STATE_COMPASS ] = two_bytes_to_unsigned_int(inbuf[byte_count],						     inbuf[byte_count+1]);  byte_count +=2;  /*   * if the position attachment was requested for the compass   * we have to unpack the package.    */  if ( POS_COMPASS_PI ( usedSmask[ SMASK_POS_DATA ] ) )    byte_count += posPackageProcess ( &inbuf[byte_count],   				      &( posDataAll.compass ) );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品一区二区在线观看| 欧美在线视频你懂得| 蜜臀va亚洲va欧美va天堂| 一区二区三区欧美在线观看| 中文字幕亚洲一区二区av在线 | 精品一区二区三区蜜桃| 午夜久久福利影院| 免费观看久久久4p| 国产精品亚洲第一| 成人精品视频.| 一本一本大道香蕉久在线精品| www.亚洲国产| 色狠狠av一区二区三区| 欧美精品国产精品| 精品国产乱码久久久久久久| 久久蜜桃香蕉精品一区二区三区| 欧美国产乱子伦| 亚洲欧美中日韩| 亚洲va国产天堂va久久en| 日本在线不卡一区| 久久69国产一区二区蜜臀| 国产美女在线观看一区| 成人黄色大片在线观看| 欧美视频一区二区三区四区| 欧美片网站yy| 久久精品一二三| 亚洲天堂免费看| 日日夜夜一区二区| 国产成人免费视频一区| 91成人在线精品| 欧美大尺度电影在线| 日本一二三不卡| 午夜私人影院久久久久| 国产成人综合在线| 欧美日韩一区二区在线观看视频 | 欧亚一区二区三区| 欧美一区永久视频免费观看| 日本一二三不卡| 日本vs亚洲vs韩国一区三区 | 欧美疯狂性受xxxxx喷水图片| 精品国产91九色蝌蚪| 17c精品麻豆一区二区免费| 亚洲国产精品尤物yw在线观看| 极品少妇xxxx偷拍精品少妇| 99视频在线精品| 精品黑人一区二区三区久久| 一区二区三区中文字幕电影| 国产精品综合在线视频| 在线播放日韩导航| 亚洲特黄一级片| 国产福利一区二区三区视频| 欧美精品第1页| 洋洋av久久久久久久一区| 国产精品一区一区三区| 日韩欧美你懂的| 午夜视频一区在线观看| 色一区在线观看| 亚洲视频一区二区在线观看| 国产一区二区日韩精品| 欧美一卡二卡三卡四卡| 亚洲成人av在线电影| 色狠狠色狠狠综合| 中文字幕中文乱码欧美一区二区 | 亚洲欧洲另类国产综合| 国产福利一区二区三区视频在线 | 色哟哟国产精品免费观看| 欧美日韩精品一区二区三区四区 | 久久精品网站免费观看| 亚洲va韩国va欧美va| 一本一道久久a久久精品综合蜜臀| 久久久久国产精品厨房| 激情综合网av| 精品日本一线二线三线不卡| 蜜臀av性久久久久蜜臀av麻豆 | 国产成人精品免费网站| 精品处破学生在线二十三| 麻豆成人91精品二区三区| 日韩一区二区精品葵司在线| 日日摸夜夜添夜夜添精品视频| 欧美色爱综合网| 香蕉影视欧美成人| 欧美精品九九99久久| 日本不卡视频一二三区| 精品国产三级a在线观看| 麻豆精品一区二区综合av| 久久综合久久鬼色中文字| 国产精品综合在线视频| 成人欧美一区二区三区小说| 一本色道久久综合亚洲91| 一区二区免费在线| 欧美美女一区二区| 麻豆精品视频在线观看视频| 久久久99久久| 一本到高清视频免费精品| 三级影片在线观看欧美日韩一区二区| 欧美区一区二区三区| 狠狠色综合播放一区二区| 国产日韩欧美综合一区| 色综合天天综合网天天狠天天 | 91久久精品网| 免费成人在线视频观看| 国产日韩精品一区二区浪潮av| 99在线精品免费| 日韩精品福利网| 国产色91在线| 欧美日韩五月天| 国产精品夜夜爽| 亚洲自拍偷拍网站| 欧美r级在线观看| 一本色道久久综合亚洲aⅴ蜜桃 | 石原莉奈在线亚洲三区| 精品精品国产高清一毛片一天堂| av资源网一区| 久久国产精品露脸对白| 国产精品欧美综合在线| 欧美一级二级在线观看| 成人午夜av电影| 日本中文字幕不卡| 亚洲柠檬福利资源导航| 精品国产91亚洲一区二区三区婷婷| 99国产欧美另类久久久精品| 蜜桃传媒麻豆第一区在线观看| 一区二区中文视频| 日韩久久免费av| 欧美亚洲日本国产| 国产精品123| 久久精品国产99国产| 亚洲图片欧美综合| 国产精品你懂的| 久久老女人爱爱| 在线播放国产精品二区一二区四区| 久久av资源站| 天天影视网天天综合色在线播放| 中文字幕在线不卡一区| 久久亚洲精品国产精品紫薇| 91.麻豆视频| 欧美色欧美亚洲另类二区| 成人av网址在线观看| 国产一区二区女| 精品亚洲免费视频| 日韩激情av在线| 日本大胆欧美人术艺术动态| 亚洲一级片在线观看| 亚洲欧美在线观看| 国产精品天干天干在观线| 久久久美女毛片| 久久久久久久久久久久久女国产乱 | 久久久久久久精| 精品美女在线观看| 精品日韩欧美在线| 久久天堂av综合合色蜜桃网| 日韩精品一区二区三区四区视频 | 麻豆成人在线观看| 老司机精品视频导航| 久久精品国产第一区二区三区| 蜜芽一区二区三区| 久久精品国产一区二区三| 韩国视频一区二区| 成人丝袜高跟foot| av激情综合网| 在线观看国产91| 欧美视频完全免费看| 欧美电影一区二区| 精品国产欧美一区二区| 国产午夜亚洲精品午夜鲁丝片| 国产日韩欧美精品在线| 中文字幕一区二区三区精华液| 亚洲欧美一区二区三区极速播放 | 欧美激情中文字幕| 中文字幕视频一区| 亚洲成在线观看| 久久99精品久久久久久久久久久久| 国内精品免费**视频| 成人性生交大片免费看视频在线 | 久久99精品久久久久久| 激情五月播播久久久精品| 国产黄色成人av| 一本色道a无线码一区v| 欧美性感一区二区三区| 日韩欧美国产一区在线观看| 久久久久久久免费视频了| **欧美大码日韩| 偷拍日韩校园综合在线| 国产成人在线视频免费播放| 色婷婷av久久久久久久| 日韩手机在线导航| 1000精品久久久久久久久| 欧美a一区二区| 色先锋久久av资源部| 精品国产一区二区精华| 亚洲女同女同女同女同女同69| 奇米精品一区二区三区四区| 成人18精品视频| 精品精品国产高清a毛片牛牛| 亚洲精品大片www| 免费观看一级特黄欧美大片| 一本色道亚洲精品aⅴ| 国产午夜久久久久| 天堂精品中文字幕在线| 99re成人精品视频|