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

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

?? ndirect.c

?? 卡內基梅隆大學(CMU)開發的移動機器人控制開發軟件包。可對多種機器人進行控制
?? C
?? 第 1 頁 / 共 5 頁
字號:
 /********************************************************* * * This source code is part of the Carnegie Mellon Robot * Navigation Toolkit (CARMEN) * * CARMEN Copyright (c) 2002 Michael Montemerlo, Nicholas * Roy, Sebastian Thrun, Dirk Haehnel, Cyrill Stachniss, * and Jared Glover * * CARMEN is free software; you can redistribute it and/or  * modify it under the terms of the GNU General Public  * License as published by the Free Software Foundation;  * either version 2 of the License, or (at your option) * any later version. * * CARMEN is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE.  See the GNU General Public License for more  * details. * * You should have received a copy of the GNU General  * Public License along with CARMEN; if not, write to the * Free Software Foundation, Inc., 59 Temple Place,  * Suite 330, Boston, MA  02111-1307 USA * ********************************************************//* * Ndirect.c * * Implementation file for direct connection to robot, bypassing the need for * the Nserver program. * * Copyright 1991-1998, Nomadic Technologies, Inc. * */char cvsid_host_client_Ndirect_c[] = "$Header: /cvsroot/carmen/carmen/src/base/scoutlib/Ndirect.c,v 1.2 2006/04/06 00:30:08 stachnis Exp $";/* includes */#include <stdlib.h>#include <arpa/inet.h>#include <fcntl.h>#include <termios.h>#include <signal.h>#ifdef __USE_BSD#undef __USE_BSD#include <memory.h>#define __USE_BSD#else#include <memory.h>#endif#include <errno.h>#include <netdb.h>#include <netinet/in.h>#include <stdarg.h>#include <stdio.h>#include <unistd.h>#include <sys/types.h>          #include <sys/socket.h>#include <sys/time.h>           #include "Nclient.h"/* defines *//* from command type.h  */#define AC 1#define SP 2#define PR 3#define PA 4#define VM 5#define MV 43#define CT 6#define GS 7#define NAK 8#define ST 9#define LP 10#define TK 11#define DP 12#define ZR 13#define CONF_IR 14#define CONF_SN 15#define CONF_CP 16#define CONF_LS 17#define CONF_TM 18#define GET_IR 19#define GET_SN 20#define GET_RC 21#define GET_RV 22#define GET_RA 23#define GET_CP 24#define GET_LS 25#define SETUP_LS 26#define GET_BP 27#define CONF_SG 28#define GET_SG 29#define DA 30#define WS 31#define ADD_OBS 32#define DELETE_OBS 33#define MOVE_OBS 34#define CONF_SER  35#define PLACE_ROBOT 36#define NUM_COMMANDS 36#define SPECIAL 128/* error types */#define SERIAL_OPEN_ERROR 1#define SERIAL_WRITE_ERROR 2#define SERIAL_READ_ERROR 3#define SERIAL_PKG_ERROR 4#define SERIAL_TIMEOUT_ERROR 5/* serial setting */#define RE_XMIT 0            /* not re-transmit when failed */#define NORMAL_TIMEOUT     1 /* 1 second */#define CONNECT_TIMEOUT   10 /* 10 seconds */#define SPECIAL_TIMEOUT   30 /* used for user define package *//*  * Define the length of the user buffer (Maximal short). * Due to Protocol bytes, the effective length is 65526  */#define USER_BUFFER_LENGTH	0xFFFF/* from pos.h *//*  * these macros enable the user to determine if the pos-attachment * is desired for a specific sensor, the argument is Smask[ SMASK_POS_DATA ] * to avoid overlap with Nclient.h suffix I for internal */#define POS_INFRARED_PI(x)  ( ( (x) & POS_INFRARED ) ? 1 : 0 )#define POS_SONAR_PI(x)     ( ( (x) & POS_SONAR    ) ? 1 : 0 )#define POS_BUMPER_PI(x)    ( ( (x) & POS_BUMPER   ) ? 1 : 0 )#define POS_LASER_PI(x)     ( ( (x) & POS_LASER    ) ? 1 : 0 )#define POS_COMPASS_PI(x)   ( ( (x) & POS_COMPASS  ) ? 1 : 0 )/* from datatype.h *//* to build a long out ouf four bytes */#define LONG_B(x,y,z,q) ((((x) << 24) & 0xFF000000) | \                         (((y) << 16) & 0x00FF0000) | \                         (((z) <<  8) & 0x0000FF00) | \                         ( (q)        & 0x000000FF) )/* * The voltages have different ranges to account for the fact that the * CPU measurement is taken after lossage on the slip-ring. */#define RANGE_CPU_VOLTAGE        12.0#define RANGE_MOTOR_VOLTAGE      12.85/******************** *                  * * Type definitions * *                  * ********************//* * PosDataAll is a struct that contains the Pos information for * all sensors. It is used to pass/store the Pos info within the  * server. It contains the laser, although the laser is not * used in the dual ported ram. */typedef struct _PosDataAll{  PosData infrared [INFRAREDS];  PosData sonar    [SONARS   ];  PosData bumper;  PosData laser;  PosData compass;} PosDataAll;/******************** *                  * * Global Variables * *                  * ********************/long State[NUM_STATE];        /* State reading */int  Smask[NUM_MASK];         /* Sensor mask */int  Laser[2*NUM_LASER+1];    /* Laser reading *//* connect_type == 1 ---> serial *//* connect_type == 2 ---> socket */int    connect_type           = 1;int    model;char  *device;int    conn_value;int    DEFAULT_SERIAL_BAUD    = 38400;int    DEFAULT_ROBOT_TCP_PORT = 65001;double LASER_CALIBRATION[8]   = { -0.003470,  0.000008, 0.011963,  0.001830,				  27.5535913, 0.000428, 0.031102, -0.444624 };double LASER_OFFSET[2]        = { 0, 0 };/* dummy variables to stay compatible with Nclient.c */char   SERVER_MACHINE_NAME[80] = "";int    SERV_TCP_PORT           = -1;char   Host_name[255]          = "";/******************* *                 * * Local Variables * *                 * *******************/static int             Fd=-1;static unsigned char   buf[BUFSIZE];static unsigned char   *bufp, *bufe;static int             errorp = 0;static int             wait_time;static int             usedSmask[NUM_MASK];       /* mask vector */static int             Robot_id = -1;/* although called special, it is the user buffer */static unsigned char   *special_buffer;static unsigned short  special_answer_size;/* this is where all the incoming posData is stored */static PosDataAll posDataAll;static unsigned long posDataTime;/* for the voltages of motor/CPU as raw data */static unsigned char voltageCPU;static unsigned char voltageMotor;/* the laser mode */static int laser_mode = 51;/******************* *                 * * Functions (fwd) * *                 * *******************//* function declarations */static long posLongExtract    ( unsigned char *inbuf );static unsigned long posUnsignedLongExtract( unsigned char *inbuf );static int posPackageProcess  ( unsigned char *inbuf, PosData *posData );static int timePackageProcess ( unsigned char *inbuf, unsigned long *timeS );static int voltPackageProcess ( unsigned char *inbuf,			        unsigned char *voltCPU,			        unsigned char *voltMotor);static float voltConvert   ( unsigned char reading , float range );/******************************************************* *                                                     * * Helper functions for manipulating bytes and numbers * *                                                     * *******************************************************/static int low_half(unsigned char num){  return (num % 16);}static int high_half(unsigned char num){  return (num / 16);}/*static unsigned char high_byte_signed(int n){  int sign_num;    if (n < 0) sign_num = 128; else sign_num = 0;  return (sign_num + (abs(n) / 256));}*//*static unsigned char low_byte_signed(int n){  return (abs(n) % 256);}*//*static unsigned char high_byte_unsigned(int n){  return (n / 256);}*//*static unsigned char low_byte_unsigned(int n){  return (n % 256);}*/static void signed_int_to_two_bytes(int n, unsigned char *byte_ptr){  int sign_num;    *byte_ptr = (unsigned char)(abs(n) % 256);  byte_ptr++;  if (n < 0) sign_num = 128; else sign_num = 0;  *byte_ptr = (unsigned char)(sign_num + (abs(n) / 256));}static void unsigned_int_to_two_bytes(int n, unsigned char *byte_ptr){  *byte_ptr = (unsigned char)(abs(n) % 256);  byte_ptr++;  *byte_ptr = (unsigned char)(abs(n) / 256);}static int two_bytes_to_signed_int(unsigned char low_byte,				   unsigned char high_byte){  int num;    if (high_byte > 127)    num = (-256 * (high_byte - 128)) - low_byte;  else    num = 256 * high_byte + low_byte;  return (num);}static unsigned int two_bytes_to_unsigned_int(unsigned char low_byte,					      unsigned char high_byte){  unsigned int num;    num = 256 * high_byte + low_byte;  return (num);}static long combine_bumper_vector(unsigned char b1,				  unsigned char b2,				  unsigned char b3){  long num;    num = b1 + (b2 * 256) + (b3 * 65536);  return (num);}static unsigned char bits_to_byte(char bt0, char bt1, char bt2, char bt3,				  char bt4, char bt5, char bt6, char bt7){  unsigned char  rbyte;    rbyte = (unsigned char)(bt0 + (2*bt1) + (4*bt2) + (8*bt3) + (16*bt4) +			  (32*bt5) + (64*bt6) + (128*bt7));  return (rbyte);}static int serial_ready (int fd, int wait){  fd_set          lfdvar;  int             ready;  struct timeval  timeout;    FD_ZERO(&lfdvar);  FD_SET(fd, &lfdvar);    timeout.tv_sec = wait;  timeout.tv_usec = 0;    ready = select(fd+1, &lfdvar, NULL, NULL, &timeout);  return(ready);}/*  * creates a package by adding initial byte, checksum, and end byte * and send the package to robot */static int Write_Pkg(int fd, unsigned char *outbuf){  int i, outbufLen, chk_sum;   int nleft, nwritten;    /* create a package */  outbuf[0] = 1;  chk_sum = 0;  outbufLen = outbuf[1]+1;  for (i=0; i<=outbufLen; i++)    chk_sum = chk_sum + outbuf[i];  chk_sum = chk_sum % 256;  outbufLen++;  outbuf[outbufLen] = chk_sum;  outbufLen++;  outbuf[outbufLen] = 92;  outbufLen++;  /* send package */  for (nleft = outbufLen; nleft > 0; ) {    nwritten = write(fd, outbuf, nleft);    if (nwritten <= 0) {      errorp = SERIAL_WRITE_ERROR;      return(FALSE);    }    nleft = nleft - nwritten;    outbuf = outbuf + nwritten;  }  return(TRUE);}/*  * read response from the robot  */static unsigned char buf_fill(int fd, int conn_type){  int n;    if (conn_type == 1)   {    n = read(fd, buf, BUFSIZE);    if (n < 0) {      printf("error reading serial port\n");      errorp = SERIAL_READ_ERROR;      return(0);    }    else {      if (n == 0) {	printf("serial port read timeout error\n");	errorp = SERIAL_TIMEOUT_ERROR;	return(0);      }    }  } else {    if (serial_ready(Fd, 100)) {      n = read(Fd, buf, BUFSIZE);      if (n < 0) {        printf("TCP/IP communication broken.\n");        errorp = SERIAL_READ_ERROR;        return 0;      } else {        if (n == 0) {          printf("TCP/IP select/read error\n");          errorp = SERIAL_READ_ERROR;          return(0);        }      }    } else {      printf("TCP/IP read timeout error.\n");      errorp = SERIAL_TIMEOUT_ERROR;      return 0;    }  }    bufp = &buf[1];  bufe = buf + n;  return(buf[0]);}static unsigned char GETC(int fd, int conn_type){  if (bufp<bufe)    return(*bufp++);  return(buf_fill(fd, conn_type));}/* * getting package from robot and  * check for package error: initial byte = 1, end byte = 92, check sum */static int Read_Pkg(int fd, int conn_type, unsigned char *inbuf){

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜视频在线| 久久网站热最新地址| 亚洲精品成人精品456| 91美女视频网站| 亚洲国产人成综合网站| 3atv一区二区三区| 国产一区二区三区观看| 亚洲国产高清在线观看视频| 97久久人人超碰| 亚洲福利视频一区| 精品久久人人做人人爽| 国产成人综合精品三级| 亚洲黄色av一区| 这里只有精品视频在线观看| 国产乱码精品1区2区3区| 亚洲视频在线一区二区| 4438成人网| 不卡电影免费在线播放一区| 一区二区三区四区乱视频| 日韩亚洲国产中文字幕欧美| 成人午夜电影小说| 午夜久久久久久久久| 国产亚洲精品7777| 欧美私人免费视频| 国产精品一区二区视频| 亚洲一区二区美女| 国产亚洲美州欧州综合国| 欧美无乱码久久久免费午夜一区 | 男女性色大片免费观看一区二区| 精品剧情v国产在线观看在线| 99麻豆久久久国产精品免费| 天天色天天操综合| 国产精品久久久久久户外露出| 欧美三级电影在线看| 国产成人自拍在线| 日韩黄色免费电影| 最新成人av在线| 久久综合狠狠综合久久激情 | 国产精品久久久久久久久免费丝袜| 欧美午夜电影一区| 豆国产96在线|亚洲| 青青草原综合久久大伊人精品| 最近日韩中文字幕| 国产网站一区二区三区| 欧美精品一二三| 91麻豆自制传媒国产之光| 国内精品久久久久影院色| 午夜欧美一区二区三区在线播放| 综合中文字幕亚洲| 国产欧美视频一区二区三区| 日韩欧美中文一区| 欧美电影一区二区三区| 日本伦理一区二区| 99这里只有精品| 国产成人午夜精品5599| 蜜桃在线一区二区三区| 午夜久久久久久久久久一区二区| 亚洲精品国产无天堂网2021 | 一区二区三区免费在线观看| 国产欧美精品一区二区色综合| 日韩一区二区三区视频在线| 欧美日韩不卡视频| 欧美日韩亚洲综合一区二区三区| 色综合天天综合网国产成人综合天 | 三级在线观看一区二区 | 8v天堂国产在线一区二区| 99视频一区二区| 不卡的看片网站| 大胆亚洲人体视频| 懂色av中文一区二区三区| 国产精品一区在线观看你懂的| 蜜臀久久久99精品久久久久久| 午夜精品一区二区三区三上悠亚| 一区二区免费在线| 亚洲视频一区在线| 亚洲精品网站在线观看| 亚洲乱码国产乱码精品精98午夜| 亚洲免费在线看| 亚洲综合激情小说| 亚洲aaa精品| 丝袜美腿亚洲色图| 麻豆精品一区二区av白丝在线| 麻豆国产欧美日韩综合精品二区 | 韩国三级中文字幕hd久久精品| 蜜臀久久99精品久久久久宅男| 蜜桃久久av一区| 国产精品一级片在线观看| 国产精品2024| 99国产精品久久久久久久久久久 | 日韩一区二区三| 欧美成人激情免费网| 久久综合久久99| 国产精品国产自产拍在线| 一区二区在线电影| 日日噜噜夜夜狠狠视频欧美人| 免费人成黄页网站在线一区二区| 久草中文综合在线| 成人免费看的视频| 欧美色中文字幕| 日韩久久久久久| 国产精品三级久久久久三级| 亚洲精品自拍动漫在线| 日韩av中文字幕一区二区三区| 国产一区二区三区高清播放| aa级大片欧美| 欧美一卡二卡三卡| 中文字幕欧美区| 亚洲综合免费观看高清完整版| 七七婷婷婷婷精品国产| 国产91精品精华液一区二区三区| 91国在线观看| 日韩欧美中文一区| 亚洲三级电影网站| 日韩不卡免费视频| av午夜精品一区二区三区| 欧美日韩的一区二区| 久久嫩草精品久久久久| 亚洲一区二区三区不卡国产欧美| 国产在线日韩欧美| 在线欧美小视频| 久久久久国产成人精品亚洲午夜| 亚洲最快最全在线视频| 国产在线一区二区| 欧美探花视频资源| 国产精品久久久久影视| 日本 国产 欧美色综合| 99精品欧美一区二区三区小说| 8x8x8国产精品| 亚洲美女屁股眼交3| 狠狠v欧美v日韩v亚洲ⅴ| 欧美日韩精品系列| 亚洲色图一区二区三区| 国产伦精品一区二区三区免费 | 中文字幕 久热精品 视频在线| 亚洲国产中文字幕| 不卡一区二区三区四区| 久久综合久久综合九色| 天堂久久久久va久久久久| 色综合激情久久| 亚洲国产精品国自产拍av| 美女任你摸久久 | 国产一区二区三区四区五区美女 | 日韩欧美亚洲另类制服综合在线 | 中文字幕乱码亚洲精品一区| 青青草原综合久久大伊人精品 | 欧美一区二区成人| 亚洲高清在线视频| 色综合久久88色综合天天| 欧美国产一区视频在线观看| 老汉av免费一区二区三区| 欧美男女性生活在线直播观看| 亚洲欧美激情在线| 99精品欧美一区二区三区小说| 久久精品夜色噜噜亚洲aⅴ| 久久超碰97人人做人人爱| 91精品国产入口| 日韩电影在线观看网站| 欧美日韩午夜在线视频| 亚洲一区二区四区蜜桃| 在线看国产一区二区| 一区二区三区蜜桃| 在线观看视频一区二区欧美日韩| 中文字幕一区二区三区不卡在线 | 麻豆传媒一区二区三区| 5566中文字幕一区二区电影| 亚洲国产精品欧美一二99| 91国产精品成人| 一区二区三区蜜桃| 欧美日韩精品一区二区天天拍小说 | 欧美精品电影在线播放| 香蕉成人伊视频在线观看| 欧美吻胸吃奶大尺度电影| 洋洋av久久久久久久一区| 欧美色区777第一页| 五月婷婷色综合| 日韩亚洲国产中文字幕欧美| 精品一区二区三区久久| 精品国产欧美一区二区| 国产精品99久久久久久宅男| 国产欧美日韩亚州综合| 91毛片在线观看| 亚洲成人第一页| 欧美高清www午色夜在线视频| 奇米色777欧美一区二区| 2021久久国产精品不只是精品| 国产精品一二三四五| 国产精品区一区二区三区| 成人97人人超碰人人99| 尤物在线观看一区| 91精品国产欧美一区二区18| 美女视频黄 久久| 中文字幕精品一区| 欧美亚洲图片小说| 日韩av电影天堂| 国产女主播视频一区二区| caoporn国产一区二区| 亚洲在线免费播放| 日韩一区二区免费视频| 成人激情午夜影院| 午夜精品福利一区二区三区av|