Main MRPT website > C++ reference for MRPT 1.9.9
COccupancyGridMap2D_simulate.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #include "maps-precomp.h" // Precomp header
11 
15 #include <mrpt/core/round.h> // round()
17 
18 #include <mrpt/random.h>
19 
20 using namespace mrpt;
21 using namespace mrpt::maps;
22 using namespace mrpt::obs;
23 using namespace mrpt::random;
24 using namespace mrpt::poses;
25 using namespace std;
26 
28 
29 // See docs in header
31  mrpt::obs::CObservation2DRangeScan& inout_Scan, const CPose2D& robotPose,
32  float threshold, size_t N, float noiseStd, unsigned int decimation,
33  float angleNoiseStd) const
34 {
36 
37  ASSERT_(decimation >= 1);
38  ASSERT_(N >= 2);
39 
40  // Sensor pose in global coordinates
41  CPose3D sensorPose3D = CPose3D(robotPose) + inout_Scan.sensorPose;
42  // Aproximation: grid is 2D !!!
43  CPose2D sensorPose(sensorPose3D);
44 
45  // Scan size:
46  inout_Scan.resizeScan(N);
47 
48  double A = sensorPose.phi() +
49  (inout_Scan.rightToLeft ? -0.5 : +0.5) * inout_Scan.aperture;
50  const double AA =
51  (inout_Scan.rightToLeft ? 1.0 : -1.0) * (inout_Scan.aperture / (N - 1));
52 
53  const float free_thres = 1.0f - threshold;
54 
55  for (size_t i = 0; i < N; i += decimation, A += AA * decimation)
56  {
57  bool valid;
58  float out_range;
59  simulateScanRay(
60  sensorPose.x(), sensorPose.y(), A, out_range, valid,
61  inout_Scan.maxRange, free_thres, noiseStd, angleNoiseStd);
62  inout_Scan.setScanRange(i, out_range);
63  inout_Scan.setScanRangeValidity(i, valid);
64  }
65 
66  MRPT_END
67 }
68 
70  CObservationRange& inout_observation, const CPose2D& robotPose,
71  float threshold, float rangeNoiseStd, float angleNoiseStd) const
72 {
73  const float free_thres = 1.0f - threshold;
74 
75  for (CObservationRange::iterator itR = inout_observation.begin();
76  itR != inout_observation.end(); ++itR)
77  {
78  const CPose2D sensorAbsolutePose =
79  CPose2D(CPose3D(robotPose) + CPose3D(itR->sensorPose));
80 
81  // For each sonar cone, simulate several rays and keep the shortest
82  // distance:
83  ASSERT_(inout_observation.sensorConeApperture > 0);
84  size_t nRays =
85  round(1 + inout_observation.sensorConeApperture / DEG2RAD(1.0));
86 
87  double direction = sensorAbsolutePose.phi() -
88  0.5 * inout_observation.sensorConeApperture;
89  const double Adir = inout_observation.sensorConeApperture / nRays;
90 
91  float min_detected_obs = 0;
92  for (size_t i = 0; i < nRays; i++, direction += Adir)
93  {
94  bool valid;
95  float sim_rang;
96  simulateScanRay(
97  sensorAbsolutePose.x(), sensorAbsolutePose.y(), direction,
98  sim_rang, valid, inout_observation.maxSensorDistance,
99  free_thres, rangeNoiseStd, angleNoiseStd);
100 
101  if (valid && (sim_rang < min_detected_obs || !i))
102  min_detected_obs = sim_rang;
103  }
104  // Save:
105  itR->sensedDistance = min_detected_obs;
106  }
107 }
108 
110  const double start_x, const double start_y, const double angle_direction,
111  float& out_range, bool& out_valid, const double max_range_meters,
112  const float threshold_free, const double noiseStd,
113  const double angleNoiseStd) const
114 {
115  const double A_ =
116  angle_direction +
117  (angleNoiseStd > .0
118  ? getRandomGenerator().drawGaussian1D_normalized() * angleNoiseStd
119  : .0);
120 
121 // Unit vector in the directorion of the ray:
122 #ifdef HAVE_SINCOS
123  double Arx, Ary;
124  ::sincos(A_, &Ary, &Arx);
125 #else
126  const double Arx = cos(A_);
127  const double Ary = sin(A_);
128 #endif
129 
130  // Ray tracing, until collision, out of the map or out of range:
131  const unsigned int max_ray_len = mrpt::round(max_range_meters / resolution);
132  unsigned int ray_len = 0;
133 
134 // Use integers for all ray tracing for efficiency
135 #define INTPRECNUMBIT 10
136 #define int_x2idx(_X) (_X >> INTPRECNUMBIT)
137 #define int_y2idx(_Y) (_Y >> INTPRECNUMBIT)
138 
139  int64_t rxi = static_cast<int64_t>(
140  ((start_x - x_min) / resolution) * (1L << INTPRECNUMBIT));
141  int64_t ryi = static_cast<int64_t>(
142  ((start_y - y_min) / resolution) * (1L << INTPRECNUMBIT));
143 
144  const int64_t Arxi = static_cast<int64_t>(
145  RAYTRACE_STEP_SIZE_IN_CELL_UNITS * Arx * (1L << INTPRECNUMBIT));
146  const int64_t Aryi = static_cast<int64_t>(
147  RAYTRACE_STEP_SIZE_IN_CELL_UNITS * Ary * (1L << INTPRECNUMBIT));
148 
149  cellType hitCellOcc_int = 0; // p2l(0.5f)
150  const cellType threshold_free_int = p2l(threshold_free);
151  int x, y = int_y2idx(ryi);
152 
153  while ((x = int_x2idx(rxi)) >= 0 && (y = int_y2idx(ryi)) >= 0 &&
154  x < static_cast<int>(size_x) && y < static_cast<int>(size_y) &&
155  (hitCellOcc_int = map[x + y * size_x]) > threshold_free_int &&
156  ray_len < max_ray_len)
157  {
158  rxi += Arxi;
159  ryi += Aryi;
160  ray_len++;
161  }
162 
163  // Store:
164  // Check out of the grid?
165  // Tip: if x<0, (unsigned)(x) will also be >>> size_x ;-)
166  if (abs(hitCellOcc_int) <= 1 || static_cast<unsigned>(x) >= size_x ||
167  static_cast<unsigned>(y) >= size_y)
168  {
169  out_valid = false;
170  out_range = max_range_meters;
171  }
172  else
173  { // No: The normal case:
174  out_range = RAYTRACE_STEP_SIZE_IN_CELL_UNITS * ray_len * resolution;
175  out_valid = (ray_len < max_ray_len); // out_range<max_range_meters;
176  // Add additive Gaussian noise:
177  if (noiseStd > 0 && out_valid)
178  out_range +=
180  }
181 }
182 
185  : method(sumUnscented),
186  UT_alpha(0.99),
187  UT_kappa(.0),
188  UT_beta(2.0),
189  MC_samples(10),
190  aperture(M_PIf),
191  rightToLeft(true),
192  maxRange(80.f),
193  nRays(361),
194  rangeNoiseStd(.0f),
195  angleNoiseStd(.0f),
196  decimation(1),
197  threshold(.6f)
198 {
199 }
200 
203 {
204 }
205 
207 {
210 };
211 
213  const Eigen::Vector3d& x_pose, const TFunctorLaserSimulData& fixed_param,
214  Eigen::VectorXd& y_scanRanges)
215 {
216  ASSERT_(fixed_param.params && fixed_param.grid);
217  ASSERT_(fixed_param.params->decimation >= 1);
218  ASSERT_(fixed_param.params->nRays >= 2);
219 
220  const size_t N = fixed_param.params->nRays;
221 
222  // Sensor pose in global coordinates
223  const CPose3D sensorPose3D =
224  CPose3D(x_pose[0], x_pose[1], .0, x_pose[2], .0, .0) +
225  fixed_param.params->sensorPose;
226  // Aproximation: grid is 2D !!!
227  const CPose2D sensorPose(sensorPose3D);
228 
229  // Scan size:
230  y_scanRanges.resize(N);
231 
232  double A = sensorPose.phi() +
233  (fixed_param.params->rightToLeft ? -0.5 : +0.5) *
234  fixed_param.params->aperture;
235  const double AA = (fixed_param.params->rightToLeft ? 1.0 : -1.0) *
236  (fixed_param.params->aperture / (N - 1));
237 
238  const float free_thres = 1.0f - fixed_param.params->threshold;
239 
240  for (size_t i = 0; i < N; i += fixed_param.params->decimation,
241  A += AA * fixed_param.params->decimation)
242  {
243  bool valid;
244  float range;
245 
246  fixed_param.grid->simulateScanRay(
247  sensorPose.x(), sensorPose.y(), A, range, valid,
248  fixed_param.params->maxRange, free_thres, .0 /*noiseStd*/,
249  .0 /*angleNoiseStd*/);
250  y_scanRanges[i] = valid ? range : fixed_param.params->maxRange;
251  }
252 }
253 
257 {
258  const Eigen::Vector3d robPoseMean =
259  in_params.robotPose.mean.getAsVectorVal();
260 
261  TFunctorLaserSimulData simulData;
262  simulData.grid = this;
263  simulData.params = &in_params;
264 
265  switch (in_params.method)
266  {
267  case sumUnscented:
269  robPoseMean, // x_mean
270  in_params.robotPose.cov, // x_cov
271  &func_laserSimul_callback, // void (*functor)(const
272  // VECTORLIKE1 &x,const USERPARAM
273  // &fixed_param, VECTORLIKE3 &y)
274  simulData, // const USERPARAM &fixed_param,
275  out_results.scanWithUncert.rangesMean,
276  out_results.scanWithUncert.rangesCovar,
277  nullptr, // elem_do_wrap2pi,
278  in_params.UT_alpha, in_params.UT_kappa,
279  in_params.UT_beta // alpha, K, beta
280  );
281  break;
282  case sumMonteCarlo:
283  //
285  robPoseMean, // x_mean
286  in_params.robotPose.cov, // x_cov
287  &func_laserSimul_callback, // void (*functor)(const
288  // VECTORLIKE1 &x,const USERPARAM
289  // &fixed_param, VECTORLIKE3 &y)
290  simulData, // const USERPARAM &fixed_param,
291  out_results.scanWithUncert.rangesMean,
292  out_results.scanWithUncert.rangesCovar, in_params.MC_samples);
293  break;
294  default:
295  throw std::runtime_error(
296  "[laserScanSimulatorWithUncertainty] Unknown `method` value");
297  break;
298  };
299 
300  // Outputs:
301  out_results.scanWithUncert.rangeScan.aperture = in_params.aperture;
302  out_results.scanWithUncert.rangeScan.maxRange = in_params.maxRange;
303  out_results.scanWithUncert.rangeScan.rightToLeft = in_params.rightToLeft;
304  out_results.scanWithUncert.rangeScan.sensorPose = in_params.sensorPose;
305 
306  out_results.scanWithUncert.rangeScan.resizeScan(in_params.nRays);
307  for (unsigned i = 0; i < in_params.nRays; i++)
308  {
310  i, (float)out_results.scanWithUncert.rangesMean[i]);
311  out_results.scanWithUncert.rangeScan.setScanRangeValidity(i, true);
312  }
313 
314  // Add minimum uncertainty: grid cell resolution:
315  out_results.scanWithUncert.rangesCovar.diagonal().array() +=
316  0.5 * resolution * resolution;
317 }
mrpt::obs::CObservation2DRangeScan::setScanRange
void setScanRange(const size_t i, const float val)
Definition: CObservation2DRangeScan.cpp:509
mrpt::maps::COccupancyGridMap2D::simulateScanRay
void simulateScanRay(const double x, const double y, const double angle_direction, float &out_range, bool &out_valid, const double max_range_meters, const float threshold_free=0.4f, const double noiseStd=.0, const double angleNoiseStd=.0) const
Simulate just one "ray" in the grid map.
Definition: COccupancyGridMap2D_simulate.cpp:109
COccupancyGridMap2D.h
mrpt::maps::COccupancyGridMap2D::TLaserSimulUncertaintyResult::TLaserSimulUncertaintyResult
TLaserSimulUncertaintyResult()
Definition: COccupancyGridMap2D_simulate.cpp:202
mrpt::random::CRandomGenerator::drawGaussian1D_normalized
double drawGaussian1D_normalized()
Generate a normalized (mean=0, std=1) normally distributed sample.
Definition: RandomGenerator.cpp:42
mrpt::obs::CObservation2DRangeScan::maxRange
float maxRange
The maximum range allowed by the device, in meters (e.g.
Definition: CObservation2DRangeScan.h:130
mrpt::obs::CObservation2DRangeScan::rightToLeft
bool rightToLeft
The scanning direction: true=counterclockwise; false=clockwise.
Definition: CObservation2DRangeScan.h:127
mrpt::maps::COccupancyGridMap2D::RAYTRACE_STEP_SIZE_IN_CELL_UNITS
static double RAYTRACE_STEP_SIZE_IN_CELL_UNITS
(Default:1.0) Can be set to <1 if a more fine raytracing is needed in sonarSimulator() and laserScanS...
Definition: COccupancyGridMap2D.h:92
mrpt::obs::CObservation2DRangeScan
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
Definition: CObservation2DRangeScan.h:56
mrpt::obs::CObservationRange::begin
iterator begin()
Definition: CObservationRange.h:71
mrpt::obs::CObservationRange::iterator
std::deque< TMeasurement >::iterator iterator
Definition: CObservationRange.h:66
mrpt::maps::COccupancyGridMap2D::TLaserSimulUncertaintyParams::method
TLaserSimulUncertaintyMethod method
(Default: sumMonteCarlo) Select the method to do the uncertainty propagation
Definition: COccupancyGridMap2D.h:868
int_x2idx
#define int_x2idx(_X)
mrpt::poses::CPose2D::phi
const double & phi() const
Get the phi angle of the 2D pose (in radians)
Definition: CPose2D.h:82
TFunctorLaserSimulData::grid
const COccupancyGridMap2D * grid
Definition: COccupancyGridMap2D_simulate.cpp:209
mrpt::maps::COccupancyGridMap2D::TLaserSimulUncertaintyParams::sensorPose
mrpt::poses::CPose3D sensorPose
(Default: at origin) The 6D pose of the sensor on the robot at the moment of starting the scan.
Definition: COccupancyGridMap2D.h:896
mrpt::poses::CPosePDFGaussian::cov
mrpt::math::CMatrixDouble33 cov
The 3x3 covariance matrix.
Definition: CPosePDFGaussian.h:48
mrpt::maps::COccupancyGridMap2D::laserScanSimulatorWithUncertainty
void laserScanSimulatorWithUncertainty(const TLaserSimulUncertaintyParams &in_params, TLaserSimulUncertaintyResult &out_results) const
Like laserScanSimulatorWithUncertainty() (see it for a discussion of most parameters) but taking into...
Definition: COccupancyGridMap2D_simulate.cpp:254
mrpt::maps::COccupancyGridMap2D::TLaserSimulUncertaintyParams::aperture
float aperture
(Default: M_PI) The "aperture" or field-of-view of the range finder, in radians (typically M_PI = 180...
Definition: COccupancyGridMap2D.h:887
int64_t
__int64 int64_t
Definition: rptypes.h:49
mrpt::maps::COccupancyGridMap2D::sumUnscented
@ sumUnscented
Performs an unscented transform.
Definition: COccupancyGridMap2D.h:858
mrpt::maps::COccupancyGridMap2D::TLaserSimulUncertaintyParams::UT_beta
double UT_beta
Definition: COccupancyGridMap2D.h:873
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::obs::CObservation2DRangeScanWithUncertainty::rangesCovar
Eigen::MatrixXd rangesCovar
The covariance matrix for all the ranges in rangeScan.scan[].
Definition: CObservation2DRangeScanWithUncertainty.h:31
mrpt::obs::CObservation2DRangeScan::resizeScan
void resizeScan(const size_t len)
Resizes all data vectors to allocate a given number of scan rays.
Definition: CObservation2DRangeScan.cpp:538
mrpt::maps::COccupancyGridMap2D::TLaserSimulUncertaintyParams::MC_samples
size_t MC_samples
[sumMonteCarlo] MonteCarlo parameter: number of samples (Default: 10)
Definition: COccupancyGridMap2D.h:876
ASSERT_
#define ASSERT_(f)
Defines an assertion mechanism.
Definition: exceptions.h:113
mrpt::obs::CObservation2DRangeScan::setScanRangeValidity
void setScanRangeValidity(const size_t i, const bool val)
Definition: CObservation2DRangeScan.cpp:531
mrpt::poses
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Definition: CHierarchicalMapMHPartition.h:25
INTPRECNUMBIT
#define INTPRECNUMBIT
mrpt::obs
This namespace contains representation of robot actions and observations.
Definition: CParticleFilter.h:17
mrpt::obs::CObservation2DRangeScanWithUncertainty::rangesMean
Eigen::VectorXd rangesMean
The same ranges than in rangeScan.scan[], for convenience as an Eigen container, and with double prec...
Definition: CObservation2DRangeScanWithUncertainty.h:29
mrpt::math::transform_gaussian_montecarlo
void transform_gaussian_montecarlo(const VECTORLIKE1 &x_mean, const MATLIKE1 &x_cov, void(*functor)(const VECTORLIKE1 &x, const USERPARAM &fixed_param, VECTORLIKE3 &y), const USERPARAM &fixed_param, VECTORLIKE2 &y_mean, MATLIKE2 &y_cov, const size_t num_samples=1000, mrpt::aligned_std_vector< VECTORLIKE3 > *out_samples_y=nullptr)
Simple Montecarlo-base estimation of the Gaussian distribution of a variable Y=f(X) for an arbitrary ...
Definition: transform_gaussian.h:114
random.h
mrpt::poses::CPosePDFGaussian::mean
CPose2D mean
The mean value.
Definition: CPosePDFGaussian.h:46
mrpt::maps::COccupancyGridMap2D::TLaserSimulUncertaintyParams::UT_alpha
double UT_alpha
[sumUnscented] UT parameters.
Definition: COccupancyGridMap2D.h:873
mrpt::maps::COccupancyGridMap2D::TLaserSimulUncertaintyResult
Output params for laserScanSimulatorWithUncertainty()
Definition: COccupancyGridMap2D.h:916
TFunctorLaserSimulData::params
const COccupancyGridMap2D::TLaserSimulUncertaintyParams * params
Definition: COccupancyGridMap2D_simulate.cpp:208
mrpt::poses::CPoseOrPoint::getAsVectorVal
mrpt::math::CVectorDouble getAsVectorVal() const
Return the pose or point as a 1xN vector with all the components (see derived classes for each implem...
Definition: CPoseOrPoint.h:263
mrpt::maps::COccupancyGridMap2D::laserScanSimulator
void laserScanSimulator(mrpt::obs::CObservation2DRangeScan &inout_Scan, const mrpt::poses::CPose2D &robotPose, float threshold=0.6f, size_t N=361, float noiseStd=0, unsigned int decimation=1, float angleNoiseStd=mrpt::DEG2RAD(.0)) const
Simulates a laser range scan into the current grid map.
Definition: COccupancyGridMap2D_simulate.cpp:30
mrpt::poses::CPoseOrPoint::y
double y() const
Definition: CPoseOrPoint.h:144
mrpt::obs::CObservation2DRangeScan::aperture
float aperture
The "aperture" or field-of-view of the range finder, in radians (typically M_PI = 180 degrees).
Definition: CObservation2DRangeScan.h:125
mrpt::round
int round(const T value)
Returns the closer integer (int) to x.
Definition: round.h:23
mrpt::obs::CObservationRange::sensorConeApperture
float sensorConeApperture
Cone aperture of each ultrasonic beam, in radians.
Definition: CObservationRange.h:44
TFunctorLaserSimulData
Definition: COccupancyGridMap2D_simulate.cpp:206
mrpt::maps::COccupancyGridMap2D::TLaserSimulUncertaintyParams::decimation
unsigned int decimation
(Default: 1) The rays that will be simulated are at indexes: 0, D, 2D, 3D,...
Definition: COccupancyGridMap2D.h:906
MRPT_START
#define MRPT_START
Definition: exceptions.h:262
mrpt::maps::COccupancyGridMap2D::cellType
int16_t cellType
The type of the map cells:
Definition: COccupancyGridMap2D.h:77
mrpt::poses::CPose2D
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle.
Definition: CPose2D.h:40
mrpt::poses::CPoseOrPoint::x
double x() const
Common members of all points & poses classes.
Definition: CPoseOrPoint.h:140
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
round.h
mrpt::maps::COccupancyGridMap2D::sumMonteCarlo
@ sumMonteCarlo
Montecarlo-based estimation.
Definition: COccupancyGridMap2D.h:860
mrpt::maps::COccupancyGridMap2D::TLaserSimulUncertaintyParams::nRays
size_t nRays
Definition: COccupancyGridMap2D.h:897
mrpt::maps::COccupancyGridMap2D::TLaserSimulUncertaintyParams::robotPose
mrpt::poses::CPosePDFGaussian robotPose
The robot pose Gaussian, in map coordinates.
Definition: COccupancyGridMap2D.h:884
mrpt::obs::CObservation2DRangeScanWithUncertainty::rangeScan
CObservation2DRangeScan rangeScan
The observation with the mean ranges in the scan field.
Definition: CObservation2DRangeScanWithUncertainty.h:26
mrpt::obs::CObservationRange
Declares a class derived from "CObservation" that encapsules a single range measurement,...
Definition: CObservationRange.h:30
mrpt::obs::CObservationRange::maxSensorDistance
float maxSensorDistance
Definition: CObservationRange.h:42
mrpt::maps::COccupancyGridMap2D::resolution
float resolution
Cell size, i.e.
Definition: COccupancyGridMap2D.h:110
mrpt::maps::COccupancyGridMap2D::TLaserSimulUncertaintyParams::UT_kappa
double UT_kappa
Definition: COccupancyGridMap2D.h:873
int_y2idx
#define int_y2idx(_Y)
func_laserSimul_callback
static void func_laserSimul_callback(const Eigen::Vector3d &x_pose, const TFunctorLaserSimulData &fixed_param, Eigen::VectorXd &y_scanRanges)
Definition: COccupancyGridMap2D_simulate.cpp:212
mrpt::maps::COccupancyGridMap2D::TLaserSimulUncertaintyParams::rightToLeft
bool rightToLeft
(Default: true) The scanning direction: true=counterclockwise; false=clockwise
Definition: COccupancyGridMap2D.h:890
CObservationRange.h
mrpt::random::getRandomGenerator
CRandomGenerator & getRandomGenerator()
A static instance of a CRandomGenerator class, for use in single-thread applications.
Definition: RandomGenerator.cpp:19
mrpt::maps::COccupancyGridMap2D::TLaserSimulUncertaintyParams::maxRange
float maxRange
(Default: 80) The maximum range allowed by the device, in meters (e.g.
Definition: COccupancyGridMap2D.h:893
maps-precomp.h
MRPT_END
#define MRPT_END
Definition: exceptions.h:266
mrpt::maps::COccupancyGridMap2D
A class for storing an occupancy grid map.
Definition: COccupancyGridMap2D.h:62
mrpt::obs::CObservationRange::end
iterator end()
Definition: CObservationRange.h:72
M_PIf
#define M_PIf
Definition: common.h:61
mrpt::math::transform_gaussian_unscented
void transform_gaussian_unscented(const VECTORLIKE1 &x_mean, const MATLIKE1 &x_cov, void(*functor)(const VECTORLIKE1 &x, const USERPARAM &fixed_param, VECTORLIKE3 &y), const USERPARAM &fixed_param, VECTORLIKE2 &y_mean, MATLIKE2 &y_cov, const bool *elem_do_wrap2pi=nullptr, const double alpha=1e-3, const double K=0, const double beta=2.0)
Scaled unscented transformation (SUT) for estimating the Gaussian distribution of a variable Y=f(X) f...
Definition: transform_gaussian.h:47
mrpt::random
A namespace of pseudo-random numbers generators of diferent distributions.
Definition: random_shuffle.h:17
transform_gaussian.h
mrpt::maps
Definition: CBeacon.h:24
mrpt::maps::COccupancyGridMap2D::sonarSimulator
void sonarSimulator(mrpt::obs::CObservationRange &inout_observation, const mrpt::poses::CPose2D &robotPose, float threshold=0.5f, float rangeNoiseStd=0.f, float angleNoiseStd=mrpt::DEG2RAD(0.f)) const
Simulates the observations of a sonar rig into the current grid map.
Definition: COccupancyGridMap2D_simulate.cpp:69
mrpt::obs::CObservation2DRangeScan::sensorPose
mrpt::poses::CPose3D sensorPose
The 6D pose of the sensor on the robot at the moment of starting the scan.
Definition: CObservation2DRangeScan.h:133
range
GLsizei range
Definition: glext.h:5907
mrpt::maps::COccupancyGridMap2D::TLaserSimulUncertaintyParams
Input params for laserScanSimulatorWithUncertainty()
Definition: COccupancyGridMap2D.h:864
y
GLenum GLint GLint y
Definition: glext.h:3538
mrpt::maps::COccupancyGridMap2D::TLaserSimulUncertaintyParams::TLaserSimulUncertaintyParams
TLaserSimulUncertaintyParams()
Definition: COccupancyGridMap2D_simulate.cpp:184
x
GLenum GLint x
Definition: glext.h:3538
mrpt::maps::COccupancyGridMap2D::TLaserSimulUncertaintyParams::threshold
float threshold
(Default: 0.6f) The minimum occupancy threshold to consider a cell to be occupied
Definition: COccupancyGridMap2D.h:909
CObservation2DRangeScan.h
mrpt::maps::COccupancyGridMap2D::TLaserSimulUncertaintyResult::scanWithUncert
mrpt::obs::CObservation2DRangeScanWithUncertainty scanWithUncert
The scan + its uncertainty.
Definition: COccupancyGridMap2D.h:919
mrpt::DEG2RAD
double DEG2RAD(const double x)
Degrees to radians.
Definition: core/include/mrpt/core/bits_math.h:42



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST