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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? idardevice.cc

?? 一個(gè)機(jī)器人平臺(tái)
?? CC
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/******************************************************************************* File: irdevice.cc* Author: Richard Vaughan* Date: 22 October 2001* Desc: Simulates a single sensor of HRL's Infrared Data and Ranging Device** 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** CVS info:* $Source: /cvsroot/playerstage/code/stage/src/models/Attic/idardevice.cc,v $* $Author: rtv $* $Revision: 1.2 $******************************************************************************/#include <math.h>#include <sys/types.h>#include <sys/socket.h>#include <arpa/inet.h>#include <unistd.h>#include <iostream>#include "world.hh"#include "idardevice.hh"#include "raytrace.hh"#define DEBUG//#undef DEBUG// control display of player index in device body//#define RENDER_INDEX//#define RENDER_SCANLINES//#define SHOW_MSGS#define IDAR_TRANSMIT_ANGLE        M_PI/4.0#define IDAR_RECEIVE_ANGLE        M_PI/4.0#define IDAR_SCANLINES        5#define IDAR_MAX_RANGE       1.0// handy circular normalization macros#define NORMALIZECIRCULAR_INT(value,max) (((value%max)+max)%max)#define NORMALIZECIRCULAR_DOUBLE(value,max) fmod( fmod(value,max)+max, max)#define NORMALIZERADIANS(value)  NORMALIZECIRCULAR_DOUBLE(value,TWOPI)#define NORMALIZEDEGREES(value)  NORMALIZECIRCULAR_DOUBLE(value,360.0)// constructor CIdarDevice::CIdarDevice(LibraryItem* libit, CWorld *world, CEntity *parent )  : CPlayerEntity(libit, world, parent ){  // we're invisible except to other IDARs  laser_return = LaserTransparent;  sonar_return = false;  obstacle_return = false;  idar_return = IDARReceive;  // set the Player IO sizes correctly for this type of Entity  m_data_len    = 0;//sizeof( player_idar_data_t );  m_command_len = 0;//sizeof( player_idar_command_t );  m_config_len  = 1;  m_reply_len  = 1;    m_player.code = PLAYER_IDAR_CODE; // from player's messages.h      m_max_range = IDAR_MAX_RANGE;      size_x = 0.03; // this is the actual physical size of the HRL device  size_y = 0.02; // but can be changed in the world file to suit  // Set the default shape  shape = ShapeRect;  m_interval = 0.001; // updates frequently,  // but only has work to do when it receives a command  // so it's not a CPU hog unless we send it lots of messages   // init the message buffer  memset( &recv, 0, sizeof(recv) );  m_num_scanlines = IDAR_SCANLINES;   m_angle_per_sensor = IDAR_TRANSMIT_ANGLE;  m_angle_per_scanline = m_angle_per_sensor / m_num_scanlines;}///////////////////////////////////////////////////////////////////////////// Startup routine//bool CIdarDevice::Startup(){  if (!CPlayerEntity::Startup())    return false;  return true;}void CIdarDevice::Sync( void ){  // sync our children  CPlayerEntity::Sync();  void *client;  player_idar_config_t cfg;    // Get config  int res = GetConfig( &client, &cfg, sizeof(cfg));    switch( res )    {     case 0:      // nothing available - nothing to do      break;          case -1: // error      PRINT_ERR( "get config failed" );      break;          case sizeof(cfg): // the size we expect - we received a config request      // what does the client want us to do?      switch( cfg.instruction )	{	case IDAR_TRANSMIT:	  //puts( "TX" );	  TransmitMessage( &(cfg.tx) );	  PutReply(client, PLAYER_MSGTYPE_RESP_ACK );	  	  break;	  	case IDAR_RECEIVE:	  //puts( "RX" );	  // send back the currently stored message	  PutReply(client, PLAYER_MSGTYPE_RESP_ACK, NULL, &recv, sizeof(recv));	  ClearMessage(); // wipe the buffer	  break;	  	case IDAR_RECEIVE_NOFLUSH:	  //puts( "RX_NF" );	  // send back the currently stored message	  PutReply(client, PLAYER_MSGTYPE_RESP_ACK, NULL, &recv, sizeof(recv));	  // don't clear the current mesg	  break;	  	  // two in one for efficiency!	case IDAR_TRANSMIT_RECEIVE:	  TransmitMessage( &(cfg.tx) );	  PutReply(client, PLAYER_MSGTYPE_RESP_ACK, NULL, &recv, sizeof(recv));	  ClearMessage(); // wipe the buffer	  break;	default:	  printf( "STAGE warning: unknown idar config instruction %d\n",		  cfg.instruction );	}      break;          default: // a bad value      PRINT_ERR1( "wierd: idar config returned %d ", res );      break;    }}// NOTE unlike most devices, live data is not published here - that's// done in ReceiveMessage()void CIdarDevice::Update( double sim_time ) {  CPlayerEntity::Update( sim_time ); // inherit some debug output    // UPDATE OUR RENDERING  double x, y, th;  GetGlobalPose( x,y,th );    ReMap( x, y, th );    // dump out if noone is subscribed  if(!Subscribed())    {      return;     }    m_last_update = sim_time;}void CIdarDevice::ClearMessage( void ){  // wipe the message (zero the buffer)  memset( &recv, 0, sizeof(recv) );#ifdef INCLUDE_RTK2  // unrender the message   rtk_fig_clear(this->data_fig);#endif}void CIdarDevice::TransmitMessage( idartx_t* transmit ){  // really should be a valid message here  assert( transmit && (transmit->len > 0) );    //#ifdef DEBUG  //printf( "\nTRANSMITTING %d bytes at %p - ",  //transmit->len, transmit->mesg );    //for( int f=0; f<transmit->len; f++ )  //printf( "%d ", transmit->mesg[f] );  //puts ( "" );  //#endif    // now perform the transmission  double ox, oy, oth;  GetGlobalPose( ox, oy, oth ); // start position for the ray trace#ifdef INCLUDE_RTK2  rtk_fig_clear(this->rays_fig);#endif    double scan_start_angle =     (oth - m_angle_per_sensor/2.0) + m_angle_per_scanline/2.0;        for( int scanline=0; scanline < m_num_scanlines; scanline++ )      {		// Compute parameters of scan line	double scanline_bearing = 	scan_start_angle + scanline * m_angle_per_scanline;	      // normalize to make things easier to read      scanline_bearing = fmod( scanline_bearing, TWOPI );	            CLineIterator lit( ox, oy, scanline_bearing, m_max_range,			 m_world->ppm, m_world->matrix,			 PointToBearingRange );	            //printf( "direction %d scanline %d "      //      "from %.2f,%.2f %.2fm at %.2f radians\n",       //      s, scanline, ox, oy, m_max_range, scanline_bearing );	            CEntity* ent;      double range = m_max_range;	            // get the next thing in our beam, until the beam is blocked      while( (ent = lit.GetNextEntity() ) ) 	{	  //printf( "HIT %p type %s idar_return %d (i am %p,%d,%d)\n",	  //ent, ent->token, ent->idar_return,	  //(CEntity*)this, token, idar_return );			  //printf( "IDARReceive == %d\n", IDARReceive );	  // if it's not me or my parent or a sibling and it's not	  // transparent to idar, i'll try sending a message to it	  if( (ent != (CEntity*)this) && 	      (ent != this->m_parent_entity) &&	      (ent->m_parent_entity != this->m_parent_entity) &&	      ( ent->idar_return != IDARTransparent) )	    {		    	      range = lit.GetRange();	      assert( range >= 0 );		   	      //printf( "s:%d.%d range: %.2f\n",	      //    s, scanline, range );	      //printf( "hit entity %p (%d:%d:%d)\n",	      //     ent, ent->m_player.port,  ent->m_player.code,	      //     ent->m_player.index );	      uint8_t intensity;		    	      switch( ent->idar_return )		{		case IDARReceive: // it's a receiver		  // attempt to poke this message into his receiver		  //printf( "TRANSMIT to %p type %s idar_return %d\n",				//ent, ent->token, ent->idar_return );								  //PRINT_DEBUG1( "POKING A MESSAGE INTO %p", ent );		  if( (intensity = LookupIntensity(0,range,false)) > 0 )		    ((CIdarDevice*)ent)->		      ReceiveMessage( (CEntity*)this, 				      transmit->mesg,				      transmit->len,				      intensity,				      false );		  		  // continue to next case, since IR receivers are

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区一区三区| 久久精品视频网| 亚洲精品中文在线影院| 99视频一区二区| 亚洲色图20p| 色婷婷av一区| 偷拍自拍另类欧美| 精品国产一区二区亚洲人成毛片| 韩国成人精品a∨在线观看| 久久久99精品免费观看不卡| 欧美日韩一区二区三区在线看| 奇米综合一区二区三区精品视频| 日韩精品一区二| 高清不卡一二三区| 亚洲欧美日韩在线不卡| 一区二区三区四区亚洲| 欧美三级乱人伦电影| 国产99久久久精品| 九九久久精品视频| 中文字幕一区二区视频| 欧美日韩三级一区二区| 91免费在线视频观看| 亚洲图片欧美视频| 欧美精品一区二区三区在线播放| 欧美在线高清视频| 精品一区二区三区欧美| 日本成人在线网站| |精品福利一区二区三区| 久久久久久亚洲综合影院红桃| 99亚偷拍自图区亚洲| 国产麻豆日韩欧美久久| 一区二区三区加勒比av| 亚洲欧美色图小说| 亚洲视频网在线直播| 欧美极品美女视频| 欧美日韩不卡一区| 成人h动漫精品| 蓝色福利精品导航| 一区二区三区.www| 一区二区高清免费观看影视大全| 日韩伦理免费电影| 风间由美一区二区三区在线观看| 国产一区二区三区黄视频| 蜜臀a∨国产成人精品| 亚洲色大成网站www久久九九| 国产精品视频yy9299一区| 欧美丰满少妇xxxbbb| 99久久综合国产精品| 成人激情小说网站| 91看片淫黄大片一级在线观看| aaa亚洲精品一二三区| av激情亚洲男人天堂| 不卡免费追剧大全电视剧网站| 99re66热这里只有精品3直播| 久久疯狂做爰流白浆xx| 麻豆专区一区二区三区四区五区| 免费看精品久久片| 国产精品影视在线| 福利一区福利二区| 在线亚洲一区二区| 成人午夜激情在线| 麻豆国产精品视频| 国产福利精品一区二区| 久久精品国产在热久久| 激情另类小说区图片区视频区| 国产揄拍国内精品对白| 国产成人精品一区二区三区四区 | 日韩欧美www| 国产婷婷色一区二区三区| 国产人伦精品一区二区| 日韩亚洲欧美在线观看| 欧美精品成人一区二区三区四区| 欧美一区二区黄| 日韩一级片在线播放| 精品裸体舞一区二区三区| 欧美一区二区三区喷汁尤物| 久久久久国产免费免费| 椎名由奈av一区二区三区| 亚洲成人动漫在线免费观看| 亚洲国产精品一区二区www| 美脚の诱脚舐め脚责91 | 国产美女视频91| 福利一区二区在线| 欧美精品色一区二区三区| 久久综合国产精品| 精品国产伦一区二区三区观看方式 | 久久一二三国产| 亚洲女人****多毛耸耸8| 日韩高清电影一区| av激情综合网| 精品国产区一区| 亚洲日本在线视频观看| 琪琪一区二区三区| 日本韩国欧美三级| 26uuu亚洲综合色欧美| 不卡欧美aaaaa| 91精品啪在线观看国产60岁| 制服丝袜亚洲色图| 中文字幕欧美三区| 免费观看成人av| 99热这里都是精品| 欧美成人vr18sexvr| 亚洲电影视频在线| 91视频.com| 国产欧美视频在线观看| 日本伊人色综合网| 欧美午夜精品一区| 欧美一级精品在线| 一区二区三区视频在线看| 高清shemale亚洲人妖| 日韩午夜av一区| 亚洲成a人片在线观看中文| 成人高清在线视频| 亚洲精品在线观| 日韩国产一区二| 欧美综合在线视频| 亚洲激情校园春色| 91网页版在线| 《视频一区视频二区| 成人自拍视频在线| 久久综合九色综合97婷婷| 久久精品久久精品| 精品裸体舞一区二区三区| 午夜不卡av在线| 欧美日韩一级二级三级| 一区二区三区高清不卡| 色婷婷国产精品久久包臀| 国产精品久久久久久妇女6080| 91在线观看视频| 欧美激情资源网| 成人免费福利片| 精品国产乱码91久久久久久网站| 免费看黄色91| 日韩欧美国产三级| 久久国产欧美日韩精品| 日韩一级高清毛片| 经典三级一区二区| 久久先锋影音av鲁色资源网| 黑人精品欧美一区二区蜜桃| 精品奇米国产一区二区三区| 精品一区二区日韩| 精品欧美黑人一区二区三区| 紧缚捆绑精品一区二区| 欧美成人精品1314www| 老色鬼精品视频在线观看播放| 欧美va亚洲va| 国产99久久久久久免费看农村| 国产精品人妖ts系列视频| 成人涩涩免费视频| 亚洲美女偷拍久久| 精品视频在线看| 蜜桃一区二区三区四区| 精品理论电影在线观看| 国产成人高清视频| 1024成人网色www| 8v天堂国产在线一区二区| 久久99精品久久久久| 久久精品免费在线观看| 99r国产精品| 午夜亚洲国产au精品一区二区| 日韩一级片在线播放| 岛国一区二区在线观看| 最新高清无码专区| 欧美精品 国产精品| 久久电影国产免费久久电影| 国产精品理伦片| 欧美午夜精品一区二区三区| 久久99最新地址| 亚洲婷婷在线视频| 欧美一区二区三区影视| 国产一区999| 亚洲一二三四在线| 国产欧美一区在线| 91丨国产丨九色丨pron| 男人的天堂亚洲一区| 国产无遮挡一区二区三区毛片日本| 一本一本大道香蕉久在线精品| 日韩一区精品视频| 欧美高清视频在线高清观看mv色露露十八| 捆绑调教美女网站视频一区| 中文字幕一区二区三区乱码在线 | 日精品一区二区三区| 久久综合色8888| 欧美日韩亚洲另类| 国产福利一区二区三区视频在线| 亚洲一区二区黄色| 国产精品天美传媒| 日韩免费在线观看| 日本韩国欧美在线| 国产69精品久久777的优势| 亚洲成人久久影院| 中文字幕av资源一区| 91精品中文字幕一区二区三区| 不卡一区在线观看| 久久成人18免费观看| 亚洲一区二区三区视频在线播放| 国产欧美日韩在线视频| 欧美猛男男办公室激情| 91视频一区二区三区| 国产成人在线影院 |