亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
丁香六月综合激情| 欧美日韩一级黄| 欧美日韩一二三| 久久婷婷成人综合色| 亚洲免费电影在线| 国模冰冰炮一区二区| 色婷婷精品大在线视频 | 国产欧美精品国产国产专区| 亚洲视频每日更新| 国产成人自拍在线| 日韩一级视频免费观看在线| 亚洲免费看黄网站| 丰满少妇久久久久久久| 欧美精选午夜久久久乱码6080| 国产日韩av一区| 美女脱光内衣内裤视频久久网站| 91一区二区三区在线播放| 欧美成人乱码一区二区三区| 一级特黄大欧美久久久| 国产suv精品一区二区883| 91精品久久久久久蜜臀| 亚洲一区二区三区视频在线 | 制服丝袜av成人在线看| 亚洲蜜桃精久久久久久久| 国产sm精品调教视频网站| 日韩美女在线视频| 日韩不卡在线观看日韩不卡视频| 97se狠狠狠综合亚洲狠狠| 欧美极品另类videosde| 另类成人小视频在线| 欧美一区二区三区在线观看| 亚洲小说春色综合另类电影| 色婷婷av一区二区三区软件| 中文字幕一区二区三区在线不卡| 看片的网站亚洲| 欧美一区二区久久| 久久99精品久久久久| 精品免费国产二区三区| 久久99九九99精品| 久久久久综合网| 国产精品一二三四区| 国产亚洲精品aa午夜观看| 国产精品一区一区三区| 国产亚洲欧美日韩俺去了| 成人教育av在线| 中文字幕一区二区三区不卡在线| av影院午夜一区| 亚洲男女一区二区三区| 一本大道av伊人久久综合| 欧美一级午夜免费电影| 日本aⅴ亚洲精品中文乱码| 在线观看成人小视频| 亚洲视频在线一区观看| 久久成人免费日本黄色| 成人一区二区三区| 色网站国产精品| 国产美女在线观看一区| 91看片淫黄大片一级在线观看| 2023国产精华国产精品| 热久久久久久久| 69精品人人人人| 免费观看一级特黄欧美大片| 欧美一区二区视频在线观看| 久久精品免费观看| 日韩欧美一二三四区| 狠狠色丁香久久婷婷综合丁香| 精品久久久久久亚洲综合网| 久久99精品国产91久久来源| 精品国产91久久久久久久妲己 | 欧美在线你懂的| 亚洲综合另类小说| 欧美日韩国产在线播放网站| 奇米精品一区二区三区在线观看 | 国产福利视频一区二区三区| 欧美电影免费提供在线观看| 婷婷六月综合网| 91精品国产综合久久婷婷香蕉 | 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 国产亚洲精品精华液| 91蜜桃在线观看| 婷婷综合五月天| 日本电影欧美片| 色综合久久久久综合体桃花网| 日韩一区二区三区观看| 国产一区二区在线免费观看| 国产欧美精品一区aⅴ影院| 91视频一区二区| 亚洲午夜精品在线| 7777女厕盗摄久久久| 国产一区二区三区精品视频| 国产精品传媒在线| 91成人免费在线| 国产成人精品亚洲午夜麻豆| 亚洲免费观看高清完整版在线观看熊 | 欧美成人一区二区| 99国产欧美久久久精品| 美女在线视频一区| 亚洲乱码国产乱码精品精的特点| 欧美一卡2卡三卡4卡5免费| 播五月开心婷婷综合| 水野朝阳av一区二区三区| 国产精品麻豆欧美日韩ww| 91精品国产综合久久小美女| 99久久国产免费看| 狠狠色综合日日| 一区二区三区日韩精品视频| 久久精品亚洲麻豆av一区二区| 91免费版在线看| 精品一区二区三区在线观看 | 国产a久久麻豆| 午夜视频在线观看一区| 国产精品久久久久久久久免费樱桃 | 欧美成人bangbros| 91在线你懂得| 日本午夜一本久久久综合| 亚洲欧美日韩久久| 久久久久青草大香线综合精品| 欧美视频在线观看一区| 99久久婷婷国产综合精品电影| 九九热在线视频观看这里只有精品| 综合激情成人伊人| 日本一区二区三级电影在线观看| 欧美一区二区三区白人| 在线一区二区三区做爰视频网站| 成人短视频下载| 国产一区二区在线观看免费| 麻豆一区二区三| 婷婷激情综合网| 亚洲第一福利视频在线| 亚洲男人的天堂在线观看| 国产一区二区三区免费播放| 99久久精品免费观看| 一区二区三区产品免费精品久久75| 国产精品视频一二| 国产亚洲一区字幕| 欧美激情中文字幕一区二区| 1000部国产精品成人观看| 国产日韩精品一区二区三区| 国产情人综合久久777777| 日韩精品一区二区三区中文不卡 | 日韩午夜激情视频| 91精品久久久久久久91蜜桃| 制服.丝袜.亚洲.中文.综合| 欧美在线一区二区| 欧美日韩成人综合| 欧美一区二区成人| 精品国产免费一区二区三区四区| 欧美成人性福生活免费看| 精品电影一区二区| 国产欧美精品一区aⅴ影院| 国产色一区二区| 国产精品久久久一区麻豆最新章节| 国产精品免费视频一区| 国产精品无码永久免费888| 国产精品不卡在线观看| 亚洲视频 欧洲视频| 亚洲综合成人在线| 蜜桃一区二区三区在线观看| 日本aⅴ免费视频一区二区三区| 欧美a级一区二区| 粉嫩绯色av一区二区在线观看 | 国产精品热久久久久夜色精品三区 | 亚洲一级二级在线| 秋霞电影一区二区| 精品亚洲国产成人av制服丝袜 | 欧美在线不卡一区| 日韩一区二区免费视频| 国产偷国产偷精品高清尤物 | 婷婷久久综合九色综合绿巨人| 日韩av中文字幕一区二区三区| 麻豆成人av在线| 成人免费毛片片v| 日本二三区不卡| 精品福利在线导航| 国产精品女同一区二区三区| 亚洲成a人片在线观看中文| 激情综合五月天| 欧洲中文字幕精品| 精品国产乱码久久久久久老虎| 国产精品福利在线播放| 亚洲日本va午夜在线影院| 日韩国产一区二| 不卡的电影网站| 精品免费视频一区二区| 亚洲婷婷国产精品电影人久久| 日本欧美大码aⅴ在线播放| 国产乱码精品1区2区3区| 91福利精品视频| 国产网站一区二区| 免费看黄色91| 色av成人天堂桃色av| 日韩精品一区二区三区视频 | 中文字幕亚洲欧美在线不卡| 日本视频免费一区| 国产成人av一区二区三区在线| 欧洲精品一区二区三区在线观看| 2024国产精品| 婷婷综合久久一区二区三区| 一本大道av伊人久久综合| 久久麻豆一区二区|