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

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

?? world.cc

?? 一個機器人平臺
?? CC
?? 第 1 頁 / 共 2 頁
字號:
/* *  Stage : a multi-robot simulator. *  Copyright (C) 2001, 2002 Richard Vaughan, Andrew Howard and Brian Gerkey. * *  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 * *//* * Desc: top level class that contains everything * Author: Richard Vaughan, Andrew Howard * Date: 7 Dec 2000 * CVS info: $Id: world.cc,v 1.137.2.1 2002/12/10 00:28:18 rtv Exp $ */#if HAVE_CONFIG_H  #include <config.h>#endif#if HAVE_STRINGS_H  #include <strings.h>#endif//#undef DEBUG//#undef VERBOSE//#define DEBUG //#define VERBOSE#include <errno.h>#include <sys/time.h>#include <sys/wait.h>#include <signal.h>#include <math.h>#include <unistd.h>#include <sys/mman.h>#include <sys/socket.h>#include <semaphore.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <pwd.h>#include <stdio.h>#include <netdb.h>#include <fstream>#include <iostream>#include "world.hh"#include "playerdevice.hh"#include "library.hh"#include "gui.hh"#include "models/bitmap.hh"bool usage = false;void PrintUsage(); // defined in main.ccvoid StageQuit();long int g_bytes_output = 0;long int g_bytes_input = 0;// allocate chunks of 32 pointers for entity storageconst int OBJECT_ALLOC_SIZE = 32;// static member initCEntity* CWorld::root = NULL;///////////////////////////////////////////////////////////////////////////// Default constructorCWorld::CWorld( int argc, char** argv, Library* lib ){  // store the params locally  this->argc = argc;  this->argv = argv;  this->lib = lib;  // seed the random number generator#if HAVE_SRAND48  srand48( time(NULL) );#endif  // Initialise configuration variables  this->ppm = 20;  // matrix is created by a StageIO object  this->matrix = NULL;  // if we are a server, this gets set in the server's constructor  this->worldfile = NULL;  // invalid file descriptor initially  m_log_fd = -1;  m_instance = 0;  // just initialize stuff here  this->entities = NULL;  this->entity_count = 0;  this->entities_size = 0;  m_log_output = false; // enable with -l <filename>  m_console_output = false; // enable with -o      // real time mode by default  // if real_timestep is zero, we run as fast as possible  m_real_timestep = 0.1; //seconds  m_sim_timestep = 0.1; //seconds; - 10Hz default rate   m_step_num = 0;  // start paused  //  m_enable = false;  if( gethostname( m_hostname, HOSTNAME_SIZE ) == -1)    {      perror( "Stage: couldn't get hostname. Quitting." );      exit( -1 );    }  /* now strip off domain */  char* first_dot;  strncpy(m_hostname_short, m_hostname,HOSTNAME_SIZE);  if( (first_dot = strchr(m_hostname_short,'.') ))    *first_dot = '\0';        // get the IP of our host  struct hostent* info = gethostbyname( m_hostname );    if( info )    { // make sure this looks like a regular internet address      assert( info->h_length == 4 );      assert( info->h_addrtype == AF_INET );            // copy the address out      memcpy( &m_hostaddr.s_addr, info->h_addr_list[0], 4 );     }  else    {      PRINT_ERR1( "failed to resolve IP for local hostname \"%s\"\n", 		  m_hostname );    }    // Run the gui by default  this->enable_gui = true;  // default color database file  strcpy( m_color_database_filename, COLOR_DATABASE );  // Initialise clocks  m_start_time = m_sim_time = 0;  memset( &m_sim_timeval, 0, sizeof( struct timeval ) );      // Initialise entity list  this->entity_count = 0;    // start with no key  bzero(m_auth_key,sizeof(m_auth_key));   assert(lib);  //lib->Print();  // Construct a fixed obstacle representing the boundary of the   // the environment - this the root for all other entities  assert( root = (CEntity*)new CBitmap( lib->LibraryItemFromToken( "bitmap" ), this, NULL) );    // give the command line a chance to override the default values  // we just set  if( !ParseCmdLine( this->argc, this->argv ))   {    quit = true;    return;  }  // give the GUI a go at the command line too  if( enable_gui )  GuiInit( argc, argv ); }///////////////////////////////////////////////////////////////////////////// DestructorCWorld::~CWorld(){  if( matrix )    delete matrix;  if( root )    delete root;}///////////////////////////////////////////////////////////////////////////// Parse the command linebool CWorld::ParseCmdLine(int argc, char **argv){  for( int a=1; a<argc; a++ )    {         // USAGE      if( (strcmp( argv[a], "-?" ) == 0) || 	  (strcmp( argv[a], "--help") == 0) )	{	  PrintUsage();	  exit(0); // bail right here	}            // LOGGING      if( strcmp( argv[a], "-l" ) == 0 )	{	  m_log_output = true;	  strncpy( m_log_filename, argv[a+1], 255 );	  printf( "[Logfile %s (undocumented/experimental)]", m_log_filename );		  //store the command line for logging later	  memset( m_cmdline, 0, sizeof(m_cmdline) );		  for( int g=0; g<argc; g++ )	    {	      strcat( m_cmdline, argv[g] );	      strcat( m_cmdline, " " );	    }		  a++;		  // open the log file and write out a header	  LogOutputHeader();	}          // DIS/ENABLE GUI      if( strcmp( argv[a], "-g" ) == 0 )	{	  this->enable_gui = false;	  printf( "[No GUI]" );	}                // SET GOAL REAL CYCLE TIME      // Stage will attempt to update at this speed      if( strcmp( argv[a], "-u" ) == 0 )	{	  m_real_timestep = atof(argv[a+1]);	  printf( "[Real time per cycle %f sec]", m_real_timestep );	  a++;	}            // SET SIMULATED UPDATE CYCLE      // one cycle simulates this much time      else if( strcmp( argv[a], "-v" ) == 0 )	{	  m_sim_timestep = atof(argv[a+1]);	  printf( "[Simulated time per cycle %f sec]", m_sim_timestep );	  a++;	}            // DISABLE console output      if( strcmp( argv[a], "-o" ) == 0 )	{	  m_console_output = true;	  printf( "[Console Output]" );	}            //else if( strcmp( argv[a], "-id" ) == 0 )      //{      //  memset( m_hostname, 0, 64 );      //  strncpy( m_hostname, argv[a+1], 64 );      //  printf( "[ID %s]", m_hostname ); fflush( stdout );      //  a++;      //}    }      return true;}///////////////////////////////////////////////////////////////////////////// Startup routine bool CWorld::Startup(){    PRINT_DEBUG( "** STARTUP **" );    // we must have at least one entity to play with!  // they should have been created by server or client before here  if( this->entity_count < 1 )    {      puts( "\nStage: No entities defined in world file. Nothing to simulate!" );      return false;    }  // Initialise the real time clock  // Note that we really do need to set the start time to zero first!  m_start_time = 0;  m_start_time = GetRealTime();      // Initialise the rate counter  m_update_ratio = 1;  m_update_rate = 0;      #ifdef DEBUG  //root->Print( "" );#endif  // use the generic hook to start the GUI  if( this->enable_gui ) GuiWorldStartup( this );  // Startup all the entities. they will create and initialize their  // device files and Gui stuff  if( !root->Startup() )    {      PRINT_ERR("Root Entity startup failed" );      quit = true;      return false;    }  PRINT_DEBUG( "** STARTUP DONE **" );  return true;}    ///////////////////////////////////////////////////////////////////////////// Shutdown routine bool CWorld::Shutdown(){  PRINT_DEBUG( "world shutting down" );    // use the hook to shutdown the GUI  if( this->enable_gui ) GuiWorldShutdown( this );    // Shutdown all the entities  // Devices will unlink their device files  root->Shutdown();  return true;}///////////////////////////////////////////////////////////////////////////// Update the worldvoid CWorld::Update(void){  PRINT_DEBUG( "** Update **" );        // let the entities do anything they want to do between clock increments  //root->Sync();         // set the current time and update the entities managed by this host  if( this->m_enable )    {      root->Update(this->SetClock( m_sim_timestep, m_step_num ));            // increase the time step counter      m_step_num++;        }    // all the entities are done, now let's draw the graphics  if( this->enable_gui )  GuiWorldUpdate( this );}double CWorld::SetClock( double interval, uint32_t step_num ){	    // Update the simulation time (in both formats)  m_sim_time = step_num * interval;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产三级欧美三级日产三级99| 狠狠色狠狠色综合| 欧美aⅴ一区二区三区视频| 激情综合网激情| 欧美在线免费观看视频| 国产婷婷色一区二区三区| 亚洲五码中文字幕| 波多野结衣欧美| 久久综合狠狠综合久久激情 | 成人在线视频首页| 欧美一区二区大片| 亚洲一区二区三区影院| 99久久777色| 久久精品人人爽人人爽| 日韩精品乱码免费| 欧美综合在线视频| 中文字幕一区在线| 国产成人免费视频网站| 精品日韩欧美在线| 日本成人中文字幕| 欧美日韩精品系列| 一个色妞综合视频在线观看| 成人高清视频免费观看| 国产亚洲一区字幕| 久久国产精品第一页| 欧美一区二区二区| 日本一不卡视频| 日韩视频免费观看高清完整版| 亚洲午夜在线电影| 在线观看免费一区| 婷婷久久综合九色综合伊人色| 色综合av在线| 亚洲一区在线看| 欧美亚洲一区二区在线观看| 亚洲欧美自拍偷拍色图| 一本大道久久精品懂色aⅴ| 成人欧美一区二区三区| kk眼镜猥琐国模调教系列一区二区| 国产欧美精品国产国产专区| 国产精品一二三区| 国产欧美日本一区二区三区| 成人高清在线视频| 国产精品美女久久久久久久久久久 | 91浏览器打开| 亚洲色图另类专区| 日本韩国欧美一区| 婷婷国产在线综合| 欧美一区午夜视频在线观看| 麻豆91在线播放| 国产婷婷色一区二区三区| 国产成人午夜精品5599| 亚洲免费视频中文字幕| 99久久精品免费看| 亚洲福利电影网| 久久亚区不卡日本| 成人a级免费电影| 亚洲影视在线播放| 精品日韩在线一区| 成人av资源在线| 亚洲第一在线综合网站| 欧美成人精品3d动漫h| 懂色av一区二区三区免费观看| 亚洲黄色小说网站| 日韩女优av电影在线观看| 成人午夜伦理影院| 一区二区三区美女| 欧美精品一区二区蜜臀亚洲| av在线综合网| 日韩高清一区二区| 国产精品家庭影院| 欧美精品电影在线播放| 风间由美中文字幕在线看视频国产欧美| 成人免费一区二区三区视频| 欧美高清性hdvideosex| 国产成人亚洲综合色影视| 亚洲国产精品一区二区尤物区| 精品久久久久99| 在线观看免费视频综合| 国产一区二区网址| 亚洲一区免费视频| 国产欧美一区二区三区网站| 欧美日韩国产美| 91蜜桃免费观看视频| 激情图区综合网| 亚洲一区二区三区视频在线| 国产精品视频yy9299一区| 91麻豆精品国产自产在线| 99视频精品免费视频| 麻豆高清免费国产一区| 亚洲午夜精品久久久久久久久| 国产精品欧美极品| 日韩免费观看高清完整版 | 国产精品久久久久久户外露出 | 不卡的av电影| 国产一区二区毛片| 麻豆91精品91久久久的内涵| 亚洲综合免费观看高清完整版 | 国产老妇另类xxxxx| 肉色丝袜一区二区| 亚洲精品亚洲人成人网| 国产精品美女久久久久久| 精品国产123| 欧美一区二区网站| 欧美喷水一区二区| 欧美性videosxxxxx| 色婷婷综合久色| 91小视频在线观看| 成人av在线观| 成人精品在线视频观看| 韩国中文字幕2020精品| 久久精品免费看| 青青草国产成人99久久| 天堂av在线一区| 亚洲bt欧美bt精品| 日韩在线播放一区二区| 五月婷婷色综合| 天天综合日日夜夜精品| 亚洲福中文字幕伊人影院| 亚洲电影你懂得| 亚洲一级二级三级在线免费观看| 亚洲天堂av一区| 一区二区三区中文字幕精品精品 | 爽爽淫人综合网网站| 婷婷成人激情在线网| 午夜精品视频一区| 日韩不卡免费视频| 精品无人区卡一卡二卡三乱码免费卡| 免费成人在线播放| 久久国产综合精品| 国产成人免费视| 99免费精品视频| 在线视频综合导航| 欧美日韩国产在线观看| 日韩一级完整毛片| 国产亚洲欧美中文| 中文字幕日韩精品一区| 亚洲六月丁香色婷婷综合久久 | 国产在线精品一区二区夜色| 精品一区二区三区蜜桃| 成人一区二区三区在线观看| 99视频有精品| 6080yy午夜一二三区久久| 亚洲精品一区二区三区99| 国产精品电影一区二区三区| 一区二区三区高清在线| 青青青伊人色综合久久| 高清国产一区二区三区| 欧洲人成人精品| 欧美精品一区二区精品网| 国产精品你懂的| 日韩经典一区二区| 懂色av中文字幕一区二区三区 | 成人免费不卡视频| 欧美日韩在线直播| 精品国产91亚洲一区二区三区婷婷| 国产精品视频看| 日韩精品一级中文字幕精品视频免费观看| 久久97超碰色| 在线精品视频一区二区三四 | 精品污污网站免费看| 久久精品视频网| 午夜久久久影院| 成人精品在线视频观看| 日韩一本二本av| 伊人一区二区三区| 国产精品99久久久久久久女警 | 91年精品国产| 日韩精品中文字幕一区二区三区| 亚洲日本一区二区三区| 美女一区二区视频| 欧美三片在线视频观看| 国产婷婷一区二区| 免费在线观看一区| 日本国产一区二区| 国产日韩精品一区二区浪潮av| 午夜婷婷国产麻豆精品| 97久久人人超碰| 久久免费看少妇高潮| 日韩国产高清在线| 欧美羞羞免费网站| 中文字幕一区二区不卡 | 一本大道久久a久久精二百| 精品国产乱码久久久久久久久| 亚洲欧美另类久久久精品2019| 国产一区二区三区综合| 日韩一区二区三区av| 五月天欧美精品| 在线中文字幕一区二区| 中文字幕日韩一区| 成人动漫视频在线| 亚洲国产精品黑人久久久| 国产自产2019最新不卡| 欧美v亚洲v综合ⅴ国产v| 日韩中文字幕区一区有砖一区| 色综合久久66| 亚洲一区免费视频| 在线日韩av片| 亚洲制服丝袜av| 欧洲精品一区二区三区在线观看| 亚洲天堂av一区|