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

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

?? sonardevice.cc

?? 一個機器人平臺
?? CC
字號:
/* *  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 sonar ring. * Author: Andrew Howard, Richard Vaughan * Date: 28 Nov 2000 * CVS info: $Id: sonardevice.cc,v 1.3 2002/11/11 08:21:40 rtv Exp $ */#include <math.h>#include "world.hh"#include "sonardevice.hh"#include "raytrace.hh"#include "world.hh"// constructorCSonarDevice::CSonarDevice( 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_sonar_data_t );  m_command_len = 0;  m_config_len  = 1;  m_reply_len  = 1;    m_player.code = PLAYER_SONAR_CODE; // from player's messages.h  this->min_range = 0.20;  this->max_range = 5.0;  this->power_on = true;  // Initialise the sonar poses to default values  this->sonar_count = SONARSAMPLES;  for (int i = 0; i < this->sonar_count; i++)  {    this->sonars[i][0] = 0;    this->sonars[i][1] = 0;    this->sonars[i][2] = i * 2 * M_PI / this->sonar_count;  }    // zero the data  memset( &this->data, 0, sizeof(this->data) );}///////////////////////////////////////////////////////////////////////////// Startup routine//bool CSonarDevice::Startup(){  if (!CPlayerEntity::Startup())    return false;  return true;}///////////////////////////////////////////////////////////////////////////// Load the entity from the world filebool CSonarDevice::Load(CWorldFile *worldfile, int section){  int i;  int scount;  char key[256];    if (!CPlayerEntity::Load(worldfile, section))    return false;  // Load sonar min and max range  this->min_range = worldfile->ReadLength(section, "min_range", this->min_range);  this->max_range = worldfile->ReadLength(section, "max_range", this->max_range);    // power on or off? (TODO - have this setting saved)  this->power_on = worldfile->ReadInt(section, "power_on", this->power_on );  // Load the geometry of the sonar ring  scount = worldfile->ReadInt(section, "scount", 0);  if (scount > 0)  {    this->sonar_count = scount;    for (i = 0; i < this->sonar_count; i++)    {      snprintf(key, sizeof(key), "spose[%d]", i);      this->sonars[i][0] = worldfile->ReadTupleLength(section, key, 0, 0);      this->sonars[i][1] = worldfile->ReadTupleLength(section, key, 1, 0);      this->sonars[i][2] = worldfile->ReadTupleAngle(section, key, 2, 0);    }  }  return true;}///////////////////////////////////////////////////////////////////////////// Update the sonar datavoid CSonarDevice::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();    // Check bounds  assert((size_t) this->sonar_count <= ARRAYSIZE(this->data.ranges));    if( this->power_on )    // Do each sonar    for (int s = 0; s < this->sonar_count; s++)      {	// Compute parameters of scan line	double ox = this->sonars[s][0];	double oy = this->sonars[s][1];	double oth = this->sonars[s][2];	LocalToGlobal(ox, oy, oth);		double range = this->max_range;		CLineIterator lit( ox, oy, oth, this->max_range, 			   m_world->ppm, m_world->matrix, PointToBearingRange );	CEntity* ent;		while( (ent = lit.GetNextEntity()) )	  {	    if( ent != this && ent != m_parent_entity && ent->sonar_return ) 	      {		range = lit.GetRange();		break;	      }	  }		uint16_t v = (uint16_t)(1000.0 * range);		// Store range in mm in network byte order	this->data.range_count = htons(this->sonar_count);	this->data.ranges[s] = htons(v);      }  PutData( &this->data, sizeof(this->data) );  return;}///////////////////////////////////////////////////////////////////////////// Process configuration requests.void CSonarDevice::UpdateConfig(){  int s, len;  void* client;  char buffer[PLAYER_MAX_REQREP_SIZE];  player_sonar_geom_t geom;  //player_sonar_power_config_t power;  while (true)  {    len = GetConfig(&client, &buffer, sizeof(buffer));    if (len <= 0)      break;    switch (buffer[0])    {      case PLAYER_SONAR_POWER_REQ:        // we got a sonar power config	// set the new power status	this->power_on = ((player_sonar_power_config_t*)buffer)->value;        PutReply(client, PLAYER_MSGTYPE_RESP_ACK);        break;      case PLAYER_SONAR_GET_GEOM_REQ:        // Return the sonar geometry        assert(this->sonar_count <= ARRAYSIZE(geom.poses));        geom.pose_count = htons(this->sonar_count);        for (s = 0; s < this->sonar_count; s++)        {          geom.poses[s][0] = htons((short) (this->sonars[s][0] * 1000));          geom.poses[s][1] = htons((short) (this->sonars[s][1] * 1000));          geom.poses[s][2] = htons((short) (this->sonars[s][2] * 180 / M_PI));        }        PutReply(client, PLAYER_MSGTYPE_RESP_ACK, NULL, &geom, sizeof(geom));        break;      default:        PRINT_WARN1("invalid sonar configuration request [%c]", buffer[0]);        PutReply(client, PLAYER_MSGTYPE_RESP_NACK);        break;    }  }}//size_t CSonarDevice::PutData( void* vdata, size_t len )//{  // export the data right away//size_t retval = CPlayerEntity::PutData( vdata, len );  //player_sonar_data_t* data = (player_sonar_data_t*)vdata;  //return( retval );//}#ifdef INCLUDE_RTK2///////////////////////////////////////////////////////////////////////////// Initialise the rtk guivoid CSonarDevice::RtkStartup(){  CPlayerEntity::RtkStartup();    // Create a figure representing this object  this->scan_fig = rtk_fig_create(m_world->canvas, NULL, 49);  // Set the color  rtk_fig_color_rgb32(this->scan_fig, this->color);}///////////////////////////////////////////////////////////////////////////// Finalise the rtk guivoid CSonarDevice::RtkShutdown(){  // Clean up the figure we created  rtk_fig_destroy(this->scan_fig);  CPlayerEntity::RtkShutdown();} ///////////////////////////////////////////////////////////////////////////// Update the rtk guivoid CSonarDevice::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_sonar_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->sonar_count; s++)      {        double ox = this->sonars[s][0];        double oy = this->sonars[s][1];        double oth = this->sonars[s][2];        LocalToGlobal(ox, oy, oth);        	// convert from integer mm to double m        double range = (double)ntohs(data.ranges[s]) / 1000.0;	//if( range < max_range )	  {	    double x1 = ox;	    double y1 = oy;	    double x2 = x1 + range * cos(oth); 	    double y2 = y1 + range * sin(oth);       	    	    rtk_fig_line(this->scan_fig, x1, y1, x2, y2 );	  }      }    }    //else    //PRINT_WARN2( "GET DATA RETURNED WRONG AMOUNT (%d/%d bytes)", res, sizeof(data) );  }  }#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
9l国产精品久久久久麻豆| 国产一区视频导航| 欧美一级二级在线观看| 激情久久五月天| 中文字幕永久在线不卡| 在线国产亚洲欧美| 狠狠色丁香久久婷婷综合丁香| 久久精品一区二区三区不卡| 一本色道久久综合亚洲91| 日韩激情一区二区| 欧美国产日本视频| 欧美精品v国产精品v日韩精品| 激情六月婷婷久久| 亚洲综合色噜噜狠狠| 欧美国产综合色视频| 91精品国产色综合久久不卡蜜臀 | 国产精品久久久久久亚洲毛片| 欧美一级二级三级蜜桃| 欧美性色黄大片手机版| thepron国产精品| 久久精品国产亚洲一区二区三区| 亚洲精品一二三区| 国产精品久久久久影院亚瑟| 久久久久久亚洲综合| 在线不卡一区二区| 欧美色成人综合| 94色蜜桃网一区二区三区| 岛国av在线一区| 国产一区二区三区最好精华液| 日本特黄久久久高潮| 亚洲免费av在线| 亚洲私人黄色宅男| 国产精品丝袜一区| 国产欧美一区视频| 久久久精品一品道一区| 日韩三级视频中文字幕| 欧美一区二区三区人| 7777精品伊人久久久大香线蕉最新版| 在线影视一区二区三区| 色婷婷亚洲婷婷| 色先锋资源久久综合| 色综合天天做天天爱| 91视频免费看| 在线这里只有精品| 欧美在线免费播放| 欧美日韩电影一区| 欧美一区二区在线免费播放| 91麻豆精品91久久久久久清纯 | 91精品一区二区三区久久久久久| 欧美日韩久久一区| 91精品免费在线观看| 日韩精品一区二区三区蜜臀| 欧美成人免费网站| 久久久久久久久久久黄色| 久久久激情视频| 国产精品久久免费看| 亚洲色图视频免费播放| 亚洲与欧洲av电影| 秋霞午夜鲁丝一区二区老狼| 欧美aaa在线| 国产不卡一区视频| 99v久久综合狠狠综合久久| 一本色道a无线码一区v| 欧美午夜在线观看| 日韩免费福利电影在线观看| 久久久一区二区| 亚洲天堂福利av| 丝袜美腿成人在线| 国产精品69毛片高清亚洲| 9久草视频在线视频精品| 欧美三级电影在线看| 日韩一级免费一区| 国产精品毛片大码女人| 一区二区三区高清不卡| 日本伊人精品一区二区三区观看方式 | 中文字幕第一区第二区| 一区二区在线观看不卡| 美女视频黄 久久| 成人性生交大片免费| 欧美在线不卡视频| 精品毛片乱码1区2区3区| 国产日韩综合av| 亚洲高清中文字幕| 国产精品一二三| 在线精品国精品国产尤物884a| 日韩天堂在线观看| 亚洲视频每日更新| 男女性色大片免费观看一区二区| 国产激情一区二区三区桃花岛亚洲| 色哟哟欧美精品| 精品免费视频一区二区| 亚洲日本va午夜在线电影| 日韩国产欧美三级| 成人免费视频视频| 欧美丰满一区二区免费视频| 亚洲国产成人午夜在线一区| 同产精品九九九| av午夜一区麻豆| 91精品国产色综合久久久蜜香臀| 国产精品美女久久久久久久久久久| 午夜视黄欧洲亚洲| a亚洲天堂av| 精品国产乱码久久久久久久| 亚洲伦理在线精品| 国产麻豆日韩欧美久久| 欧美精品电影在线播放| 亚洲图片你懂的| 国产伦精品一区二区三区免费| 在线观看日产精品| 国产精品天美传媒沈樵| 欧美aa在线视频| 欧美日本一区二区| 亚洲免费av观看| 成人av资源网站| 久久综合视频网| 男人的天堂久久精品| 在线观看一区二区视频| 中文字幕日韩欧美一区二区三区| 久88久久88久久久| 欧美一区二区美女| 亚洲第一av色| 91麻豆国产在线观看| 国产亚洲精久久久久久| 蜜桃视频在线观看一区二区| 欧美三级乱人伦电影| 一区二区三区产品免费精品久久75| 国产69精品久久777的优势| 精品久久久久一区| 免费成人美女在线观看.| 精品视频在线视频| 亚洲.国产.中文慕字在线| 在线精品亚洲一区二区不卡| 亚洲女爱视频在线| 91蜜桃婷婷狠狠久久综合9色| 中文子幕无线码一区tr| 国产精品一级在线| 欧美激情综合在线| 成人永久看片免费视频天堂| 久久久精品黄色| 成人午夜av电影| 国产精品对白交换视频 | 理论电影国产精品| 欧美tk丨vk视频| 国产一区二区看久久| 26uuu国产在线精品一区二区| 精品午夜一区二区三区在线观看| 日韩精品一区二区三区在线观看| 乱一区二区av| 久久久www成人免费无遮挡大片 | 日本视频免费一区| 欧美va在线播放| 国产精品 欧美精品| 中文字幕精品一区二区精品绿巨人 | 蜜臀91精品一区二区三区| 日韩一区二区三区四区五区六区| 日韩电影免费一区| 欧美r级电影在线观看| 国产成人av自拍| 亚洲精品亚洲人成人网在线播放| 欧美午夜精品久久久久久超碰| 香蕉乱码成人久久天堂爱免费| 欧美一区二区视频网站| 激情综合网av| 国产精品毛片高清在线完整版| 色综合久久精品| 日本成人中文字幕在线视频| 日韩美女在线视频| 成a人片国产精品| 亚洲第一久久影院| 日韩美女视频一区二区在线观看| 韩国精品主播一区二区在线观看| 亚洲国产精品t66y| 欧美三级韩国三级日本三斤| 美女视频黄频大全不卡视频在线播放| 国产午夜精品一区二区三区嫩草| 99在线精品视频| 国产高清不卡一区| xfplay精品久久| 91美女在线视频| 久久99精品国产麻豆不卡| 国产午夜亚洲精品理论片色戒| 欧美综合天天夜夜久久| 美女国产一区二区三区| 欧美性色综合网| 2021国产精品久久精品| 91精品婷婷国产综合久久| 国产欧美日韩另类一区| 麻豆91在线看| 亚洲美女屁股眼交| 狠狠色伊人亚洲综合成人| 欧美熟乱第一页| 蜜臀av一区二区| 亚洲一区影音先锋| 国产成人精品免费网站| 成人av免费在线播放| 日韩一区二区在线观看视频| 中文字幕亚洲成人| 国内欧美视频一区二区| 波多野结衣中文一区| 波多野结衣91|