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

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

?? ndirect.c

?? 卡內基梅隆大學(CMU)開發的移動機器人控制開發軟件包。可對多種機器人進行控制
?? C
?? 第 1 頁 / 共 5 頁
字號:
  /* extract the time data for the 6811 */  byte_count += timePackageProcess ( &inbuf[byte_count], &posDataTime );}/* process the response from the robot which encodes the   compass reading of the robot */static void Process_Compass_Conf_Pkg(unsigned char inbuf[BUFSIZE]){  int byte_count = 1;    printf("compass calibration score x: %d y: %d z: %d\n",	 inbuf[byte_count], 	 inbuf[byte_count+1], 	 inbuf[byte_count+2]);}/* process the response from the robot which encodes the   bumper reading of the robot */static void Process_Bumper_Pkg(unsigned char inbuf[BUFSIZE]){  int byte_count = 1;    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 +=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 ) );  /* extract the time data for the 6811 */  byte_count += timePackageProcess ( &inbuf[byte_count], &posDataTime );}static void Process_Laser_Point_Pkg(unsigned char inbuf[BUFSIZE]){  int i, byte_count = 1;    Laser[0]=two_bytes_to_unsigned_int(inbuf[byte_count],inbuf[byte_count+1]);  byte_count = byte_count+2;  for (i=1; i<=Laser[0]; i++) {    Laser[i] = two_bytes_to_signed_int(inbuf[byte_count], inbuf[byte_count+1]);    byte_count = byte_count+2;  }  convert_laser(Laser);  Laser[0] = inbuf[byte_count] + 256 * inbuf[byte_count+1];  byte_count = byte_count + 2;    if ( Laser[0] > NUM_LASER ) {    printf("error in processing laser point reply\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 == 51) || (laser_mode == 50) || (laser_mode == 19))    convert_laser(Laser);  /*   * if the position attachment was requested for the laser   * we have to unpack the package.    */  if ( POS_LASER_PI ( usedSmask[ SMASK_POS_DATA ] ) )    byte_count += posPackageProcess ( &inbuf[byte_count],   				      &( posDataAll.laser ) );  /* extract the time data for the 6811 */  byte_count += timePackageProcess ( &inbuf[byte_count], &posDataTime );}static void Process_Laser_Line_Pkg(unsigned char inbuf[BUFSIZE]){   int i, byte_count = 1;    Laser[0] = inbuf[byte_count] + 256 * inbuf[byte_count+1];  byte_count = byte_count + 2;  if (Laser[0] > NUM_LASER) {    printf("error in processing laser line reply\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;  }  /*   * if the position attachment was requested for the laser   * we have to unpack the package.    */  if ( POS_LASER_PI ( usedSmask[ SMASK_POS_DATA ] ) )    byte_count += posPackageProcess ( &inbuf[byte_count],   				      &( posDataAll.laser ) );  /* extract the time data for the 6811 */  byte_count += timePackageProcess ( &inbuf[byte_count], &posDataTime );}/* process the response from the robot which encodes special information */static void Process_Special_Pkg(unsigned char inbuf[BUFSIZE]){  int data_size, i, byte_count = 1;    data_size = two_bytes_to_unsigned_int(inbuf[1],inbuf[2]);  special_answer_size = ( unsigned short ) data_size;  if (data_size > MAX_USER_BUF)     data_size = MAX_USER_BUF;  if ( special_buffer != (unsigned char *)NULL)    {      for (i=0; i<data_size; i++) 	{	  special_buffer[i] = inbuf[i+1];	  byte_count++;	}    }  else    printf("Data buffer for user package is NULL pointer\n");}static int Process_Robot_Resp(unsigned char inbuf[BUFSIZE]){  switch (inbuf[0]) { /* type of the returned package */  case AC:  case SP:  case PR:  case PA:  case VM:  case MV:  case CT:  case GS:  case ST:  case LP:  case DP:  case DA:  case WS:  case ZR:  case TK:  case CONF_IR:  case CONF_SN:  case CONF_LS:  case CONF_TM:  case CONF_SG:  case CONF_SER:  case SETUP_LS:    Process_State_Pkg(inbuf);    break;  case CONF_CP:    Process_Compass_Conf_Pkg(inbuf);    break;  case NAK: /* Nak */    printf("Nak\n");    break;  case GET_IR: /* Infrared */    Process_Infrared_Pkg(inbuf);    break;  case GET_SN: /* Sonar */    Process_Sonar_Pkg(inbuf);    break;  case GET_RC: /* Configuration */    Process_Configuration_Pkg(inbuf);    break;  case GET_RV: /* Velocity */    Process_Velocity_Pkg(inbuf);    break;  case GET_RA: /* Acceleration */    Process_Acceleration_Pkg(inbuf);    break;  case GET_CP: /* Compass */    Process_Compass_Pkg(inbuf);    break;  case GET_LS: /* Laser */    Process_Laser_Point_Pkg(inbuf);    break;  case GET_BP: /* Bumper */    Process_Bumper_Pkg(inbuf);    break;  case GET_SG: /* Laser line mode */    Process_Laser_Line_Pkg(inbuf);    break;  case SPECIAL: /* User */    Process_Special_Pkg(inbuf);    break;  default:    printf("Invalid Robot Response\n");    return(FALSE);    break;  }  return(TRUE);}static int Comm_Robot(int fd, unsigned char command[BUFSIZE]){  unsigned char response[BUFSIZE];  int respondedp;  int re_xmitp, i;  fd_set          lfdvar;  struct timeval  timeout;  if (fd == -1) {    fprintf(stderr,	    "Trying again to reestablish connection with the robot...\n"	    "                          ");    fflush(stderr);    for (i = 0; (i < 2) &&         (connect_robot(Robot_id, model, device, conn_value) == FALSE);         i++)    {      sleep(5);      fprintf(stderr, "Trying again...           ");      fflush(stderr);    }    if (i == 2 &&        connect_robot(Robot_id, model, device, conn_value) == FALSE)    {      fprintf(stderr, "Failed to reestablish connection.  Command aborted.\n");      return FALSE;    }    fprintf(stderr, "Successful!  Continuing with command.\n");  }  re_xmitp = RE_XMIT;  FD_ZERO(&lfdvar);  FD_SET(fd, &lfdvar);    timeout.tv_sec = 0;  timeout.tv_usec = 0;    while (select(fd+1, &lfdvar, NULL, NULL, &timeout) != 0)  {    /* Flush buffer */    respondedp = read(fd, response, BUFSIZE);    /* Check for errors, such as lost connection. */    if (respondedp <= 0 && errno != EWOULDBLOCK)    {      close(fd);      Fd = -1;      fprintf(stderr,	      "Lost communication with robot.\nAttempting to reconnect...");      fflush(stderr);      for (i = 0; (i < 2) &&           (connect_robot (Robot_id, model, device, conn_value) == FALSE);           i++)      {	sleep(5);	fprintf(stderr, "Trying again...           ");	fflush(stderr);      }      if (i == 2 &&          connect_robot (Robot_id, model, device, conn_value) == FALSE)      {	fprintf(stderr, "Unable to reconnect to robot.  Command aborted.\n");	return FALSE;      }      else      {	fprintf(stderr, "Successful!  Continuing with command.\n");      }    }  }    Write_Pkg(fd, command);  while (!(respondedp = Read_Pkg(fd, connect_type, response)) && (RE_XMIT)) {    Write_Pkg(fd, command);  }  if (!respondedp) {    printf("Last command packet transmitted:\n");    for (i = 0; i < command[1]+4; i++)      printf("%2.2x ", command[i]);    printf("\n");    return(FALSE);  }  else {    if (Process_Robot_Resp (response)) {      return(TRUE);    }    else {      printf("error in robot response\n");      return(FALSE);     }  }}/************************************ *                                  * * Robot Serial Interface Functions * *                                  * ************************************//*  * First some helper functions  */void stuff_length_type(int length, int ptype, unsigned char *byte_ptr);void stuff_length_type(int length, int ptype, unsigned char *byte_ptr){     byte_ptr++; /* skip the first byte of the buffer, which is 		    reserved for begin_pkg character */     unsigned_int_to_two_bytes(length, byte_ptr);     byte_ptr++; byte_ptr++;     *byte_ptr = ptype;}void stuff_two_signed_int(int length, int ptype, int num1, int num2,			  unsigned char *byte_ptr);void stuff_two_signed_int(int length, int ptype, int num1, int num2,			  unsigned char *byte_ptr){     byte_ptr++; /* skip the first byte of the buffer, which is 		    reserved for begin_pkg character */     unsigned_int_to_two_bytes(length, byte_ptr);     byte_ptr++; byte_ptr++;     *byte_ptr = ptype;     byte_ptr++;     signed_int_to_two_bytes(num1, byte_ptr);     byte_ptr++; byte_ptr++;     signed_int_to_two_bytes(num2, byte_ptr);}void stuff_three_unsigned_int(int length, int ptype, int num1, int num2,			      int num3, unsigned char *byte_ptr);void stuff_three_unsigned_int(int length, int ptype, int num1, int num2,			      int num3, unsigned char *byte_ptr){     byte_ptr++; /* skip the first byte of the buffer, which is 		    reserved for begin_pkg character */     unsigned_int_to_two_bytes(length, byte_ptr);     byte_ptr++; byte_ptr++;     *byte_ptr = ptype;     byte_ptr++;     unsigned_int_to_two_bytes(num1, byte_ptr);     byte_ptr++; byte_ptr++;     unsigned_int_to_two_bytes(num2, byte_ptr);     byte_ptr++; byte_ptr++;     unsigned_int_to_two_bytes(num3, byte_ptr);}void stuff_three_signed_int(int length, int ptype, int num1, int num2,			    int num3, unsigned char *byte_ptr);void stuff_three_signed_int(int length, int ptype, int num1, int num2,			    int num3, unsigned char *byte_ptr){     byte_ptr++; /* skip the first byte of the buffer, which is 		    reserved for begin_pkg character */     unsigned_int_to_two_bytes(length, byte_ptr);     byte_ptr++; byte_ptr++;     *byte_ptr = ptype;     byte_ptr++;     signed_int_to_two_bytes(num1, byte_ptr);     byte_ptr++; byte_ptr++;     signed_int_to_two_bytes(num2, byte_ptr);     byte_ptr++; byte_ptr++;     signed_int_to_two_bytes(num3, byte_ptr);}/*************** * FUNCTION:     posLongExtract * PURPOSE:      compose a long out of four bytes * ARGUMENTS:    unsigned char *inbuf : the pointer to the four bytes * ALGORITHM:    bit manipulation * RETURN:       long * SIDE EFFECT:   * CALLS:         * CALLED BY:     ***************/static long posLongExtract( unsigned char *inbuf ){  long tmp;    tmp = (long) LONG_B(inbuf[3],inbuf[2],inbuf[1],inbuf[0]);    if ( tmp & (1L << 31) )    return ( -(tmp & ~(1L << 31) ) );  else    return ( tmp );}/*************** * FUNCTION:     posUnsignedLongExtract * PURPOSE:      compose an unsigned long out of four bytes * ARGUMENTS:    unsigned char *inbuf : the pointer to the four bytes * ALGORITHM:    bit manipulation * RETURN:       usigned long * SIDE EFFECT:   * CALLS:         * CALLED BY:     ***************/static unsigned long posUnsignedLongExtract( unsigned char *inbuf ){  return ( (unsigned long) LONG_B(inbuf[3],inbuf[2],inbuf[1],inbuf[0]) );}/*************** * FUNCTION:     posPackageProcess * PURPOSE:      processes the part of the package with pos information * ARGUMENTS:    unsigned char *inbuf : pointer to the data in chars *               PosData *posData : this is were the posData are written to * ALGORITHM:    regroup the bytes and assign variables * RETURN:       int (the number of bytes read from the buffer) * SIDE EFFECT:   * CALLS:         * CALLED BY:     ***************/static int posPackageProcess ( unsigned char *inbuf, PosData *posData ){  int i = 0;  /* copy the stuff from the buffer into the posData for the current robot */  posData->config.configX      = posLongExtract(inbuf + i++ * sizeof(long));  posData->config.configY      = posLongExtract(inbuf + i++ * sizeof(long));  posData->config.configSteer  = posLongExtract(inbuf + i++ * sizeof(long));  posData->config.configTurret = posLongExtract(inbuf + i++ * sizeof(long));  posData->config.velTrans     = posLongExtract(inbuf + i++ * sizeof(long));  posData->config.velSteer     = posLongExtract(inbuf + i++ * sizeof(long));  posData->config.velTurret    = posLongExtract(inbuf + i++ * sizeof(long));  posData->config.timeStamp    = posUnsignedLongExtract(inbuf + i++ * 							sizeof(long));  posData->timeStamp           = posUnsignedLongExtract(inbuf + i++ * 							sizeof(long));    return ( i * sizeof(long) );}/*************** * FUNCTION:     timePackageProcess * PURPOSE:      processes the part of the package with the 6811 time * ARGUMENTS:    unsigned char *inbuf : pointer to the data in chars *               unsigned long *time : this is were the time is written to * ALGORITHM:    --- * RETURN:       static int  * SIDE EFFECT:   * CALLS:         * CALLED BY:     ***************/static int timePackageProcess ( unsigned char *inbuf, unsigned long *timeS ){  *timeS = posUnsignedLongExtract( inbuf );  return ( 4 );}/*************** * FUNCTION:     voltPackageProcess * PURPOSE:      processes the part of the package with the voltages * ARGUMENTS:    unsigned char *inbuf : pointer to the data in chars *               unsigned long *time : this is were the time is written to

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合久久精品| 亚洲国产精品99久久久久久久久| 久久久久国产免费免费| 亚洲一区在线播放| 成人免费看的视频| 欧美一级日韩不卡播放免费| 国产精品污网站| 精品一区二区三区免费毛片爱| 一本到不卡免费一区二区| 国产午夜亚洲精品不卡| 日韩电影一二三区| 欧美吻胸吃奶大尺度电影| 中文字幕人成不卡一区| 国产91丝袜在线18| 久久午夜羞羞影院免费观看| 免费在线看成人av| 欧美精品乱码久久久久久| 亚洲免费在线看| av影院午夜一区| 国产欧美日韩亚州综合| 国产在线视视频有精品| 欧美一卡二卡三卡四卡| 亚洲va欧美va人人爽| 91麻豆免费观看| 亚洲精品第1页| 91九色02白丝porn| 一区二区三区四区在线| 91浏览器打开| 亚洲婷婷在线视频| 99在线精品一区二区三区| 中文字幕一区二区5566日韩| 成人动漫精品一区二区| 国产精品久久久久久福利一牛影视 | 欧美国产成人在线| 国产成人免费在线观看不卡| 久久综合一区二区| 国产精品亚洲人在线观看| 久久老女人爱爱| 丁香桃色午夜亚洲一区二区三区 | 欧美精品久久99| 亚洲午夜激情av| 欧美日韩免费不卡视频一区二区三区| 一区二区三区高清不卡| 在线视频亚洲一区| 天天综合色天天| 日韩免费高清av| 国产99久久久精品| 国产精品灌醉下药二区| 色综合一区二区三区| 一区二区三区免费在线观看| 欧美日韩国产一二三| 日韩av不卡一区二区| 国产日韩欧美电影| 日韩一区二区三区免费观看| 美脚の诱脚舐め脚责91| 国产片一区二区三区| 色婷婷精品大视频在线蜜桃视频| 亚洲综合在线电影| 91麻豆精品91久久久久同性| 久久99九九99精品| 国产精品久久久久精k8| 欧美精品久久久久久久久老牛影院| 麻豆精品视频在线| 国产精品卡一卡二卡三| 欧美日韩午夜在线| 国产精品99久| 亚洲综合丝袜美腿| 亚洲精品一区二区三区在线观看| 高清久久久久久| 偷拍自拍另类欧美| 国产精品午夜在线| 宅男在线国产精品| 成人精品gif动图一区| 香蕉乱码成人久久天堂爱免费| 精品久久久久久久人人人人传媒 | 国产成都精品91一区二区三| 国产精品每日更新在线播放网址| 欧美日韩亚州综合| 粉嫩嫩av羞羞动漫久久久| 亚洲第一福利一区| 国产精品天天看| 日韩欧美资源站| 欧美中文一区二区三区| 国产福利91精品| 日韩精品乱码免费| 亚洲日本护士毛茸茸| wwww国产精品欧美| 欧美精品亚洲二区| 色偷偷久久一区二区三区| 国产精品69毛片高清亚洲| 日韩和的一区二区| 亚洲精品免费一二三区| 欧美国产97人人爽人人喊| 日韩精品专区在线影院观看 | 国产欧美日韩精品一区| 日韩一级二级三级精品视频| 色哟哟一区二区| 粉嫩av一区二区三区粉嫩| 经典三级在线一区| 免费在线观看一区| 午夜久久久久久久久| 亚洲欧美色一区| 中文字幕一区二区三区乱码在线| 久久久亚洲高清| 欧美成人性战久久| 91精品婷婷国产综合久久性色| 在线视频综合导航| 91精品办公室少妇高潮对白| 一本色道久久综合狠狠躁的推荐 | 欧美女孩性生活视频| 欧美中文字幕不卡| 精品视频在线看| 欧美做爰猛烈大尺度电影无法无天| k8久久久一区二区三区| 成人av中文字幕| 成人av在线影院| 99免费精品在线观看| 99精品欧美一区二区三区小说| 成人美女在线观看| 91亚洲男人天堂| 色综合欧美在线| 欧美性高清videossexo| 欧美日韩一区二区电影| 欧美日韩一区二区不卡| 日韩午夜在线观看| 精品久久一区二区三区| 国产亚洲一本大道中文在线| 国产欧美日韩在线视频| 亚洲人成在线观看一区二区| 一区二区三区产品免费精品久久75| 亚洲一卡二卡三卡四卡五卡| 午夜精品成人在线视频| 美女视频网站久久| 成人综合在线网站| 欧美午夜精品一区二区三区| 6080国产精品一区二区| 亚洲精品在线电影| 中文字幕亚洲综合久久菠萝蜜| 亚洲欧美日韩国产手机在线| 午夜精品一区二区三区免费视频 | 色哟哟一区二区三区| 欧美精品亚洲一区二区在线播放| 精品免费国产二区三区| 国产精品久久国产精麻豆99网站| 一区二区三区日韩精品视频| 麻豆精品蜜桃视频网站| 99久久精品情趣| 5858s免费视频成人| 国产精品国产馆在线真实露脸 | 日韩视频不卡中文| 国产精品电影一区二区三区| 天堂一区二区在线| 成人蜜臀av电影| 日韩一区二区三区电影| 日本一二三不卡| 日本系列欧美系列| 91伊人久久大香线蕉| 精品久久久久久久久久久院品网 | 91精品国产综合久久久久久久| 久久亚洲捆绑美女| 亚洲伦理在线精品| 国产一区二区三区免费| 91久久线看在观草草青青| 精品少妇一区二区三区日产乱码| 亚洲欧美在线视频观看| 精品一区二区免费在线观看| 91在线视频在线| 久久一二三国产| 亚洲成人免费电影| av福利精品导航| 国产日产欧美精品一区二区三区| 亚洲va国产天堂va久久en| 99久久精品免费看国产免费软件| 精品日韩99亚洲| 日本美女一区二区三区| 色999日韩国产欧美一区二区| 中文乱码免费一区二区| 精品一区二区三区免费| 91精品久久久久久久99蜜桃| 自拍偷自拍亚洲精品播放| 成人在线一区二区三区| 久久网站热最新地址| 裸体健美xxxx欧美裸体表演| 欧美视频一二三区| 亚洲欧美另类综合偷拍| 成人av网在线| 国产日韩欧美电影| 国产成人免费xxxxxxxx| 精品免费视频一区二区| 久久电影网站中文字幕| 欧美一区二区三区视频免费| 偷拍与自拍一区| 在线电影欧美成精品| 婷婷久久综合九色综合绿巨人| 色8久久精品久久久久久蜜| 亚洲黄色免费网站| 色婷婷av一区二区三区gif| 亚洲欧美另类久久久精品| 99久久精品免费精品国产| 自拍偷自拍亚洲精品播放|