32 float x,
y;
int cx, cy;
54 precomputedLikelihoodToBeRecomputed =
true;
58 robotPose2D =
CPose2D(*robotPose);
59 robotPose3D = (*robotPose);
67 const float maxCertainty = insertionOptions.maxOccupancyUpdateCertainty;
68 float maxFreeCertainty = insertionOptions.maxFreenessUpdateCertainty;
69 if (maxFreeCertainty==.0f) maxFreeCertainty = maxCertainty;
70 float maxFreeCertaintyNoEcho = insertionOptions.maxFreenessInvalidRanges;
71 if (maxFreeCertaintyNoEcho==.0f) maxFreeCertaintyNoEcho = maxCertainty;
73 cellType logodd_observation_free = std::max<cellType>(1, p2l(maxFreeCertainty));
74 cellType logodd_observation_occupied = 3*std::max<cellType>(1, p2l(maxCertainty));
75 cellType logodd_noecho_free = std::max<cellType>(1, p2l(maxFreeCertaintyNoEcho));
78 cellType logodd_thres_occupied = OCCGRID_CELLTYPE_MIN+logodd_observation_occupied;
79 cellType logodd_thres_free = OCCGRID_CELLTYPE_MAX-std::max(logodd_noecho_free, logodd_observation_free);
91 CPose2D laserPose( sensorPose3D );
95 bool reallyInsert = o->
isPlanarScan( insertionOptions.horizontalTolerance );
96 unsigned int decimation = insertionOptions.decimation;
99 if ( insertionOptions.useMapAltitude &&
100 fabs(insertionOptions.mapAltitude - sensorPose3D.z() ) > 0.001 )
102 reallyInsert =
false;
119 const float maxDistanceInsertion = insertionOptions.maxDistanceInsertion;
120 const bool invalidAsFree = insertionOptions.considerInvalidRangesAsFreeSpace;
121 float new_x_max, new_x_min;
122 float new_y_max, new_y_min;
123 float last_valid_range = maxDistanceInsertion;
125 int K = updateInfoChangeOnly.enabled ? updateInfoChangeOnly.laserRaysSkip : decimation;
126 size_t idx,nRanges = o->
scan.
size();
133 #if defined(_DEBUG) || (MRPT_ALWAYS_CHECKS_DEBUG) 139 if ( !insertionOptions.wideningBeamsWithDistance )
146 float *scanPoints_x = (
float*)
mrpt_alloca(
sizeof(
float) * nRanges );
147 float *scanPoints_y = (
float*)
mrpt_alloca(
sizeof(
float) * nRanges );
149 float *scanPoint_x,*scanPoint_y;
164 new_x_max = -(numeric_limits<float>::max)();
165 new_x_min = (numeric_limits<float>::max)();
166 new_y_max = -(numeric_limits<float>::max)();
167 new_y_min = (numeric_limits<float>::max)();
169 for (idx=0, scanPoint_x=scanPoints_x,scanPoint_y=scanPoints_y;idx<nRanges;idx+=K,scanPoint_x++,scanPoint_y++)
173 curRange = o->
scan[idx];
174 float R =
min(maxDistanceInsertion,curRange);
176 *scanPoint_x = px + cos(A)*
R;
177 *scanPoint_y = py + sin(A)*
R;
178 last_valid_range = curRange;
185 float R =
min(maxDistanceInsertion,0.5f*last_valid_range);
186 *scanPoint_x = px + cos(A)*
R;
187 *scanPoint_y = py + sin(A)*
R;
198 new_x_max = max( new_x_max, *scanPoint_x );
199 new_x_min =
min( new_x_min, *scanPoint_x );
200 new_y_max = max( new_y_max, *scanPoint_y );
201 new_y_min =
min( new_y_min, *scanPoint_y );
205 float securMargen = 15*resolution;
207 if (new_x_max>x_max-securMargen)
208 new_x_max+= 2*securMargen;
209 else new_x_max = x_max;
210 if (new_x_min<x_min+securMargen)
212 else new_x_min = x_min;
214 if (new_y_max>y_max-securMargen)
215 new_y_max+= 2*securMargen;
216 else new_y_max = y_max;
217 if (new_y_min<y_min+securMargen)
219 else new_y_min = y_min;
224 resizeGrid(new_x_min,new_x_max, new_y_min,new_y_max,0.5);
228 unsigned theMapSize_x = size_x;
235 for (idx=0;idx<nRanges;idx+=K)
237 if ( !o->
validRange[idx] && !invalidAsFree )
continue;
244 int trg_cx = x2idx(scanPoints_x[idx]);
245 int trg_cy = y2idx(scanPoints_y[idx]);
249 static_cast<unsigned int>(trg_cx) < size_x &&
250 static_cast<unsigned int>(trg_cy) < size_y);
254 int Acx = trg_cx - cx;
255 int Acy = trg_cy - cy;
260 int nStepsRay = max( Acx_, Acy_ );
261 if (!nStepsRay)
continue;
264 float N_1 = 1.0f / nStepsRay;
267 int frAcx = (Acx<0 ? -1:+1)*
round((Acx_ <<
FRBITS) * N_1);
268 int frAcy = (Acy<0 ? -1:+1)*
round((Acy_ <<
FRBITS) * N_1);
272 const auto logodd_free = o->
validRange[idx] ? logodd_observation_free : logodd_noecho_free;
274 for (
int nStep = 0;nStep<nStepsRay;nStep++)
276 updateCell_fast_free(cx,cy, logodd_free, logodd_thres_free, theMapArray, theMapSize_x );
290 updateCell_fast_occupied(trg_cx,trg_cy, logodd_observation_occupied, logodd_thres_occupied, theMapArray, theMapSize_x );
315 new_x_max = -(numeric_limits<float>::max)();
316 new_x_min = (numeric_limits<float>::max)();
317 new_y_max = -(numeric_limits<float>::max)();
318 new_y_min = (numeric_limits<float>::max)();
320 last_valid_range = maxDistanceInsertion;
321 for (idx=0;idx<nRanges;idx+=K)
323 float scanPoint_x,scanPoint_y;
326 curRange = o->
scan[idx];
327 float R =
min(maxDistanceInsertion,curRange);
329 scanPoint_x = px + cos(A)*
R;
330 scanPoint_y = py + sin(A)*
R;
331 last_valid_range = curRange;
338 float R =
min(maxDistanceInsertion,0.5f*last_valid_range);
339 scanPoint_x = px + cos(A)*
R;
340 scanPoint_y = py + sin(A)*
R;
351 new_x_max = max( new_x_max, scanPoint_x );
352 new_x_min =
min( new_x_min, scanPoint_x );
353 new_y_max = max( new_y_max, scanPoint_y );
354 new_y_min =
min( new_y_min, scanPoint_y );
358 float securMargen = 15*resolution;
360 if (new_x_max>x_max-securMargen)
361 new_x_max+= 2*securMargen;
362 else new_x_max = x_max;
363 if (new_x_min<x_min+securMargen)
365 else new_x_min = x_min;
367 if (new_y_max>y_max-securMargen)
368 new_y_max+= 2*securMargen;
369 else new_y_max = y_max;
370 if (new_y_min<y_min+securMargen)
372 else new_y_min = y_min;
377 resizeGrid(new_x_min,new_x_max, new_y_min,new_y_max,0.5);
381 unsigned theMapSize_x = size_x;
405 last_valid_range = maxDistanceInsertion;
407 const double dA_2 = 0.5 * o->
aperture / N;
408 for (idx=0;idx<nRanges; idx+=K, A+=dAK)
413 curRange = o->
scan[idx];
414 last_valid_range = curRange;
415 theR =
min(maxDistanceInsertion,curRange);
422 theR =
min(maxDistanceInsertion,0.5f*last_valid_range);
426 if (theR < resolution)
continue;
435 P1.
x = px + cos(A-dA_2) * theR;
436 P1.
y = py + sin(A-dA_2) * theR;
438 P2.
x = px + cos(A+dA_2) * theR;
439 P2.
y = py + sin(A+dA_2) * theR;
442 if (P2.
y<P1.
y) std::swap(P2,P1);
443 if (P2.
y<P0.
y) std::swap(P2,P0);
444 if (P1.
y<P0.
y) std::swap(P1,P0);
448 P0.
cx = x2idx( P0.
x ); P0.
cy = y2idx( P0.
y );
449 P1.
cx = x2idx( P1.
x ); P1.
cy = y2idx( P1.
y );
450 P2.
cx = x2idx( P2.
x ); P2.
cy = y2idx( P2.
y );
452 #if defined(_DEBUG) || (MRPT_ALWAYS_CHECKS_DEBUG) 454 ASSERT_( static_cast<unsigned int>(P0.
cx)<size_x && static_cast<unsigned int>(P0.
cy)<size_y );
455 ASSERT_( static_cast<unsigned int>(P1.
cx)<size_x && static_cast<unsigned int>(P1.
cy)<size_y );
456 ASSERT_( static_cast<unsigned int>(P2.
cx)<size_x && static_cast<unsigned int>(P2.
cy)<size_y );
459 struct {
int frX,frY;
int cx,cy; } R1,R2;
468 for (
int ccx=min_cx;ccx<=max_cx;ccx++)
469 updateCell_fast_free(ccx,P0.
cy, logodd_observation_free, logodd_thres_free, theMapArray, theMapSize_x );
475 P1b.
x = P0.
x + (P1.
y-P0.
y) * (P2.
x-P0.
x) / (P2.
y-P0.
y);
477 P1b.
cx= x2idx( P1b.
x ); P1b.
cy= y2idx( P1b.
y );
482 const int Acx01 = P1.
cx - P0.
cx;
483 const int Acy01 = P1.
cy - P0.
cy;
484 const int Acx01b = P1b.
cx - P0.
cx;
488 const float inv_N_01 = 1.0f / (
max3(abs(Acx01),abs(Acy01),abs(Acx01b)) + 1 );
489 const int frAcx01 =
round( (Acx01<<
FRBITS) * inv_N_01 );
490 const int frAcy01 =
round( (Acy01<<
FRBITS) * inv_N_01 );
491 const int frAcx01b =
round((Acx01b<<
FRBITS)* inv_N_01 );
501 int frAx_R1=0, frAx_R2=0;
502 int frAy_R1 = frAcy01;
531 int last_insert_cy = -1;
535 if (last_insert_cy!=R1.cy)
537 last_insert_cy = R1.cy;
540 for (
int ccx=R1.cx;ccx<=R2.cx;ccx++)
541 updateCell_fast_free(ccx,R1.cy, logodd_observation_free, logodd_thres_free, theMapArray, theMapSize_x );
544 R1.frX += frAx_R1; R1.frY += frAy_R1;
550 }
while ( R1.cy < P1.
cy );
558 const int Acx12 = P2.
cx - P1.
cx;
559 const int Acy12 = P2.
cy - P1.
cy;
560 const int Acx1b2 = P2.
cx - P1b.
cx;
564 const float inv_N_12 = 1.0f / (
max3(abs(Acx12),abs(Acy12),abs(Acx1b2)) + 1 );
565 const int frAcx12 =
round( (Acx12<<
FRBITS) * inv_N_12 );
566 const int frAcy12 =
round( (Acy12<<
FRBITS) * inv_N_12 );
567 const int frAcx1b2 =
round((Acx1b2<<
FRBITS)* inv_N_12 );
607 if (last_insert_cy!=R1.cy)
610 last_insert_cy = R1.cy;
611 for (
int ccx=R1.cx;ccx<=R2.cx;ccx++)
612 updateCell_fast_free(ccx,R1.cy, logodd_observation_free, logodd_thres_free, theMapArray, theMapSize_x );
615 R1.frX += frAx_R1; R1.frY += frAy_R1;
621 }
while ( R1.cy <= P2.
cy );
635 P1.
x = px + cos(A-dA_2) * theR;
636 P1.
y = py + sin(A-dA_2) * theR;
638 P2.
x = px + cos(A+dA_2) * theR;
639 P2.
y = py + sin(A+dA_2) * theR;
641 P1.
cx = x2idx( P1.
x ); P1.
cy = y2idx( P1.
y );
642 P2.
cx = x2idx( P2.
x ); P2.
cy = y2idx( P2.
y );
644 #if defined(_DEBUG) || (MRPT_ALWAYS_CHECKS_DEBUG) 646 ASSERT_( static_cast<unsigned int>(P1.
cx)<size_x && static_cast<unsigned int>(P1.
cy)<size_y );
647 ASSERT_( static_cast<unsigned int>(P2.
cx)<size_x && static_cast<unsigned int>(P2.
cy)<size_y );
653 updateCell_fast_occupied(P1.
cx,P1.
cy, logodd_observation_occupied, logodd_thres_occupied, theMapArray, theMapSize_x );
659 const int AcxE = P2.
cx - P1.
cx;
660 const int AcyE = P2.
cy - P1.
cy;
663 const int nSteps = ( max(abs(AcxE),abs(AcyE)) + 1 );
664 const float inv_N_12 = 1.0f / nSteps;
665 const int frAcxE =
round( (AcxE<<
FRBITS) * inv_N_12 );
666 const int frAcyE =
round( (AcyE<<
FRBITS) * inv_N_12 );
673 for (
int nStep=0;nStep<=nSteps;nStep++)
675 updateCell_fast_occupied(R1.cx,R1.cy, logodd_observation_occupied, logodd_thres_occupied, theMapArray, theMapSize_x );
705 CPose3D sensorPose3D = robotPose3D + spose;
706 CPose2D laserPose( sensorPose3D );
710 bool reallyInsert =
true;
711 unsigned int decimation = insertionOptions.decimation;
714 if ( insertionOptions.useMapAltitude &&
715 fabs(insertionOptions.mapAltitude - sensorPose3D.z() ) > 0.001 )
717 reallyInsert =
false;
730 const float maxDistanceInsertion = insertionOptions.maxDistanceInsertion;
731 const bool invalidAsFree = insertionOptions.considerInvalidRangesAsFreeSpace;
732 float new_x_max, new_x_min;
733 float new_y_max, new_y_min;
734 float last_valid_range = maxDistanceInsertion;
736 int K = updateInfoChangeOnly.enabled ? updateInfoChangeOnly.laserRaysSkip : decimation;
744 #if defined(_DEBUG) || (MRPT_ALWAYS_CHECKS_DEBUG) 756 new_x_max = -(numeric_limits<float>::max)();
757 new_x_min = (numeric_limits<float>::max)();
758 new_y_max = -(numeric_limits<float>::max)();
759 new_y_min = (numeric_limits<float>::max)();
761 last_valid_range = maxDistanceInsertion;
763 for (idx=0;idx<nRanges;idx+=K)
765 float scanPoint_x,scanPoint_y;
766 if ( o->
sensedData[idx].sensedDistance < maxDistanceInsertion )
769 float R =
min(maxDistanceInsertion,curRange);
771 scanPoint_x = px + cos(A)*
R;
772 scanPoint_y = py + sin(A)*
R;
773 last_valid_range = curRange;
780 float R =
min(maxDistanceInsertion,0.5f*last_valid_range);
781 scanPoint_x = px + cos(A)*
R;
782 scanPoint_y = py + sin(A)*
R;
793 new_x_max = max( new_x_max, scanPoint_x );
794 new_x_min =
min( new_x_min, scanPoint_x );
795 new_y_max = max( new_y_max, scanPoint_y );
796 new_y_min =
min( new_y_min, scanPoint_y );
800 float securMargen = 15*resolution;
802 if (new_x_max>x_max-securMargen)
803 new_x_max+= 2*securMargen;
804 else new_x_max = x_max;
805 if (new_x_min<x_min+securMargen)
807 else new_x_min = x_min;
809 if (new_y_max>y_max-securMargen)
810 new_y_max+= 2*securMargen;
811 else new_y_max = y_max;
812 if (new_y_min<y_min+securMargen)
814 else new_y_min = y_min;
819 resizeGrid(new_x_min,new_x_max, new_y_min,new_y_max,0.5);
823 unsigned theMapSize_x = size_x;
839 last_valid_range = maxDistanceInsertion;
842 for (idx=0;idx<nRanges; idx+=K, A+=dAK)
845 if ( o->
sensedData[idx].sensedDistance < maxDistanceInsertion )
848 last_valid_range = curRange;
849 theR =
min(maxDistanceInsertion,curRange);
856 theR =
min(maxDistanceInsertion,0.5f*last_valid_range);
860 if (theR < resolution)
continue;
869 P1.
x = px + cos(A-dA_2) * theR;
870 P1.
y = py + sin(A-dA_2) * theR;
872 P2.
x = px + cos(A+dA_2) * theR;
873 P2.
y = py + sin(A+dA_2) * theR;
876 if (P2.
y<P1.
y) std::swap(P2,P1);
877 if (P2.
y<P0.
y) std::swap(P2,P0);
878 if (P1.
y<P0.
y) std::swap(P1,P0);
882 P0.
cx = x2idx( P0.
x ); P0.
cy = y2idx( P0.
y );
883 P1.
cx = x2idx( P1.
x ); P1.
cy = y2idx( P1.
y );
884 P2.
cx = x2idx( P2.
x ); P2.
cy = y2idx( P2.
y );
886 #if defined(_DEBUG) || (MRPT_ALWAYS_CHECKS_DEBUG) 888 ASSERT_( static_cast<unsigned int>(P0.
cx)<size_x && static_cast<unsigned int>(P0.
cy)<size_y );
889 ASSERT_( static_cast<unsigned int>(P1.
cx)<size_x && static_cast<unsigned int>(P1.
cy)<size_y );
890 ASSERT_( static_cast<unsigned int>(P2.
cx)<size_x && static_cast<unsigned int>(P2.
cy)<size_y );
893 struct {
int frX,frY;
int cx,cy; } R1,R2;
902 for (
int ccx=min_cx;ccx<=max_cx;ccx++)
903 updateCell_fast_free(ccx,P0.
cy, logodd_observation_free, logodd_thres_free, theMapArray, theMapSize_x );
909 P1b.
x = P0.
x + (P1.
y-P0.
y) * (P2.
x-P0.
x) / (P2.
y-P0.
y);
911 P1b.
cx= x2idx( P1b.
x ); P1b.
cy= y2idx( P1b.
y );
916 const int Acx01 = P1.
cx - P0.
cx;
917 const int Acy01 = P1.
cy - P0.
cy;
918 const int Acx01b = P1b.
cx - P0.
cx;
922 const float inv_N_01 = 1.0f / (
max3(abs(Acx01),abs(Acy01),abs(Acx01b)) + 1 );
923 const int frAcx01 =
round( (Acx01<<
FRBITS) * inv_N_01 );
924 const int frAcy01 =
round( (Acy01<<
FRBITS) * inv_N_01 );
925 const int frAcx01b =
round((Acx01b<<
FRBITS)* inv_N_01 );
935 int frAx_R1=0, frAx_R2=0;
936 int frAy_R1 = frAcy01;
964 int last_insert_cy = -1;
968 if (last_insert_cy!=R1.cy)
970 last_insert_cy = R1.cy;
973 for (
int ccx=R1.cx;ccx<=R2.cx;ccx++)
974 updateCell_fast_free(ccx,R1.cy, logodd_observation_free, logodd_thres_free, theMapArray, theMapSize_x );
977 R1.frX += frAx_R1; R1.frY += frAy_R1;
983 }
while ( R1.cy < P1.
cy );
990 const int Acx12 = P2.
cx - P1.
cx;
991 const int Acy12 = P2.
cy - P1.
cy;
992 const int Acx1b2 = P2.
cx - P1b.
cx;
996 const float inv_N_12 = 1.0f / (
max3(abs(Acx12),abs(Acy12),abs(Acx1b2)) + 1 );
997 const int frAcx12 =
round( (Acx12<<
FRBITS) * inv_N_12 );
998 const int frAcy12 =
round( (Acy12<<
FRBITS) * inv_N_12 );
999 const int frAcx1b2 =
round((Acx1b2<<
FRBITS)* inv_N_12 );
1034 last_insert_cy=-100;
1039 if (last_insert_cy!=R1.cy)
1042 last_insert_cy = R1.cy;
1043 for (
int ccx=R1.cx;ccx<=R2.cx;ccx++)
1044 updateCell_fast_free(ccx,R1.cy, logodd_observation_free, logodd_thres_free, theMapArray, theMapSize_x );
1047 R1.frX += frAx_R1; R1.frY += frAy_R1;
1050 R1.cx = R1.frX >>
FRBITS;
1051 R1.cy = R1.frY >>
FRBITS;
1052 R2.cx = R2.frX >>
FRBITS;
1053 }
while ( R1.cy <= P2.
cy );
1063 if ( o->
sensedData[idx].sensedDistance < maxDistanceInsertion )
1067 P1.
x = px + cos(A-dA_2) * theR;
1068 P1.
y = py + sin(A-dA_2) * theR;
1070 P2.
x = px + cos(A+dA_2) * theR;
1071 P2.
y = py + sin(A+dA_2) * theR;
1073 P1.
cx = x2idx( P1.
x ); P1.
cy = y2idx( P1.
y );
1074 P2.
cx = x2idx( P2.
x ); P2.
cy = y2idx( P2.
y );
1076 #if defined(_DEBUG) || (MRPT_ALWAYS_CHECKS_DEBUG) 1078 ASSERT_( static_cast<unsigned int>(P1.
cx)<size_x && static_cast<unsigned int>(P1.
cy)<size_y );
1079 ASSERT_( static_cast<unsigned int>(P2.
cx)<size_x && static_cast<unsigned int>(P2.
cy)<size_y );
1085 updateCell_fast_occupied(P1.
cx,P1.
cy, logodd_observation_occupied, logodd_thres_occupied, theMapArray, theMapSize_x );
1091 const int AcxE = P2.
cx - P1.
cx;
1092 const int AcyE = P2.
cy - P1.
cy;
1095 const int nSteps = ( max(abs(AcxE),abs(AcyE)) + 1 );
1096 const float inv_N_12 = 1.0f / nSteps;
1097 const int frAcxE =
round( (AcxE<<
FRBITS) * inv_N_12 );
1098 const int frAcyE =
round( (AcyE<<
FRBITS) * inv_N_12 );
1105 for (
int nStep=0;nStep<=nSteps;nStep++)
1107 updateCell_fast_occupied(R1.cx,R1.cy, logodd_observation_occupied, logodd_thres_occupied, theMapArray, theMapSize_x );
1111 R1.cx = R1.frX >>
FRBITS;
1112 R1.cy = R1.frY >>
FRBITS;
1143 useMapAltitude ( false ),
1144 maxDistanceInsertion ( 15.0f ),
1145 maxOccupancyUpdateCertainty ( 0.65f ),
1146 maxFreenessUpdateCertainty ( .0f ),
1147 maxFreenessInvalidRanges ( .0f ),
1148 considerInvalidRangesAsFreeSpace ( true ),
1150 horizontalTolerance (
DEG2RAD(0.05) ),
1152 CFD_features_gaussian_size ( 1 ),
1153 CFD_features_median_size ( 3 ),
1155 wideningBeamsWithDistance ( false )
1186 out.
printf(
"\n----------- [COccupancyGridMap2D::TInsertionOptions] ------------ \n\n");
double x() const
Common members of all points & poses classes.
Declares a class derived from "CObservation" that encapsules a single range measurement, and associated parameters.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
const T min3(const T &A, const T &B, const T &C)
Local stucture used in the next method (must be here for usage within STL stuff)
float sensorConeApperture
Cone aperture of each ultrasonic beam, in radians.
#define MRPT_CHECK_NORMAL_NUMBER(val)
#define LOADABLEOPTS_DUMP_VAR(variableName, variableType)
Macro for dumping a variable to a stream, within the method "dumpToTextStream(out)" (Variable types a...
virtual bool internal_insertObservation(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL) MRPT_OVERRIDE
Insert the observation information into this map.
This class allows loading and storing values and vectors of different types from a configuration text...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
virtual const mrpt::utils::TRuntimeClassId * GetRuntimeClass() const
Returns information about the class of an object in runtime.
mrpt::math::CMatrixDouble44 getHomogeneousMatrixVal() const
bool isPlanarScan(const double tolerance=0) const
Return true if the laser scanner is "horizontal", so it has an absolute value of "pitch" and "roll" l...
This namespace contains representation of robot actions and observations.
mrpt::utils::ContainerReadOnlyProxyAccessor< std::vector< char > > validRange
It's false (=0) on no reflected rays, referenced to elements in scan.
GLsizei const GLchar ** string
#define mrpt_alloca(nBytes)
In platforms and compilers with support to "alloca", allocate a memory block on the stack; if alloca ...
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
#define CLASS_ID(class_name)
Access to runtime class ID for a defined class name.
#define MRPT_LOAD_CONFIG_VAR(variableName, variableType, configFileObject, sectionNameStr)
An useful macro for loading variables stored in a INI-like file under a key with the same name that t...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Declares a class that represents any robot's observation.
#define MRPT_LOAD_CONFIG_VAR_DEGREES(variableName, configFileObject, sectionNameStr)
Loads a double variable, stored as radians but entered in the INI-file as degrees.
const double & phi() const
Get the phi angle of the 2D pose (in radians)
bool m_is_empty
True upon construction; used by isEmpty()
float aperture
The "aperture" or field-of-view of the range finder, in radians (typically M_PI = 180 degrees)...
const T max3(const T &A, const T &B, const T &C)
int round(const T value)
Returns the closer integer (int) to x.
void dumpToTextStream(mrpt::utils::CStream &out) const MRPT_OVERRIDE
This method should clearly display all the contents of the structure in textual form, sending it to a CStream.
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const MRPT_OVERRIDE
A general method to retrieve the sensor pose on the robot.
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string §ion) MRPT_OVERRIDE
This method load the options from a ".ini" file.
#define mrpt_alloca_free(mem_block)
This method must be called to "free" each memory block allocated with "system::alloca": If the block ...
mrpt::utils::ContainerReadOnlyProxyAccessor< std::vector< float > > scan
The range values of the scan, in meters. Must have same length than validRange.
TInsertionOptions()
Initilization of default parameters.
int16_t cellType
The type of the map cells:
mrpt::poses::CPose3D sensorPose
The 6D pose of the sensor on the robot at the moment of starting the scan.
TMeasurementList sensedData
All the measurements.
virtual int printf(const char *fmt,...) MRPT_printf_format_check(2
Writes a string to the stream in a textual form.
bool rightToLeft
The scanning direction: true=counterclockwise; false=clockwise.
virtual void OnPostSuccesfulInsertObs(const mrpt::obs::CObservation *) MRPT_OVERRIDE
See base class.