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

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

?? passthrough.cc

?? 機器人仿真平臺,和stage配合運行
?? CC
字號:
/* *  Player - One Hell of a Robot Server *  Copyright (C) 2000  Brian Gerkey   &  Kasper Stoy *                      gerkey@usc.edu    kaspers@robotics.usc.edu * *  This program 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. * *  This program 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 this program; if not, write to the Free Software *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA * *//* * $Id: passthrough.cc,v 1.4.4.3 2003/04/23 23:29:59 inspectorg Exp $ * * a pass-through driver that acts as a client to another Player server, * shifting data (and maybe commands) back and forth, making it seem as if  * remote devices are actually local */#include <stdlib.h>#include <sys/time.h>#include <string.h>// we'll use the C client facilities to connect to the remote server#include <playercclient.h>#include <deviceregistry.h>  // for lookup_interface()#include <device.h>#include <drivertable.h>#include <devicetable.h>#include <player.h>extern CDeviceTable* deviceTable;extern int global_playerport;class PassThrough:public CDevice {  private:    // info for the server/device to which we will connect    const char* remote_hostname;    int remote_port;    player_device_id_t remote_device_id;    unsigned char remote_access;    char remote_drivername[PLAYER_MAX_DEVICE_STRING_LEN];    // bookkeeping for the client connection    player_connection_t conn;    char* remote_data;    char* remote_command;    char* remote_config;    char* remote_reply;    // this function will be run in a separate thread    virtual void Main();    // close and cleanup    void CloseConnection();  public:    PassThrough(const char* hostname, int port,                player_device_id_t id, char* interface,                 ConfigFile* cf, int section);    virtual ~PassThrough();    virtual int Setup();    virtual int Shutdown();};// initialization functionCDevice* PassThrough_Init(char* interface, ConfigFile* cf, int section){  player_interface_t interf;  player_device_id_t id;  int port;  const char* host;  // determine the code for the interface that we have been asked to support  if(lookup_interface(interface, &interf) < 0)  {    PLAYER_ERROR1("couldn't find interface code for \"%s\"", interface);    return(NULL);  }  host = cf->ReadString(section, "host", "localhost");  port = cf->ReadInt(section, "port", global_playerport);  //id.robot = cf->ReadInt(section, "robot", 0);  id.port = port;  id.code = interf.code;  id.index = cf->ReadInt(section, "index", 0);  if(!strcmp(host,"localhost") && (port == global_playerport))  {    PLAYER_ERROR("passthrough connected to itself; you should specify\n the hostname and/or port of the remote server in the configuration file");    return(NULL);  }  return((CDevice*)(new PassThrough(host, port, id, interface, cf, section)));}// a driver registration functionvoid PassThrough_Register(DriverTable* table){  table->AddDriver("passthrough", PLAYER_ALL_MODE, PassThrough_Init);}PassThrough::PassThrough(const char* hostname, int port,                         player_device_id_t id, char* interface,                          ConfigFile* cf, int section) :  CDevice(PLAYER_MAX_PAYLOAD_SIZE,PLAYER_MAX_PAYLOAD_SIZE,1,1){  this->remote_hostname = hostname;  this->remote_port = port;  this->remote_device_id = id;  this->remote_access = (unsigned char)cf->ReadString(section, "access", "a")[0];  assert(this->remote_data = (char*)calloc(PLAYER_MAX_PAYLOAD_SIZE,1));  assert(this->remote_command = (char*)calloc(PLAYER_MAX_PAYLOAD_SIZE,1));  assert(this->remote_config = (char*)calloc(PLAYER_MAX_PAYLOAD_SIZE,1));  assert(this->remote_reply = (char*)calloc(PLAYER_MAX_PAYLOAD_SIZE,1));}voidPassThrough::CloseConnection(){  if(this->conn.sock >=0)    player_disconnect(&this->conn);  PutData(NULL,0,0,0);}PassThrough::~PassThrough(){  free(this->remote_data);  free(this->remote_command);  free(this->remote_config);  free(this->remote_reply);}int PassThrough::Setup(){  unsigned char grant_access;  CDeviceEntry* devp;  player_msghdr_t hdr;  // zero out the buffers  PutData(NULL,0,0,0);  PutCommand(NULL,NULL,0);  printf("Passthrough connecting to server at %s:%d...", this->remote_hostname,         this->remote_port);  // connect to the server  if(player_connect(&this->conn,this->remote_hostname,this->remote_port) < 0)  {    PLAYER_ERROR1("couldn't connect to remote host \"%s\"",                   this->remote_hostname);    return(-1);  }  puts("Done");  printf("Passthrough opening device %d:%d:%d...",          this->remote_device_id.port,         this->remote_device_id.code,         this->remote_device_id.index);  // open the device  if((player_request_device_access(&this->conn,                                   this->remote_device_id.code,                                   this->remote_device_id.index,                                   this->remote_access,                                   &grant_access,                                   this->remote_drivername,                                   sizeof(this->remote_drivername)) < 0) ||     (grant_access != this->remote_access))  {    PLAYER_ERROR("couldn't get requested access to remote device");    CloseConnection();    return(-1);  }  puts("Done");  // set the driver name in the devicetable  if(!(devp = deviceTable->GetDeviceEntry(this->device_id)))  {    PLAYER_ERROR("couldn't find my own entry in the deviceTable");    CloseConnection();    return(-1);  }  strncpy(devp->name,this->remote_drivername,PLAYER_MAX_DEVICE_STRING_LEN);      for(;;)  {    // wait for one data packet from the remote server, to avoid sending    // zero length packets to our clients    if(player_read(&this->conn,&hdr,this->remote_data,PLAYER_MAX_PAYLOAD_SIZE))    {      PLAYER_ERROR("got error while reading data; bailing");      CloseConnection();      return(-1);    }    if((hdr.type == PLAYER_MSGTYPE_DATA) &&       (hdr.device == this->remote_device_id.code) &&       (hdr.device_index == this->remote_device_id.index))    {      PutData(this->remote_data,hdr.size,              hdr.timestamp_sec,hdr.timestamp_usec);      break;    }  }  StartThread();  return(0);}int PassThrough::Shutdown(){  StopThread();  CloseConnection();  return(0);}voidPassThrough::Main(){  size_t len_command;  size_t len_config;  player_msghdr_t hdr;  void* client;  player_msghdr_t replyhdr;  player_device_id_t id;  struct timeval ts;  for(;;)  {    // did we get a config request?    if((len_config =         GetConfig(&id,&client,this->remote_config,PLAYER_MAX_PAYLOAD_SIZE)) > 0)    {      // send it      if(player_request(&this->conn,this->remote_device_id.code,                        this->remote_device_id.index,this->remote_config,                        len_config,&replyhdr,                        this->remote_reply,PLAYER_MAX_PAYLOAD_SIZE) < 0)      {        PLAYER_ERROR("got error while sending request; bailing");        CloseConnection();        pthread_exit(NULL);      }      ts.tv_sec = replyhdr.timestamp_sec;      ts.tv_usec = replyhdr.timestamp_usec;      // return the reply      PutReply(&id,client,replyhdr.type,&ts,this->remote_reply,replyhdr.size);    }    // did we get a new command to send?    if((len_command = GetCommand((unsigned char*)this->remote_command,                         PLAYER_MAX_PAYLOAD_SIZE)) > 0)    {      if(player_write(&this->conn,this->remote_device_id.code,                      this->remote_device_id.index,this->remote_command,                      len_command) < 0)      {        PLAYER_ERROR("got error while writing command; bailing");        CloseConnection();        pthread_exit(NULL);      }    }    // get new data from the remote server    if(player_read(&this->conn,&hdr,this->remote_data,PLAYER_MAX_PAYLOAD_SIZE))    {      PLAYER_ERROR("got error while reading data; bailing");      CloseConnection();      pthread_exit(NULL);    }    if((hdr.type == PLAYER_MSGTYPE_DATA) &&       //(hdr.robot == this->remote_device_id.robot) &&       (hdr.device == this->remote_device_id.code) &&       (hdr.device_index == this->remote_device_id.index))    {      PutData(this->remote_data,hdr.size,              hdr.timestamp_sec,hdr.timestamp_usec);    }  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区在线观看免费观看电影高清| 欧美三级中文字幕| 中文字幕国产精品一区二区| 国产福利91精品一区| 国产精品午夜电影| 一本色道久久综合亚洲精品按摩| 亚洲影院免费观看| 欧美一区二区三区啪啪| 久久99久久99小草精品免视看| 久久综合色8888| 不卡区在线中文字幕| 亚洲综合色在线| 欧美一区二区三区在线看| 国产在线观看免费一区| 国产精品免费丝袜| 欧美午夜精品一区二区三区| 日韩精品久久理论片| 精品国产乱码久久久久久浪潮| 成人av电影在线| 一区二区三区在线观看视频| 欧美精品乱人伦久久久久久| 国产精品小仙女| 亚洲一区在线观看免费观看电影高清 | 欧美日韩精品欧美日韩精品一 | 国产精品一区二区视频| 国产精品国产三级国产| 欧美日韩国产a| 成人午夜在线视频| 天天影视色香欲综合网老头| 国产欧美日韩另类视频免费观看| 91国产丝袜在线播放| 精品一区二区三区影院在线午夜| 国产精品成人一区二区三区夜夜夜| 欧美日韩极品在线观看一区| 成人综合婷婷国产精品久久蜜臀| 亚洲国产精品欧美一二99| 国产欧美精品在线观看| 欧美色网站导航| 成人午夜私人影院| 蜜臀av一区二区| 亚洲乱码国产乱码精品精小说| 日韩午夜电影av| 在线观看一区不卡| 成人h动漫精品一区二| 久久99精品国产.久久久久| 亚洲黄色av一区| 国产精品热久久久久夜色精品三区| 91麻豆精品国产91久久久资源速度| 成人avav在线| 国产成人日日夜夜| 麻豆免费精品视频| 午夜精品福利在线| 亚洲人成在线播放网站岛国| 久久久久久久免费视频了| 91精品欧美综合在线观看最新| 91在线精品一区二区三区| 国产成人在线视频网址| 毛片不卡一区二区| 日本麻豆一区二区三区视频| 亚洲午夜一区二区三区| 亚洲精品成人少妇| 亚洲欧美综合网| 国产精品久久久久久久岛一牛影视| 精品国产一区二区三区av性色| 欧美精品三级在线观看| 欧美三级欧美一级| 欧美少妇bbb| 在线观看国产精品网站| 一本色道久久加勒比精品| 成人av电影免费在线播放| 成人免费毛片高清视频| 成人免费观看av| 国产91清纯白嫩初高中在线观看| 国产在线播精品第三| 久久99国内精品| 精品在线免费观看| 精品亚洲国内自在自线福利| 蜜桃一区二区三区在线| 捆绑紧缚一区二区三区视频| 老司机精品视频在线| 久久超碰97中文字幕| 国产一区二区三区免费看| 久久99精品一区二区三区三区| 看国产成人h片视频| 国产一二三精品| 国产一区二区三区av电影| 国产一区二区h| 成人视屏免费看| 色综合久久久久网| 欧美性一区二区| 在线成人免费观看| 美国av一区二区| 亚洲不卡一区二区三区| 亚洲国产另类av| 亚洲成人av中文| 日韩成人一区二区| 精品一区二区三区免费播放| 国产一区久久久| av在线免费不卡| 欧美色网一区二区| 精品国免费一区二区三区| 久久久99精品久久| 亚洲色图制服诱惑| 性做久久久久久久免费看| 免费人成精品欧美精品| 久久国产夜色精品鲁鲁99| 91丨九色丨尤物| 国产精品久久夜| 亚洲精品一二三| 日本aⅴ亚洲精品中文乱码| 激情伊人五月天久久综合| 国产高清在线观看免费不卡| 色婷婷综合久色| 3d成人动漫网站| 亚洲国产经典视频| 亚洲图片欧美视频| 国产一区二区三区观看| 成人一区二区三区中文字幕| 欧美综合久久久| 久久无码av三级| 一区二区三区蜜桃网| 九九九精品视频| 在线免费观看日本欧美| 久久中文娱乐网| 亚洲无线码一区二区三区| 韩日精品视频一区| 色8久久精品久久久久久蜜| 538在线一区二区精品国产| 国产欧美一区二区三区鸳鸯浴| 午夜欧美大尺度福利影院在线看| 国产不卡在线播放| 日韩午夜中文字幕| 亚洲男帅同性gay1069| 国内欧美视频一区二区| 色噜噜狠狠色综合欧洲selulu| 精品国产乱码久久久久久图片 | 国产精品网站一区| 日韩和欧美一区二区三区| av午夜一区麻豆| 久久久亚洲精品石原莉奈 | 亚洲视频一区在线| 国产在线精品一区二区不卡了 | 奇米影视一区二区三区小说| 色综合天天在线| 国产欧美一区二区精品婷婷| 男人操女人的视频在线观看欧美| 91亚洲国产成人精品一区二区三| 久久精品男人天堂av| 老司机精品视频导航| 欧美日本一区二区三区四区 | 亚洲国产激情av| 国产精品乡下勾搭老头1| 欧美一区二区三区的| 午夜欧美视频在线观看| 欧美性大战xxxxx久久久| 亚洲欧洲综合另类在线| 成人av电影在线播放| 国产精品麻豆一区二区| 国产老肥熟一区二区三区| 精品三级在线观看| 美女任你摸久久| 日韩欧美中文字幕制服| 美女视频免费一区| 日韩午夜小视频| 青青草精品视频| 精品国产亚洲在线| 国产中文字幕精品| 久久久精品影视| 国产精品一区二区在线观看网站| 欧美mv和日韩mv国产网站| 精品综合久久久久久8888| 精品成人一区二区三区四区| 国产一区二区按摩在线观看| 久久久综合精品| 丁香桃色午夜亚洲一区二区三区 | 国产精品久久久久影院| www.日韩av| 亚洲免费观看高清完整版在线观看熊| 99r精品视频| 亚洲国产成人精品视频| 在线综合亚洲欧美在线视频| 美女视频黄久久| 久久久91精品国产一区二区三区| 成人免费不卡视频| 一区二区三区四区不卡在线| 精品视频一区二区三区免费| 日韩中文欧美在线| 久久夜色精品国产噜噜av| 本田岬高潮一区二区三区| 亚洲综合色噜噜狠狠| 日韩一二三区视频| 国产很黄免费观看久久| 综合av第一页| 欧美一区二区三区日韩视频| 成人av先锋影音| 婷婷开心久久网| 久久色中文字幕| 在线精品视频一区二区| 久久激五月天综合精品| 中文字幕亚洲成人|