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

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

?? sim.cpp

?? SLAM Gridsim use with sparer sensor
?? CPP
字號:
/*  gridsim2 (c) 2006 Kris Beevers  This file is part of gridsim2.  gridsim2 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.  gridsim2 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 gridsim2; if not, write to the Free Software Foundation,  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA*/#include "sim.hpp"#include "options.hpp"#include <fstream>// environment parametersdouble delta;   // size of a grid cell side (m)double density; // probability a cell is occupied (for random generation)double xmin, ymin, xmax, ymax;double *map;uint32_t *real_freq, *update_freq;sensor_t sensor;std::vector<pose_t> trajectory;FILE *ranges = 0;  // for use with pre-generated logs of range reports for each stepstd::vector<double> z_t;double amin = 0, amax = 360, ares = 1;int parse_command_line(int argc, char **argv);double error_prob(const uint8_t *grid, const double *map){  double e = 0;  for(uint32_t i = 0; i < W*H; ++i) {    if(grid[i] == F)      e += (1.0-map[i])*(1.0-map[i]); // squared error    else if(grid[i] == E)      e += map[i]*map[i];  }  return e;}double error_ml(const uint8_t *grid, const double *map){  double e = 0;  for(uint32_t i = 0; i < W*H; ++i) {    uint8_t argmax;    if(fabs(map[i]-0.5) < 1e-5) // flip a fair coin      argmax = (drand48() < map[i]) ? F : E;    else      argmax = (map[i] > 0.5) ? F : E;    if(grid[i] != U && argmax != grid[i])      e += 1.0;  }  return e;}template <class T>double mean(const T *grid){  double mu = 0;  for(uint32_t i = 0; i < W*H; ++i)    mu += double(grid[i]) / double(W*H);  return mu;}template <class T>T max(const T *grid){  T m = std::numeric_limits<T>::min();  for(uint32_t i = 0; i < W*H; ++i)    if(grid[i] > m) m = grid[i];  return m;}bool read_ranges(uint32_t rho){  z_t.clear();  double r;  for(uint32_t i = 0; i < rho; ++i) {    if(fscanf(ranges, "%lg", &r) != 1)      return false;    z_t.push_back(r);  }  return true;}int main(int argc, char **argv){  srand48(time(0));  parse_command_line(argc, argv);  // run the simulation  for(uint32_t t = 0; t < trajectory.size(); ++t) {    if(ranges != 0) {      assert(read_ranges(sensor.rho));      update_without_simulation(trajectory[t], sensor, z_t, amin, amax, ares);    } else      sense_and_update(trajectory[t], sensor);  }  // compute interesting statistics  uint8_t *possible = new uint8_t[W*H];  generate_best_possible_map(possible);  double d = grid_density(grid, W, H);  double ent = grid_entropy(grid, W, H);  double nu_prob = error_prob(possible, map);  double nu_ml = error_ml(possible, map);  double mean_real_freq = mean(real_freq);  double mean_update_freq = mean(update_freq);  double mean_real_update_ratio = 0;  // ratio of real observations to updates (alternatively we could  // just use the two means to compute this)  uint32_t m_count = 0;  for(uint32_t i = 0; i < W*H; ++i)    if(update_freq[i] > 0) {      ++m_count;      mean_real_update_ratio += double(real_freq[i])/double(update_freq[i]);    }  mean_real_update_ratio /= double(m_count);  printf("%g %g %g %g %g %g %g\n", d, ent, nu_prob, nu_ml,	 mean_real_freq, mean_update_freq, mean_real_update_ratio);  if(!options::quickget<bool>("nofiles")) { // make some images    write_pgm("grid.pgm", grid, W, H);    write_pgm("possible.pgm", possible, W, H);    uint8_t *map_out = new uint8_t[W*H];    uint8_t *map_ml_out = new uint8_t[W*H];    uint8_t *real_freq_out = new uint8_t[W*H];    uint8_t *update_freq_out = new uint8_t[W*H];    uint32_t max_real_freq = max(real_freq);    uint32_t max_update_freq = max(update_freq);    for(uint32_t i = 0; i < W*H; ++i) {      map_out[i] = (uint8_t)((1.0-map[i])*255);      map_ml_out[i] = (update_freq[i] == 0) ? U : ((map[i] > 0.5) ? 0 : 255);      real_freq_out[i] = (uint8_t)(255*double(real_freq[i])/double(max_real_freq));      update_freq_out[i] = (uint8_t)(255*double(update_freq[i])/double(max_update_freq));    }    write_pgm("map.pgm", map_out, W, H);    write_pgm("map-ml.pgm", map_ml_out, W, H);    write_pgm("real-freq.pgm", real_freq_out, W, H);    write_pgm("update-freq.pgm", update_freq_out, W, H);    // save the trajectory    FILE *traj = fopen("trajectory.phist", "w");    for(uint32_t t = 0; t < trajectory.size(); ++t) {      const pose_t &p = trajectory[t];      fprintf(traj, "%lg %lg %lg\n", p.x, p.y, rad2deg(p.t));    }    fclose(traj);  }  return 0;}int parse_command_line(int argc, char **argv){  // set up commandline/configuration file options  options::add<bool>("help", 0, "Print usage information", 0, false, options::nodump);  options::set_cf_options("config", "c");  options::add<std::string>("save-config", 0, "Save configuration file", 0, "", options::nodump);  options::add<bool>("nofiles", 0, "Don't save output files", 0, false, options::nodump);  options::add<uint32_t>("width", "w", "Workspace width (cells)", "Environment", 400);  options::add<uint32_t>("height", "h", "Workspace height (cells)", "Environment", 400);  options::add<double>("delta", "D", "Grid cell size (m)", "Environment", 0.1);  options::add<double>("density", "d", "Base environment density [0..1]", "Environment", 0.5);  options::add<std::string>("grid", "g", "Grid file (pgm)", "Environment", "", options::nodump);  options::add<std::string>("mrf", "m", "Pairwise MRF file", "Environment", "", options::nodump);  options::add<uint32_t>("mrf-gibbs-iterations", "N", "Gibbs sampler iterations for MRF model",			 "Environment", 20);  options::add<double>("frequency", "F", "Firing frequency (Hz)", "Sensor", 5.0);  options::add<uint32_t>("rho", "p", "Readings per scan", "Sensor", 180);  options::add<double>("rmax", "r", "Maximum range (m)", "Sensor", 10.0);  options::add<double>("beamwidth", "B", "Beam width (rad)", "Sensor", M_PI/180.0);  options::add<double>("sigma-b", "b", "Bearing uncertainty [0..2pi]", "Sensor", M_PI/180.0);  options::add<double>("sigma-r", "a", "Range uncertainty [0..rmax]", "Sensor", 0.2);  options::add<double>("err-e", "e", "False negative rate [0..1]", "Sensor", 0.05);  options::add<double>("err-f", "f", "False positive rate [0..1]", "Sensor", 0.01);  options::add<std::string>("ranges", 0, "Range readings file", "Sensor", "", options::nodump);  options::add<bool>("sampled-poses", "s", "Sample poses randomly (not a real trajectory)",		     "Trajectory", false);  options::add<double>("time-limit", "T", "Trajectory length (s)", "Trajectory", 50.0);  options::add<std::string>("waypoints", 0, "Waypoint file", "Trajectory", "", options::nodump);  options::add<std::string>("trajectory", "t", "Trajectory file", "Trajectory", "", options::nodump);  options::add<double>("velocity", "v", "Velocity (m/s)", "Trajectory", 2.0);  options::add<bool>("fixed-update", 0, "Fixed updates?", "Mapping", false);  options::add<double>("update-prob", "u", "Fixed update prob. [0..0.5]", "Mapping", 0.01);  // parse commandline (and read config file if it is specified)  int inpidx = options::parse_cmdline(argc, argv);  if(inpidx < 0) // some kind of error    exit(1);    // relevant info printed by getopt  // print usage information  if(inpidx > argc || options::quickget<bool>("help") == true) {    std::cerr << "Usage: " << argv[0] << " [options]" << std::endl;    options::print_options(std::cout);    exit(1);  }  // save a config file based on these options?  std::string cfname = options::quickget<std::string>("save-config");  if(cfname.length() > 0) {    std::ofstream conf(cfname.c_str());    if(!conf)      std::cerr << "Can't write configuration file " << cfname << std::endl;    else      options::dump(conf);  }  // do initialization  density = options::quickget<double>("density");  std::string s = options::quickget<std::string>("grid");  if(s.length() > 0) {    assert(load_pgm(s.c_str(), &grid, &W, &H));  } else {    W = options::quickget<uint32_t>("width");    H = options::quickget<uint32_t>("height");    s = options::quickget<std::string>("mrf");    if(s.length() > 0) {      assert(load_mrf_model(s.c_str()));      generate_random_grid_mrf(density, options::quickget<uint32_t>("mrf-gibbs-iterations"));    } else      generate_random_grid_unif(density);  }  map = new double[W*H];  real_freq = new uint32_t[W*H];  update_freq = new uint32_t[W*H];  for(uint32_t i = 0; i < W*H; ++i) {    map[i] = 0.5;    real_freq[i] = update_freq[i] = 0;  }  delta = options::quickget<double>("delta");  eps_scale = delta * M_SQRT2 / 2;  xmin = -double(W)*delta/2;  xmax = double(W)*delta/2;  ymin = -double(H)*delta/2;  ymax = double(H)*delta/2;  sensor.v = options::quickget<double>("velocity");  sensor.F = options::quickget<double>("frequency");  sensor.rho = options::quickget<uint32_t>("rho");  sensor.rmax = options::quickget<double>("rmax");  sensor.delta_b = options::quickget<double>("beamwidth");  sensor.sigma_b = options::quickget<double>("sigma-b");  sensor.sigma_r = options::quickget<double>("sigma-r");  sensor.e_e = options::quickget<double>("err-e");  sensor.e_f = options::quickget<double>("err-f");  fixed_update = options::quickget<bool>("fixed-update");  p_0 = options::quickget<double>("update-prob");  double T = options::quickget<double>("time-limit");  s = options::quickget<std::string>("waypoints");  if(s.length() > 0) {    std::list<point_t> waypoints;    assert(load_waypoints(s.c_str(), waypoints));    generate_perfect_trajectory_from_waypoints(waypoints, sensor, trajectory);  }  s = options::quickget<std::string>("trajectory");  if(s.length() > 0)    assert(load_trajectory(s.c_str(), trajectory));  if(trajectory.size() == 0) { // didn't load any trajectory    if(options::quickget<bool>("sampled-poses"))      generate_uncorrelated_trajectory(T, sensor, trajectory);    else      generate_brownian_trajectory(T, sensor, trajectory);  }  s = options::quickget<std::string>("ranges");  if(s.length() > 0) {    ranges = fopen(s.c_str(), "r");    assert(ranges != 0);    assert(fscanf(ranges, "%lg %lg %lg", &amin, &amax, &ares) == 3);    amin = deg2rad(amin);    amax = deg2rad(amax);    ares = deg2rad(ares);  }  return 0;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩高清一区二区| 日韩高清欧美激情| 久久只精品国产| 777午夜精品视频在线播放| 色天天综合久久久久综合片| 97精品电影院| 91福利精品视频| 一本大道综合伊人精品热热| 大胆亚洲人体视频| 风间由美一区二区三区在线观看| 免费观看在线色综合| 裸体在线国模精品偷拍| 麻豆一区二区三区| 国产精品123区| 国产一区激情在线| 成人小视频免费在线观看| 成人精品一区二区三区四区| 99久久免费视频.com| 色噜噜狠狠色综合欧洲selulu| 91免费视频观看| 欧美久久一区二区| 精品久久五月天| 国产精品系列在线| 一区二区三区精品视频在线| 午夜精彩视频在线观看不卡| 免费成人深夜小野草| 蜜臂av日日欢夜夜爽一区| 国产v日产∨综合v精品视频| 一本高清dvd不卡在线观看| 欧美嫩在线观看| 国产欧美久久久精品影院| 亚洲色图欧美偷拍| 男男gaygay亚洲| www.一区二区| 91精品久久久久久久99蜜桃| 国产亚洲精品福利| 亚洲一区自拍偷拍| 激情综合色综合久久综合| 99久久婷婷国产| 日韩美一区二区三区| 中文字幕视频一区二区三区久| 亚洲bt欧美bt精品777| 韩国女主播成人在线| 日本精品视频一区二区| 久久综合九色综合欧美亚洲| 亚洲男人电影天堂| 国产精品一区久久久久| 欧美酷刑日本凌虐凌虐| 国产精品成人在线观看| 麻豆中文一区二区| 欧美性大战xxxxx久久久| 国产亚洲污的网站| 男女激情视频一区| 欧美日韩国产高清一区二区三区 | 欧美一区二区三区免费在线看| 日韩精品一区二区在线观看| 亚洲日本电影在线| 国产原创一区二区| 成人丝袜18视频在线观看| 91香蕉国产在线观看软件| 欧美精品一区二| 国产成人精品影视| 中文字幕中文在线不卡住| 男女男精品网站| www.久久精品| 日韩一区二区在线观看| 亚洲人精品午夜| 中文字幕色av一区二区三区| 久久无码av三级| 亚洲综合一区在线| 欧美一区二区三区成人| 国产一区二区在线看| 亚洲精品视频一区二区| 欧美另类一区二区三区| 一区二区三区国产| 精品福利一区二区三区| 91无套直看片红桃| 久草在线在线精品观看| 亚洲精品免费电影| 久久日一线二线三线suv| 色狠狠桃花综合| 国产二区国产一区在线观看| 艳妇臀荡乳欲伦亚洲一区| 欧美精品一区二区三区视频| 欧洲一区二区三区在线| 国产成人在线免费| 青青草视频一区| 一区二区三区高清不卡| 国产丝袜欧美中文另类| 欧美一级国产精品| 欧美日韩和欧美的一区二区| 成人午夜电影小说| 国产精品中文有码| 理论片日本一区| 亚洲超碰97人人做人人爱| 一区精品在线播放| 国产视频一区在线观看| 精品美女一区二区三区| 6080日韩午夜伦伦午夜伦| 91欧美一区二区| 成人激情黄色小说| 成人性视频免费网站| 捆绑紧缚一区二区三区视频| 午夜精品福利在线| 性欧美大战久久久久久久久| 亚洲精品一二三区| 亚洲视频一区二区在线| 国产精品成人午夜| 国产精品免费视频一区| 国产欧美va欧美不卡在线| 欧美va亚洲va| 精品国免费一区二区三区| 欧美一区二区三区在线| 337p亚洲精品色噜噜| 欧洲一区二区av| 欧美午夜精品久久久久久孕妇| 一本一本大道香蕉久在线精品 | 欧美va亚洲va香蕉在线| 91精品婷婷国产综合久久性色| 欧美午夜精品免费| 日韩视频永久免费| 欧美日韩在线亚洲一区蜜芽| 欧美日韩国产一二三| 欧美一三区三区四区免费在线看| 欧美日韩一本到| 日韩一区二区免费高清| 欧美一区二区福利视频| 精品久久久久久无| 久久精品亚洲一区二区三区浴池| 久久精品夜夜夜夜久久| 国产精品美女www爽爽爽| 亚洲欧洲av色图| 亚洲国产精品久久一线不卡| 偷拍一区二区三区四区| 久久99久久久欧美国产| 国产精品一区二区在线播放 | 六月丁香综合在线视频| 国产精品亚洲午夜一区二区三区| 国产精品综合在线视频| 粉嫩在线一区二区三区视频| 成人av免费网站| 欧美色精品在线视频| 日韩欧美国产一区二区三区| 精品999在线播放| 中文字幕佐山爱一区二区免费| 亚洲国产综合人成综合网站| 另类的小说在线视频另类成人小视频在线| 国产美女精品一区二区三区| av电影天堂一区二区在线观看| 欧美影院精品一区| 精品国产一二三区| 一区二区三区免费在线观看| 毛片av一区二区| 色婷婷亚洲婷婷| 欧美精品一区二区在线观看| 亚洲欧美韩国综合色| 美女被吸乳得到大胸91| 99久久免费精品| 日韩一级精品视频在线观看| 国产精品久久99| 国内成人免费视频| 日本韩国精品在线| 久久久久久麻豆| 婷婷国产v国产偷v亚洲高清| 国产不卡视频在线观看| 欧美精选一区二区| 中文字幕亚洲成人| 国产一区在线观看视频| 欧美性生活影院| 国产精品欧美综合在线| 美女一区二区视频| 色婷婷久久久亚洲一区二区三区| 精品国偷自产国产一区| 亚洲一区二区三区视频在线| 国产精品一区二区不卡| 91精品国产综合久久久蜜臀粉嫩 | 亚洲成人av一区| 东方aⅴ免费观看久久av| 67194成人在线观看| 一区二区三区四区激情| 成人影视亚洲图片在线| 26uuu色噜噜精品一区| 日本成人在线视频网站| 欧美亚洲国产一区二区三区va| 欧美国产欧美综合| 国产一区久久久| 精品久久人人做人人爽| 国产精品2024| 日韩午夜激情电影| 日韩中文字幕一区二区三区| 色视频成人在线观看免| 国产精品国产a| 成人丝袜视频网| 亚洲国产精品ⅴa在线观看| 国产一区二区精品久久99| 欧美tickle裸体挠脚心vk| 日本va欧美va欧美va精品| 欧美精品三级日韩久久| 午夜精品福利一区二区三区蜜桃| 欧美色精品在线视频|