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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? bumperdevice.cc

?? 一個(gè)機(jī)器人平臺(tái)
?? CC
字號(hào):
/* *  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: Simulates a set of binary contact switches *        useful as bumpers or whiskers. * Author: Richard Vaughan * Date: 28 Nov 2000 * CVS info: $Id: bumperdevice.cc,v 1.3 2002/11/11 08:21:39 rtv Exp $ */#include <math.h>#include "world.hh"#include "bumperdevice.hh"#include "raytrace.hh"//#include "player.h"#include "world.hh"// constructorCBumperDevice::CBumperDevice( LibraryItem *libit, 			    CWorld *world, CEntity *parent )  : CPlayerEntity(libit, world, parent )    {  // set the Player IO sizes correctly for this type of Entity  m_data_len    = sizeof( player_bumper_data_t );  m_command_len = 0;  m_config_len  = 1; // can request geometry of bumper set  m_reply_len  = 1;    m_player.code = PLAYER_BUMPER_CODE; // from player.h  m_interval = 0.1; // update interval in seconds   // zero the config data  memset( this->bumpers, 0, 	  sizeof(this->bumpers[0])*PLAYER_BUMPER_MAX_SAMPLES );  // a sensible default is 1 straight 10cm sensor facing forwards  this->bumper_count = 1;  this->bumpers[0].x_offset = 0;   this->bumpers[0].y_offset = 0;   this->bumpers[0].th_offset = 0;   this->bumpers[0].length = 0.1;   this->bumpers[0].radius = 0; }///////////////////////////////////////////////////////////////////////////// Startup routine//bool CBumperDevice::Startup(){  if (!CPlayerEntity::Startup())    return false;  return true;}///////////////////////////////////////////////////////////////////////////// Load the entity from the world filebool CBumperDevice::Load(CWorldFile *worldfile, int section){  int i;  int scount;  char key[256];    if (!CPlayerEntity::Load(worldfile, section))    return false;  // Load the geometry of the bumper ring  scount = worldfile->ReadInt(section, "bcount", 0);  if (scount > 0)  {    this->bumper_count = scount;    for (i = 0; i < this->bumper_count; i++)    {      snprintf(key, sizeof(key), "bpose[%d]", i);      this->bumpers[i].x_offset =         worldfile->ReadTupleLength(section, key, 0,                                     this->bumpers[i].x_offset );      this->bumpers[i].y_offset =         worldfile->ReadTupleLength(section, key, 1,                                    this->bumpers[i].y_offset );      this->bumpers[i].th_offset =         worldfile->ReadTupleAngle(section, key, 2,                                   this->bumpers[i].th_offset );      this->bumpers[i].length =         worldfile->ReadTupleLength(section, key, 3,                                    this->bumpers[i].length );            this->bumpers[i].radius =         worldfile->ReadTupleLength(section, key, 4,                                   this->bumpers[i].radius );    }  }    //printf( "bumper count %d\n", this->bumper_count );  // convert those specs into internal scanline repn.  for (i = 0; i < this->bumper_count; i++)  {    if( this->bumpers[i].radius == 0 )    {       //printf( "bumper #%d is a straight line\n", i );      // straight line scan      // shift from center to end of arc            double cx = this->bumpers[i].x_offset ;      double cy = this->bumpers[i].y_offset;      // rotate the angle 90 deg      double oth = this->bumpers[i].th_offset + M_PI/2.0;      double len = this->bumpers[i].length;	        double dx = len/2.0 * cos(oth);      double dy = len/2.0 * sin(oth);	        this->scanlines[i].x_offset = cx - dx;      this->scanlines[i].y_offset = cy - dy;      this->scanlines[i].th_offset = oth;      this->scanlines[i].length = len;      this->scanlines[i].radius = this->bumpers[i].radius;    }    else // arc scan    {      //printf( "bumper #%d is an arc\n", i );      // no need for processing for arcs - just copy the setup in      memcpy( &this->scanlines[i],               &this->bumpers[i],               sizeof(this->bumpers[i]) );    }  }  return true;}///////////////////////////////////////////////////////////////////////////// Update the bumper datavoid CBumperDevice::Update( double sim_time ) {  CPlayerEntity::Update( sim_time );  // dump out if noone is subscribed  if(!Subscribed())    return;  // Check to see if it is time to update  //  - if not, return right away.  if( sim_time - m_last_update < m_interval)    return;  m_last_update = sim_time;  // Process configuration requests  UpdateConfig();    // the data to export to player  player_bumper_data_t data;  // Check bounds  assert((size_t) this->bumper_count <= ARRAYSIZE(data.bumpers));  // Do each bumper  for (int s = 0; s < this->bumper_count; s++)  {    double ox = this->scanlines[s].x_offset;    double oy = this->scanlines[s].y_offset;    double oth = this->scanlines[s].th_offset;    double len = this->scanlines[s].length;    double radius = this->scanlines[s].radius;          LocalToGlobal(ox, oy, oth);          if(  radius == 0.0 )    {      // straight line scan      CLineIterator lit( ox, oy, oth, len,                          m_world->ppm, m_world->matrix, PointToBearingRange );      data.bumpers[s] = (uint8_t)0; // no hit so far	        CEntity* ent;      while( (ent = lit.GetNextEntity()) )	    {	      if( ent!=this && ent!=m_parent_entity && ent->obstacle_return )         {          data.bumpers[s] = (uint8_t)1; // we're touching something!          break;        }	    }    }    else // arc scan    {	        double scan_th = len/radius;      //printf( "request scan (%.2f %.2f %.2f) radius %.2f scan_th %.2f\n",      //  ox, oy, oth, radius, scan_th );      CArcIterator ait( ox, oy, oth, radius, scan_th,                         m_world->ppm, m_world->matrix );	        data.bumpers[s] = (uint8_t)0; // no hit so far	        CEntity* ent;      while( (ent = ait.GetNextEntity()) )	    {	      if( ent!=this && ent!=m_parent_entity && ent->obstacle_return            && ent != m_world->root )         {          data.bumpers[s] = (uint8_t)1; // we're touching something!          break;        }	    }    }  }      data.bumper_count = (uint8_t)this->bumper_count;  PutData( &data, sizeof(data) );    return;}///////////////////////////////////////////////////////////////////////////// Process configuration requests.void CBumperDevice::UpdateConfig(){  int len;  void* client;  char buffer[PLAYER_MAX_REQREP_SIZE];  player_bumper_geom_t geom;  while (true)  {    len = GetConfig(&client, &buffer, sizeof(buffer));    if (len <= 0)      break;    switch (buffer[0] )    {      case PLAYER_BUMPER_GET_GEOM_REQ:        // Return the bumper geometry        assert(this->bumper_count <= ARRAYSIZE(geom.bumper_def));        geom.bumper_count = htons(this->bumper_count);        for (int s = 0; s < this->bumper_count; s++)        {          geom.bumper_def[s].x_offset =             htons((short) (this->bumpers[s].x_offset * 1000));          geom.bumper_def[s].y_offset =             htons((short) (this->bumpers[s].y_offset * 1000));          geom.bumper_def[s].th_offset =             htons((short) (RTOD(this->bumpers[s].th_offset) ));          geom.bumper_def[s].length =             htons((short) (this->bumpers[s].length * 1000));          geom.bumper_def[s].radius =             htons((short) (this->bumpers[s].radius * 1000));        }        PutReply(client, PLAYER_MSGTYPE_RESP_ACK, NULL, &geom, sizeof(geom));        break;      default:        PRINT_WARN1("invalid bumper configuration request [%c]", buffer[0]);        PutReply(client, PLAYER_MSGTYPE_RESP_NACK);        break;    }  }}#ifdef INCLUDE_RTK2///////////////////////////////////////////////////////////////////////////// Initialise the rtk guivoid CBumperDevice::RtkStartup(){  CPlayerEntity::RtkStartup();    // draw the bumpers into the body fig  // Set the color  rtk_fig_color_rgb32(this->fig, this->color);    for( int s=0; s<this->bumper_count; s++ )    this->RtkRenderBumper( this->fig, s );    // Create a figure representing the data  this->scan_fig = rtk_fig_create(m_world->canvas, NULL, 55);  rtk_fig_linewidth( this->scan_fig, 2 ); // thick line  rtk_fig_color_rgb32(this->scan_fig, RGB(255,0,0) ); // RED!}///////////////////////////////////////////////////////////////////////////// Finalise the rtk guivoid CBumperDevice::RtkShutdown(){  // Clean up the figure we created  rtk_fig_destroy(this->scan_fig);  CPlayerEntity::RtkShutdown();} ///////////////////////////////////////////////////////////////////////////// Update the rtk guivoid CBumperDevice::RtkUpdate(){  CPlayerEntity::RtkUpdate();       // Get global pose  double gx, gy, gth;  GetGlobalPose(gx, gy, gth);  rtk_fig_origin(this->scan_fig, gx, gy, gth );  rtk_fig_clear(this->scan_fig);  // see the comment in CLaserDevice for why this gets the data out of  // the buffer instead of storing hit points in ::Update() - RTV  player_bumper_data_t data;    if( Subscribed() > 0 && m_world->ShowDeviceData( this->lib_entry->type_num ) )  {    size_t res = GetData( &data, sizeof(data));          if( res == sizeof(data) )    {      for (int s = 0; s < this->bumper_count; s++)	    {	              // set the color dependent on the bumper state         // Set the color        if( data.bumpers[s] )          this->RtkRenderBumper( this->scan_fig, s );	    }    }    //else    //PRINT_WARN2( "GET DATA RETURNED WRONG AMOUNT (%d/%d bytes)", res, sizeof(data) );  }  }void CBumperDevice::RtkRenderBumper( rtk_fig_t* fig, int bumper ){  double ox = this->scanlines[bumper].x_offset;  double oy = this->scanlines[bumper].y_offset;  double oth = this->scanlines[bumper].th_offset;  double len = this->scanlines[bumper].length;    if( this->scanlines[bumper].radius == 0 ) // straight line  {    double x2 = ox + len * cos( oth );    double y2 = oy + len * sin( oth );    rtk_fig_line( fig, ox, oy, x2, y2 );  }  else // arc  {    double xy_size = 2.0 * this->scanlines[bumper].radius;	      double arc_theta =       this->scanlines[bumper].length / this->scanlines[bumper].radius;          double start_angle = -arc_theta/2.0;    double end_angle = +arc_theta/2.0;          rtk_fig_ellipse_arc( fig, ox, oy, oth,                          xy_size, xy_size,                          start_angle, end_angle );   }}#endif

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲精品中文字幕| 国产美女精品人人做人人爽| 国产在线视频一区二区| 欧美亚洲免费在线一区| 久久久久99精品一区| 青青青伊人色综合久久| 日本韩国视频一区二区| 国产亚洲精品aa午夜观看| 偷拍一区二区三区四区| 色综合久久天天| 国产精品久久久久久久久免费相片| 蜜桃视频在线一区| 欧美性大战久久久久久久| 亚洲人成网站在线| av亚洲精华国产精华| 久久久精品免费免费| 激情综合一区二区三区| 日韩一区二区中文字幕| 亚洲成人高清在线| 欧美日韩免费一区二区三区| 中文字幕亚洲一区二区va在线| 国产一区二区看久久| 日韩久久精品一区| 久久精品久久综合| 日韩你懂的在线播放| 麻豆成人久久精品二区三区红| 欧美日韩国产综合一区二区| 亚洲综合一二三区| 欧美在线|欧美| 亚洲一区国产视频| 欧美综合亚洲图片综合区| 亚洲精品久久久蜜桃| 99久久er热在这里只有精品66| 国产精品免费免费| 成人av网址在线| 中文字幕免费观看一区| 成人高清伦理免费影院在线观看| 日本一区二区成人| 色哟哟国产精品| 亚洲va韩国va欧美va精品| 7777精品伊人久久久大香线蕉完整版 | 亚洲精品日产精品乱码不卡| av在线播放不卡| 一区二区三区中文字幕在线观看| 欧美色偷偷大香| 久久99精品一区二区三区三区| 久久综合狠狠综合久久激情| 国产乱码精品一区二区三区五月婷 | 国产激情91久久精品导航| 久久久亚洲精品一区二区三区 | 欧美日韩国产综合草草| 日本美女一区二区三区| xnxx国产精品| 99精品热视频| 婷婷开心激情综合| 国产日韩亚洲欧美综合| 欧美在线视频你懂得| 精品一区二区三区视频在线观看 | 国产成人aaaa| 亚洲免费伊人电影| 欧美电影在线免费观看| 激情六月婷婷久久| 自拍偷拍欧美精品| 日韩免费视频一区| 99久久伊人久久99| 日产国产欧美视频一区精品| 国产欧美日韩亚州综合| 欧美日本韩国一区二区三区视频| 国产一区三区三区| 亚洲影院在线观看| 国产香蕉久久精品综合网| 91成人免费在线| 精品亚洲欧美一区| 亚洲精品视频自拍| 久久久www成人免费毛片麻豆| 欧美网站一区二区| 成人黄色av网站在线| 美女任你摸久久| 亚洲免费av在线| 国产午夜久久久久| 日韩欧美国产精品一区| 日本国产一区二区| 国产精品亚洲一区二区三区妖精 | 欧美一二三区在线观看| 色呦呦日韩精品| 国内精品自线一区二区三区视频| 一区二区三区国产精华| 国产精品人人做人人爽人人添| 日韩一级片网址| 欧美中文字幕一二三区视频| 成人97人人超碰人人99| 久久www免费人成看片高清| 午夜免费久久看| 亚洲视频免费看| 国产精品欧美综合在线| 久久久久久久免费视频了| 日韩欧美色电影| 91麻豆精品国产自产在线观看一区 | 丁香一区二区三区| 久久er99精品| 美女www一区二区| 日韩av成人高清| 日韩中文欧美在线| 日韩成人一级片| 日韩av中文字幕一区二区| 亚洲综合精品自拍| 亚洲图片有声小说| 亚洲国产精品一区二区久久恐怖片| 亚洲免费观看在线视频| 亚洲天堂2014| 自拍偷拍国产精品| 亚洲日本丝袜连裤袜办公室| 中文字幕日韩精品一区| 国产精品国产三级国产aⅴ中文 | 日韩高清不卡一区二区三区| 视频一区视频二区中文字幕| 午夜在线电影亚洲一区| 日日骚欧美日韩| 免费看欧美美女黄的网站| 久久超碰97中文字幕| 国内成人精品2018免费看| 国产呦萝稀缺另类资源| 国产一区二区三区黄视频 | 亚洲人午夜精品天堂一二香蕉| 中文字幕综合网| 亚洲一区在线看| 日本三级亚洲精品| 美腿丝袜在线亚洲一区| 国产精品自拍网站| eeuss鲁片一区二区三区 | 丝瓜av网站精品一区二区| 蜜芽一区二区三区| 国产毛片精品一区| 91天堂素人约啪| 欧美亚洲动漫制服丝袜| 日韩三级免费观看| 国产精品素人一区二区| 亚洲图片自拍偷拍| 韩国三级在线一区| 91美女片黄在线观看| 91精品国产综合久久福利| 久久伊99综合婷婷久久伊| 亚洲视频在线观看三级| 丝袜国产日韩另类美女| 丁香婷婷综合网| 欧美日韩五月天| 国产婷婷一区二区| 亚洲第一电影网| 国产99久久久国产精品潘金 | 香蕉影视欧美成人| 国产激情视频一区二区在线观看 | 久久综合久久综合久久综合| 最新高清无码专区| 男女性色大片免费观看一区二区| 国产成人精品一区二| 9191成人精品久久| 日韩理论片一区二区| 蜜臀91精品一区二区三区| 91玉足脚交白嫩脚丫在线播放| 日韩一区二区麻豆国产| ...xxx性欧美| 理论电影国产精品| 在线观看av一区二区| 久久久精品欧美丰满| 天堂成人免费av电影一区| 99re亚洲国产精品| 久久久精品国产免费观看同学| 亚洲高清一区二区三区| 成人深夜在线观看| 精品国产乱码久久久久久久| 亚洲午夜久久久久久久久电影院| 成人一道本在线| 欧美成人video| 日韩精品免费视频人成| 欧美三级资源在线| 亚洲精品中文字幕在线观看| 国产91综合网| 久久婷婷综合激情| 久久99精品久久只有精品| 欧美日韩一区精品| 一区二区三区中文在线| 99精品久久只有精品| 久久精品免费在线观看| 国产一区视频网站| 精品久久一二三区| 青椒成人免费视频| 91精品国产色综合久久不卡蜜臀| 夜夜嗨av一区二区三区中文字幕| 成人一区二区三区在线观看| 久久久www免费人成精品| 精品亚洲成a人在线观看| 制服丝袜国产精品| 日韩 欧美一区二区三区| 欧美挠脚心视频网站| 亚洲国产成人av网| 91久久国产最好的精华液| 一区二区激情视频| 欧美日韩中文字幕一区| 亚洲一级二级在线| 欧美性猛交一区二区三区精品 |