57 this->initialBeacons.clear();
58 const unsigned int nBeacons =
source.read_int(sSectCreation,
"nBeacons",0);
59 for (
unsigned int q=1;
q<=nBeacons;
q++)
62 newPair.second =
source.read_int(sSectCreation,
format(
"beacon_%03u_ID",
q),0);
64 newPair.first.x=
source.read_float(sSectCreation,
format(
"beacon_%03u_x",
q),0);
65 newPair.first.y=
source.read_float(sSectCreation,
format(
"beacon_%03u_y",
q),0);
66 newPair.first.z=
source.read_float(sSectCreation,
format(
"beacon_%03u_z",
q),0);
68 this->initialBeacons.push_back(newPair);
71 insertionOpts.loadFromConfigFile(
source, sectionNamePrefix+
string(
"_insertOpts") );
72 likelihoodOpts.loadFromConfigFile(
source, sectionNamePrefix+
string(
"_likelihoodOpts") );
77 out.
printf(
"number of initial beacons = %u\n",(
int)initialBeacons.size());
79 out.
printf(
" ID (X,Y,Z)\n");
80 out.
printf(
"--------------------------------------------------------\n");
82 out.
printf(
" %03u (%8.03f,%8.03f,%8.03f)\n",
p->second,
p->first.x,
p->first.y,
p->first.z);
84 this->insertionOpts.dumpToTextStream(out);
85 this->likelihoodOpts.dumpToTextStream(out);
112 obj->landmarks.push_back( lm );
127 std::map<std::pair<mrpt::maps::CLandmark::TLandmarkID, mrpt::maps::CLandmark::TLandmarkID>,
double> CLandmarksMap::_mEDD;
129 bool CLandmarksMap::_maxIDUpdated =
false;
304 unsigned int sensedID = it->beaconID;
310 (lm_it->ID == sensedID)&&
313 lm_it->getPose( beaconPDF );
314 beacon3D = beaconPDF.
mean;
317 point3D = robotPose3D + it->sensorLocationOnRobot;
319 const float expectedRange = point3D.
distanceTo( beacon3D );
320 float sensedDist = it->sensedDistance;
321 if (sensedDist<0) sensedDist=0;
325 ret += (-0.5f*
square( ( expectedRange - sensedDist ) / sensorStd ));
361 dij(0,0) = o->
pose.
mean.
x() - sensorPose3D.
x();
362 dij(0,1) = o->
pose.
mean.
y() - sensorPose3D.
y();
363 dij(0,2) = o->
pose.
mean.z() - sensorPose3D.z();
372 double distMahaFlik2 = dij.multiply_HCHt_scalar(Cij_1);
392 double earth_radius=6378137;
455 robotPose2D =
CPose2D(*robotPose);
456 robotPose3D = (*robotPose);
572 float maxDistForCorrespondence,
573 float maxAngularDistForCorrespondence,
574 const CPose2D &angularDistPivotPoint,
576 float &correspondencesRatio,
578 bool onlyKeepTheClosest,
579 bool onlyUniqueRobust )
const 588 CPose3D otherMapPose3D(otherMapPose);
590 correspondencesRatio = 0;
595 std::vector<bool> otherCorrespondences;
604 correspondencesRatio,
605 otherCorrespondences );
644 for (sift=siftList.
begin();sift!=siftList.
end();sift++)
654 landmark3DPositionPDF.
mean*= d;
660 D(0,0) =
square( 0.5 * d );
673 Normal *= -1/Normal.
norm();
711 fExt.options = feat_options;
725 std::cerr <<
"Warning: insertionOptions.PLOT_IMAGES has no effect since MRPT 0.9.1\n";
743 stereoParams.
minZ = 0.0f;
746 size_t numM = matchesList.size();
754 (*ii).seenTimesCount = 1;
757 printf(
"%u (out of %u) corrs!\n",static_cast<unsigned>(
landmarks.
size()), static_cast<unsigned>(numM) );
778 double R11 = HM.get_unsafe(0,0);
779 double R12 = HM.get_unsafe(0,1);
780 double R13 = HM.get_unsafe(0,2);
781 double R21 = HM.get_unsafe(1,0);
782 double R22 = HM.get_unsafe(1,1);
783 double R23 = HM.get_unsafe(1,2);
784 double R31 = HM.get_unsafe(2,0);
785 double R32 = HM.get_unsafe(2,1);
786 double R33 = HM.get_unsafe(2,2);
788 double c11,c22,c33,c12,c13,c23;
798 float C11 = lm->pose_cov_11;
799 float C22 = lm->pose_cov_22;
800 float C33 = lm->pose_cov_33;
801 float C12 = lm->pose_cov_12;
802 float C13 = lm->pose_cov_13;
803 float C23 = lm->pose_cov_23;
806 c11 = R11*(C11* R11 + C12 *R12 + C13 *R13) + R12 *(C12 *R11 + C22 *R12 + C23 *R13) + R13 *(C13 *R11 + C23 *R12 + C33 *R13);
807 c12 = (C11 *R11 + C12 *R12 + C13 *R13) *R21 + (C12 *R11 + C22 *R12 + C23 *R13) *R22 + (C13 *R11 + C23 *R12 + C33 *R13) *R23;
808 c13 = (C11 *R11 + C12 *R12 + C13 *R13) *R31 + (C12 *R11 + C22 *R12 + C23 *R13) *R32 + (C13 *R11 + C23 *R12 + C33 *R13) *R33;
809 c22 = R21 *(C11 *R21 + C12 *R22 + C13 *R23) + R22 *(C12 *R21 + C22 *R22 + C23 *R23) + R23 *(C13 *R21 + C23 *R22 + C33 *R23);
810 c23 = (C11 *R21 + C12 *R22 + C13 *R23) *R31 + (C12 *R21 + C22 *R22 + C23 *R23) *R32 + (C13 *R21 + C23 *R22 + C33 *R23) *R33;
811 c33 = R31 *(C11 *R31 + C12 *R32 + C13 *R33) + R32 *(C12 *R31 + C22 *R32 + C23 *R33) + R33 *(C13 *R31 + C23 *R32 + C33 *R33);
814 lm->pose_cov_11 = c11;
815 lm->pose_cov_22 = c22;
816 lm->pose_cov_33 = c33;
817 lm->pose_cov_12 = c12;
818 lm->pose_cov_13 = c13;
819 lm->pose_cov_23 = c23;
823 float Nx = lm->normal.x;
824 float Ny = lm->normal.y;
825 float Nz = lm->normal.z;
827 lm->normal.x = Nx * R11 + Ny * R12 + Nz * R13;
828 lm->normal.y = Nx * R21 + Ny * R22 + Nz * R23;
829 lm->normal.z = Nx * R31 + Ny * R32 + Nz * R33;
848 double R11 = HM.get_unsafe(0,0);
849 double R12 = HM.get_unsafe(0,1);
850 double R13 = HM.get_unsafe(0,2);
851 double R21 = HM.get_unsafe(1,0);
852 double R22 = HM.get_unsafe(1,1);
853 double R23 = HM.get_unsafe(1,2);
854 double R31 = HM.get_unsafe(2,0);
855 double R32 = HM.get_unsafe(2,1);
856 double R33 = HM.get_unsafe(2,2);
858 double c11,c22,c33,c12,c13,c23;
871 float C11 = lm->pose_cov_11;
872 float C22 = lm->pose_cov_22;
873 float C33 = lm->pose_cov_33;
874 float C12 = lm->pose_cov_12;
875 float C13 = lm->pose_cov_13;
876 float C23 = lm->pose_cov_23;
879 c11 = R11*(C11* R11 + C12 *R12 + C13 *R13) + R12 *(C12 *R11 + C22 *R12 + C23 *R13) + R13 *(C13 *R11 + C23 *R12 + C33 *R13);
880 c12 = (C11 *R11 + C12 *R12 + C13 *R13) *R21 + (C12 *R11 + C22 *R12 + C23 *R13) *R22 + (C13 *R11 + C23 *R12 + C33 *R13) *R23;
881 c13 = (C11 *R11 + C12 *R12 + C13 *R13) *R31 + (C12 *R11 + C22 *R12 + C23 *R13) *R32 + (C13 *R11 + C23 *R12 + C33 *R13) *R33;
882 c22 = R21 *(C11 *R21 + C12 *R22 + C13 *R23) + R22 *(C12 *R21 + C22 *R22 + C23 *R23) + R23 *(C13 *R21 + C23 *R22 + C33 *R23);
883 c23 = (C11 *R21 + C12 *R22 + C13 *R23) *R31 + (C12 *R21 + C22 *R22 + C23 *R23) *R32 + (C13 *R21 + C23 *R22 + C33 *R23) *R33;
884 c33 = R31 *(C11 *R31 + C12 *R32 + C13 *R33) + R32 *(C12 *R31 + C22 *R32 + C23 *R33) + R33 *(C13 *R31 + C23 *R32 + C33 *R33);
896 float Nx = lm->normal.x;
897 float Ny = lm->normal.y;
898 float Nz = lm->normal.z;
900 newLandmark.
normal.
x = Nx * R11 + Ny * R12 + Nz * R13;
901 newLandmark.
normal.
y = Nx * R21 + Ny * R22 + Nz * R23;
902 newLandmark.
normal.
z = Nx * R31 + Ny * R32 + Nz * R33;
904 newLandmark.
ID = lm->ID;
906 newLandmark.
features = lm->features;
926 std::vector<bool> otherCorrs(other.
size(),
false);
934 unsigned int nRemoved = 0;
936 if (!justInsertAllOfThem )
947 for (corrIt=corrs.begin();corrIt!=corrs.end();corrIt++)
980 if ( !otherCorrs[i] )
988 if (!justInsertAllOfThem )
1012 printf(
"[CLandmarksMap::fuseWith] %u fused/ %u new/ %u removed -> %u total\n",
1013 static_cast<unsigned int>(corrs.size()),
1014 static_cast<unsigned int>(other.
size()-corrs.size()),
1015 static_cast<unsigned int>(nRemoved),
1018 fprintf(f,
"%u\t%u\t%u\t%u\n",
1019 static_cast<unsigned int>(corrs.size()),
1020 static_cast<unsigned int>(other.
size()-corrs.size()),
1021 static_cast<unsigned int>(nRemoved),
1037 float &correspondencesRatio,
1038 std::vector<bool> &otherCorrespondences)
const 1043 unsigned int nThis,nOther;
1046 unsigned int i,
n,j,k;
1048 double lik_dist, lik_desc, lik, maxLik;
1051 std::vector<bool> thisLandmarkAssigned;
1052 double K_desc = 0.0;
1053 double K_dist = 0.0;
1062 thisLandmarkAssigned.resize( nThis,
false );
1065 correspondences.clear();
1066 otherCorrespondences.clear();
1067 otherCorrespondences.resize( nOther,
false );
1068 correspondencesRatio = 0;
1089 otherIt->getPose( pointPDF_k );
1112 thisIt->features.size() == otherIt->features.size() &&
1113 !thisIt->features.empty() &&
1114 thisIt->features[0].present() && otherIt->features[0].present() &&
1115 thisIt->features[0]->descriptors.SIFT.size()==otherIt->features[0]->descriptors.SIFT.size()
1121 thisIt->getPose( pointPDF_j );
1126 double distMahaFlik2;
1129 dij(0,0) = pointPDF_k.
mean.
x() - pointPDF_j.
mean.
x();
1130 dij(0,1) = pointPDF_k.
mean.
y() - pointPDF_j.
mean.
y();
1131 dij(0,2) = pointPDF_k.
mean.z() - pointPDF_j.
mean.z();
1137 distMahaFlik2 = dij.multiply_HCHt_scalar(Cij_1);
1139 lik_dist = exp( K_dist * distMahaFlik2 );
1141 if( lik_dist > 1e-2 )
1149 std::pair<mrpt::maps::CLandmark::TLandmarkID, mrpt::maps::CLandmark::TLandmarkID> mPair( thisIt->ID, otherIt->ID );
1153 n = otherIt->features[0]->descriptors.SIFT.size();
1156 desc +=
square( otherIt->features[0]->descriptors.SIFT[i] - thisIt->features[0]->descriptors.SIFT[i] );
1168 lik_desc = exp( K_desc * desc );
1177 lik = lik_dist*lik_desc;
1200 if ( !thisLandmarkAssigned[ maxIdx ] )
1202 thisLandmarkAssigned[ maxIdx ] =
true;
1205 otherCorrespondences[ k ] =
true;
1217 correspondences.push_back( match );
1226 correspondencesRatio = correspondences.size() /
static_cast<float>(nOther);
1243 unsigned int dLen = anotherMap->
landmarks.
begin()->features[0]->descriptors.SIFT.size();
1247 unsigned int mEDDidx = 0;
1252 for ( i = 0; i < dLen; i++ )
1253 EDD +=
square( otherIt->features[0]->descriptors.SIFT[i] - thisIt->features[0]->descriptors.SIFT[i] );
1267 if ( !thisLandmarkAssigned[ mEDDidx ] )
1270 thisLandmarkAssigned[ mEDDidx ] =
true;
1273 otherCorrespondences[k] =
true;
1275 otherIt->getPose( pointPDF_k );
1276 thisIt->getPose( pointPDF_j );
1288 correspondences.push_back( match );
1296 correspondencesRatio = correspondences.size() /
static_cast<float>(nOther);
1315 if (!f)
return false;
1327 static_cast<int>(it->getType()),
1334 ASSERT_( !it->features.empty() && it->features[0].present() )
1336 for (
unsigned int i=0;i<it->features[0]->descriptors.SIFT.size();i++)
1337 os::fprintf(f,
" %u ",it->features[0]->descriptors.SIFT[i]);
1358 float confInterval )
const 1361 if (!f)
return false;
1364 os::fprintf(f,
"%%-------------------------------------------------------\n");
1365 os::fprintf(f,
"%% File automatically generated using the MRPT method:\n");
1366 os::fprintf(f,
"%% 'CLandmarksMap::saveToMATLABScript3D'\n");
1369 os::fprintf(f,
"%% Jose Luis Blanco Claraco, University of Malaga @ 2006\n");
1371 os::fprintf(f,
"%%-------------------------------------------------------\n\n");
1378 os::fprintf(f,
"m=[%.4f %.4f %.4f];",it->pose_mean.x, it->pose_mean.y, it->pose_mean.z );
1379 os::fprintf(f,
"c=[%.8f %.8f %.8f;%.8f %.8f %.8f;%.8f %.8f %.8f]; ",
1380 it->pose_cov_11,it->pose_cov_12,it->pose_cov_13,
1381 it->pose_cov_12,it->pose_cov_22,it->pose_cov_23,
1382 it->pose_cov_13,it->pose_cov_23,it->pose_cov_33 );
1384 os::fprintf(f,
"error_ellipse(c,m,'conf',%f,'style','%s','numPointsEllipse',10);\n",confInterval,style);
1387 os::fprintf(f,
"axis equal;grid on;xlabel('x'); ylabel('y'); zlabel('z');");
1403 if (!f)
return false;
1405 const int ELLIPSE_POINTS = 30;
1406 std::vector<float> X,Y,COS,SIN;
1411 X.resize(ELLIPSE_POINTS);
1412 Y.resize(ELLIPSE_POINTS);
1413 COS.resize(ELLIPSE_POINTS);
1414 SIN.resize(ELLIPSE_POINTS);
1418 for (Cos=COS.begin(),Sin=SIN.begin(),ang=0;Cos!=COS.end();Cos++,Sin++, ang+= (
M_2PI/(ELLIPSE_POINTS-1)) )
1425 os::fprintf(f,
"%%-------------------------------------------------------\n");
1426 os::fprintf(f,
"%% File automatically generated using the MRPT method:\n");
1427 os::fprintf(f,
"%% 'CLandmarksMap::saveToMATLABScript2D'\n");
1430 os::fprintf(f,
"%% Jose Luis Blanco Claraco, University of Malaga @ 2006\n");
1432 os::fprintf(f,
"%%-------------------------------------------------------\n\n");
1440 cov(0,0) = it->pose_cov_11;
1441 cov(1,1) = it->pose_cov_22;
1442 cov(0,1) =
cov(1,0) = it->pose_cov_12;
1444 cov.eigenVectors(eigVec,eigVal);
1445 eigVal = eigVal.array().sqrt().matrix();
1446 M = eigVal * eigVec.transpose();
1450 for (
x=X.begin(),
y=Y.begin(), Cos=COS.begin(),Sin=SIN.begin();
x!=X.end();
x++,
y++,Cos++,Sin++)
1452 *
x = ( it->pose_mean.x + stdCount * (*Cos * M(0,0) + *Sin * M(1,0)) );
1453 *
y = ( it->pose_mean.y + stdCount * (*Cos * M(0,1) + *Sin * M(1,1)) );
1459 for (
x=X.begin();
x!=X.end();
x++)
1465 for (
y=Y.begin();
y!=Y.end();
y++)
1487 unsigned int downSampleFactor )
1491 double J11,J12,J21,J22;
1501 else sensorGlobalPose = *robotPose + obs.
sensorPose;
1516 double var_d =
square( 0.005 );
1517 double var_th =
square( dTh / 10.0 );
1520 for (i=0;i<
n;i+= downSampleFactor,Th += downSampleFactor*dTh )
1539 newLandmark.
features[0]->orientation = Th;
1540 newLandmark.
features[0]->scale = d;
1552 J11 = - d * sin(Th); J12 = cos(Th);
1553 J21 = d * cos(Th); J22 = sin(Th);
1556 newLandmark.
pose_cov_11 = ( J11*J11*var_th + J12*J12*var_d );
1557 newLandmark.
pose_cov_12 = ( J11*J21*var_th + J12*J22*var_d );
1558 newLandmark.
pose_cov_22 = ( J21*J21*var_th + J22*J22*var_d );
1598 double nFoundCorrs = 0;
1600 unsigned int cx,cy,cx_1,cx_2,cy_1,cy_2;
1608 for (itOther =
s->landmarks.begin(); itOther!=
s->landmarks.end(); itOther++ )
1610 itOther->getPose( poseOther );
1613 cy = grid->
y2idx( itOther->pose_mean.y );
1615 cx_1 = max(0, grid->
x2idx( itOther->pose_mean.x - 0.10f ) );
1616 cx_2 =
min(static_cast<int>(grid->
getSizeX())-1, grid->
x2idx( itOther->pose_mean.x + 0.10f ));
1617 cy_1 = max(0, grid->
y2idx( itOther->pose_mean.y - 0.10f ) );
1618 cy_2 =
min( static_cast<int>(grid->
getSizeY())-1, grid->
y2idx( itOther->pose_mean.y + 0.10f ) );
1628 for (cx=cx_1;cx<=cx_2;cx++)
1629 for (cy=cy_1;cy<=cy_2;cy++)
1633 if (!corrs->empty())
1642 if ( fabs( lm->
pose_mean.
x - itOther->pose_mean.x ) > 0.15f ||
1643 fabs( lm->
pose_mean.
y - itOther->pose_mean.y ) > 0.15f )
1656 PrNoCorr *= 1 - corr;
1662 nFoundCorrs += 1 - PrNoCorr;
1686 lik *= 1 - PrNoCorr;
1690 lik = nFoundCorrs /
static_cast<double>(
s->size() );
1707 m_grid( -10.0f,10.0f,-10.0f,10.f,0.20f ),
1708 m_largestDistanceFromOrigin(),
1709 m_largestDistanceFromOriginIsUpdated(false)
1715 m_landmarks.clear();
1720 m_largestDistanceFromOriginIsUpdated =
false;
1734 m_landmarks.push_back( l );
1739 cell->push_back( m_landmarks.size()-1 );
1741 m_largestDistanceFromOriginIsUpdated =
false;
1746 return &m_landmarks[indx];
1751 return &m_landmarks[indx];
1756 vector_int *cell = m_grid.cellByPos(m_landmarks[indx].pose_mean.x,m_landmarks[indx].pose_mean.y);
1759 for (it=cell->begin();it!=cell->end();it++)
1761 if (*it==static_cast<int>(indx))
1768 m_largestDistanceFromOriginIsUpdated =
false;
1773 m_landmarks.erase( m_landmarks.begin() + indx );
1774 m_largestDistanceFromOriginIsUpdated =
false;
1782 m_grid.resize(
min( m_grid.getXMin(),m_landmarks[indx].pose_mean.x ),
1783 max( m_grid.getXMax(),m_landmarks[indx].pose_mean.x ),
1784 min( m_grid.getYMin(),m_landmarks[indx].pose_mean.y ),
1785 max( m_grid.getYMax(),m_landmarks[indx].pose_mean.y ),
1789 vector_int *cell = m_grid.cellByPos(m_landmarks[indx].pose_mean.x,m_landmarks[indx].pose_mean.y);
1790 cell->push_back( indx );
1791 m_largestDistanceFromOriginIsUpdated =
false;
1800 double min_x=-10.0, max_x=10.0;
1801 double min_y=-10.0, max_y=10.0;
1808 for (idx=0,it=m_landmarks.begin();it!=m_landmarks.end();idx++,it++)
1810 min_x =
min(min_x, it->pose_mean.x);
1811 max_x = max(max_x, it->pose_mean.x);
1812 min_y =
min(min_y, it->pose_mean.y);
1813 max_y = max(max_y, it->pose_mean.y);
1815 m_grid.resize(min_x,max_x,min_y,max_y,dummyEmpty );
1818 for (idx=0,it=m_landmarks.begin();it!=m_landmarks.end();idx++,it++)
1820 vector_int *cell = m_grid.cellByPos( it->pose_mean.x,it->pose_mean.y);
1821 cell->push_back( idx );
1824 m_largestDistanceFromOriginIsUpdated =
false;
1834 if (!m_largestDistanceFromOriginIsUpdated)
1837 float maxDistSq = 0, d;
1841 maxDistSq = max( d, maxDistSq );
1845 m_largestDistanceFromOrigin = sqrt( maxDistSq );
1846 m_largestDistanceFromOriginIsUpdated =
true;
1848 return m_largestDistanceFromOrigin;
1857 std::vector<bool> *otherCorrespondences )
1864 unsigned long distDesc;
1865 double likByDist,likByDesc;
1883 unsigned int idx1,idx2;
1885 CMatrixD dij(1,3), Cij(3,3), Cij_1;
1886 double distMahaFlik2;
1902 lm1->getPose( lm1_pose );
1911 lm2->getPose( lm2_pose );
1915 dij(0,0) = lm1->pose_mean.x - lm2->pose_mean.x;
1916 dij(0,1) = lm1->pose_mean.y - lm2->pose_mean.y;
1917 dij(0,2) = lm1->pose_mean.z - lm2->pose_mean.z;
1924 distMahaFlik2 = dij.multiply_HCHt_scalar(Cij_1);
1926 likByDist = exp( K_dist * distMahaFlik2 );
1929 if ( likByDist > 1e-2 )
1936 std::pair<mrpt::maps::CLandmark::TLandmarkID, mrpt::maps::CLandmark::TLandmarkID> mPair( lm2->ID, lm1->ID );
1942 ASSERT_( !lm1->features.empty() && !lm2->features.empty() )
1943 ASSERT_( lm1->features[0].present() && lm2->features[0].present() )
1944 ASSERT_( lm1->features[0]->descriptors.SIFT.size() == lm2->features[0]->descriptors.SIFT.size() )
1946 for ( it1 = lm1->features[0]->descriptors.SIFT.begin(), it2 = lm2->features[0]->descriptors.SIFT.begin(); it1!=lm1->features[0]->descriptors.SIFT.end(); it1++, it2++)
1947 distDesc +=
square( *it1 - *it2 );
1960 likByDesc = exp( K_desc * distDesc );
1972 lik_i += likByDist*likByDesc;
1984 lik *= (0.1 + 0.9*lik_i);
2007 if ( correspondences == NULL )
2008 THROW_EXCEPTION(
"When using this method with SIFTLikelihoodMethod = 1, TMatchingPairList *correspondence can not be NULL" );
2010 if ( otherCorrespondences == NULL )
2011 THROW_EXCEPTION(
"When using this method with SIFTLikelihoodMethod = 1, std::vector<bool> *otherCorrespondences can not be NULL" );
2013 for ( itCorr = correspondences->begin(); itCorr != correspondences->end(); itCorr++ )
2026 distMahaFlik2 = dij.multiply_HCHt_scalar(Cij_1);
2030 lik *= exp( -0.5 * dist );
2035 for ( k = 1; k <= ( theMap->
size() - correspondences->size() ); k++ )
2059 insert_SIFTs_from_monocular_images ( true ),
2060 insert_SIFTs_from_stereo_images ( true ),
2061 insert_Landmarks_from_range_scans ( true ),
2062 SiftCorrRatioThreshold ( 0.4f ),
2063 SiftLikelihoodThreshold ( 0.5f ),
2065 SiftEDDThreshold ( 200.0f ),
2066 SIFTMatching3DMethod ( 0 ),
2067 SIFTLikelihoodMethod ( 0 ),
2069 SIFTsLoadDistanceOfTheMean ( 3.0f ),
2070 SIFTsLoadEllipsoidWidth ( 0.05f ),
2072 SIFTs_stdXY ( 2.0f ),
2073 SIFTs_stdDisparity ( 1.0f ),
2075 SIFTs_numberOfKLTKeypoints ( 60 ),
2076 SIFTs_stereo_maxDepth ( 15.0f ),
2078 SIFTs_epipolar_TH ( 1.5f ),
2079 PLOT_IMAGES ( false ),
2081 SIFT_feat_options ( vision::
featSIFT )
2090 out.
printf(
"\n----------- [CLandmarksMap::TInsertionOptions] ------------ \n\n");
2092 out.
printf(
"insert_SIFTs_from_monocular_images = %c\n", insert_SIFTs_from_monocular_images ?
'Y':
'N');
2093 out.
printf(
"insert_SIFTs_from_stereo_images = %c\n", insert_SIFTs_from_stereo_images ?
'Y':
'N');
2094 out.
printf(
"insert_Landmarks_from_range_scans = %c\n", insert_Landmarks_from_range_scans ?
'Y':
'N');
2096 out.
printf(
"SiftCorrRatioThreshold = %f\n", SiftCorrRatioThreshold);
2097 out.
printf(
"SiftLikelihoodThreshold = %f\n", SiftLikelihoodThreshold);
2098 out.
printf(
"SiftEDDThreshold = %f\n", SiftEDDThreshold);
2099 out.
printf(
"SIFTMatching3DMethod = %d\n", SIFTMatching3DMethod);
2100 out.
printf(
"SIFTLikelihoodMethod = %d\n", SIFTLikelihoodMethod);
2102 out.
printf(
"SIFTsLoadDistanceOfTheMean = %f\n", SIFTsLoadDistanceOfTheMean);
2103 out.
printf(
"SIFTsLoadEllipsoidWidth = %f\n", SIFTsLoadEllipsoidWidth);
2105 out.
printf(
"SIFTs_stdXY = %f\n", SIFTs_stdXY);
2106 out.
printf(
"SIFTs_stdDisparity = %f\n", SIFTs_stdDisparity);
2108 out.
printf(
"SIFTs_numberOfKLTKeypoints = %i\n", SIFTs_numberOfKLTKeypoints);
2109 out.
printf(
"SIFTs_stereo_maxDepth = %f\n", SIFTs_stereo_maxDepth);
2110 out.
printf(
"SIFTs_epipolar_TH = %f\n", SIFTs_epipolar_TH);
2111 out.
printf(
"PLOT_IMAGES = %c\n", PLOT_IMAGES ?
'Y':
'N');
2113 SIFT_feat_options.dumpToTextStream(out);
2126 insert_SIFTs_from_monocular_images = iniFile.
read_bool(section.c_str(),
"insert_SIFTs_from_monocular_images",insert_SIFTs_from_monocular_images);
2127 insert_SIFTs_from_stereo_images = iniFile.
read_bool(section.c_str(),
"insert_SIFTs_from_stereo_images",insert_SIFTs_from_stereo_images);
2128 insert_Landmarks_from_range_scans = iniFile.
read_bool(section.c_str(),
"insert_Landmarks_from_range_scans",insert_Landmarks_from_range_scans);
2129 SiftCorrRatioThreshold = iniFile.
read_float(section.c_str(),
"SiftCorrRatioThreshold",SiftCorrRatioThreshold);
2130 SiftLikelihoodThreshold = iniFile.
read_float(section.c_str(),
"SiftLikelihoodThreshold",SiftLikelihoodThreshold);
2131 SiftEDDThreshold = iniFile.
read_float(section.c_str(),
"SiftEDDThreshold",SiftEDDThreshold);
2132 SIFTMatching3DMethod = iniFile.
read_int(section.c_str(),
"SIFTMatching3DMethod",SIFTMatching3DMethod);
2133 SIFTLikelihoodMethod = iniFile.
read_int(section.c_str(),
"SIFTLikelihoodMethod",SIFTLikelihoodMethod);
2134 SIFTsLoadDistanceOfTheMean = iniFile.
read_float(section.c_str(),
"SIFTsLoadDistanceOfTheMean",SIFTsLoadDistanceOfTheMean);
2135 SIFTsLoadEllipsoidWidth = iniFile.
read_float(section.c_str(),
"SIFTsLoadEllipsoidWidth",SIFTsLoadEllipsoidWidth);
2136 SIFTs_stdXY = iniFile.
read_float(section.c_str(),
"SIFTs_stdXY",SIFTs_stdXY);
2137 SIFTs_stdDisparity = iniFile.
read_float(section.c_str(),
"SIFTs_stdDisparity",SIFTs_stdDisparity);
2138 SIFTs_numberOfKLTKeypoints = iniFile.
read_int(section.c_str(),
"SIFTs_numberOfKLTKeypoints",SIFTs_numberOfKLTKeypoints);
2139 SIFTs_stereo_maxDepth = iniFile.
read_float(section.c_str(),
"SIFTs_stereo_maxDepth",SIFTs_stereo_maxDepth);
2140 SIFTs_epipolar_TH = iniFile.
read_float(section.c_str(),
"SIFTs_epipolar_TH",SIFTs_epipolar_TH);
2141 PLOT_IMAGES = iniFile.
read_bool(section.c_str(),
"PLOT_IMAGES",PLOT_IMAGES);
2143 SIFT_feat_options.loadFromConfigFile(iniFile,section);
2150 rangeScan2D_decimation ( 20 ),
2151 SIFTs_sigma_euclidean_dist ( 0.30f ),
2152 SIFTs_sigma_descriptor_dist ( 100.0f ),
2153 SIFTs_mahaDist_std ( 4.0f ),
2154 SIFTnullCorrespondenceDistance ( 4.0f ),
2155 SIFTs_decimation ( 1 ),
2156 SIFT_feat_options ( vision::
featSIFT ),
2157 beaconRangesStd ( 0.08f ),
2158 beaconRangesUseObservationStd (false),
2159 extRobotPoseStd ( 0.05f ),
2166 longitude ( -4.47763833333333 ),
2167 latitude ( 36.71559000000000 ),
2181 out.
printf(
"\n----------- [CLandmarksMap::TLikelihoodOptions] ------------ \n\n");
2245 ellapsedTime ( 4.0f )
2262 const CPoint3D &in_sensorLocationOnRobot,
2271 point3D = in_robotPose + in_sensorLocationOnRobot;
2284 it->getPose( beaconPDF );
2285 beacon3D = beaconPDF.
mean;
2301 out_Observations.
sensedData.push_back( newMeas );
2351 it->getPose( pointGauss );
2353 ellip->setPose(pointGauss.
mean);
2354 ellip->setCovMatrix(pointGauss.
cov);
2355 ellip->enableDrawSolid3D(
false);
2356 ellip->setQuantiles(3.0);
2357 ellip->set3DsegmentsCount(10);
2358 ellip->setColor(0,0,1);
2359 ellip->setName(
mrpt::format(
"LM.ID=%u",static_cast<unsigned int>(it->ID) ));
2360 ellip->enableShowName(
true);
2362 outObj->insert( ellip );
2375 for(
size_t indx = 0; indx < m_landmarks.size(); indx++)
2377 if( m_landmarks[indx].ID == ID )
2378 return &m_landmarks[indx];
2395 for(
size_t indx = 0; indx < m_landmarks.size(); indx++)
2397 if( m_landmarks[indx].ID == ID )
2398 return &m_landmarks[indx];
2422 otherMap = static_cast<const CLandmarksMap*>( otherMap2 );
2424 if (!otherMap)
return 0;
2427 std::deque<CPointPDFGaussianPtr> poses3DThis,poses3DOther;
2431 size_t nOther = otherMap->landmarks.size();
2432 size_t otherLandmarkWithCorrespondence = 0;
2435 if (!nThis)
return 0;
2436 if (!nOther)
return 0;
2441 float Tx = pose3DMatrix.get_unsafe(0,3);
2442 float Ty = pose3DMatrix.get_unsafe(1,3);
2443 float Tz = pose3DMatrix.get_unsafe(2,3);
2453 poses3DOther.resize( nOther );
2454 for (
size_t i=0;i<nOther;i++) poses3DOther[i] = CPointPDFGaussian::Create();
2456 poses3DThis.resize( nThis );
2457 for (
size_t i=0;i<nThis;i++) poses3DThis[i] = CPointPDFGaussian::Create();
2460 for (itOther=otherMap->landmarks.begin(),itPoseOther=poses3DOther.begin();itOther!=otherMap->landmarks.end();itOther++,itPoseOther++)
2462 itOther->getPose( **itPoseOther );
2463 (*itPoseOther)->changeCoordinatesReference(otherMapPose);
2469 itThis->getPose( **itPoseThis );
2473 for (itOther=otherMap->landmarks.begin(),itPoseOther=poses3DOther.begin();itOther!=otherMap->landmarks.end();itOther++,itPoseOther++)
2478 TPoint3D D( (*itPoseThis)->mean.x() - (*itPoseOther)->mean.x(), (*itPoseThis)->mean.y() - (*itPoseOther)->mean.y(), (*itPoseThis)->mean.z() - (*itPoseOther)->mean.z() );
2484 float distMaha = sqrt( d.multiply_HCHt_scalar(COV.inv()) );
2486 if (distMaha<
params.maxMahaDistForCorr )
2489 if ( !itThis->features.empty() && !itOther->features.empty() &&
2490 itThis->features[0]->descriptors.SIFT.size() == itOther->features[0]->descriptors.SIFT.size() )
2492 unsigned long descrDist = 0;
2494 for (it1=itThis->features[0]->descriptors.SIFT.begin(), it2=itOther->features[0]->descriptors.SIFT.begin();it1!=itThis->features[0]->descriptors.SIFT.end(); it1++,it2++)
2495 descrDist+=
square( *it1 - *it2 );
2497 float descrDist_f = sqrt(static_cast<float>(descrDist)) / itThis->features[0]->descriptors.SIFT.size();
2499 if ( descrDist_f < 1.5f )
2501 otherLandmarkWithCorrespondence++;
2511 return static_cast<float>(otherLandmarkWithCorrespondence) / nOther;
2539 const CPose3D &in_sensorLocationOnRobot,
2541 bool sensorDetectsIDs,
2542 const float in_stdRange,
2543 const float in_stdYaw,
2544 const float in_stdPitch,
2546 const double spurious_count_mean,
2547 const double spurious_count_std
2556 if (out_real_associations) out_real_associations->clear();
2559 const CPose3D point3D = in_robotPose +
CPose3D(in_sensorLocationOnRobot);
2576 it->getPose( beaconPDF );
2598 if (sensorDetectsIDs)
2606 out_Observations.
sensedData.push_back( newMeas );
2608 if (out_real_associations) out_real_associations->push_back(idx);
2613 size_t nSpurious = 0;
2614 if (spurious_count_std!=0 || spurious_count_mean!=0)
2619 for (
size_t i=0;i<nSpurious;i++)
2634 out_Observations.
sensedData.push_back( newMeas );
2636 if (out_real_associations) out_real_associations->push_back( std::string::npos );
void clear()
Erase all the contents of the map.
A namespace of pseudo-random numbers genrators of diferent distributions.
void VISION_IMPEXP projectMatchedFeatures(const CMatchedFeatureList &matches, const mrpt::utils::TStereoCamera &stereo_camera, std::vector< mrpt::math::TPoint3D > &out_points)
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
float fieldOfView_yaw
Information about the sensor: Ranges, in meters (0: there is no limits)
double drawUniform(const double Min, const double Max)
Generate a uniformly distributed pseudo-random number using the MT19937 algorithm, scaled to the selected range.
A pair (x,y) of pixel coordinates (subpixel resolution).
float EDD_RATIO
Boundary Ratio between the two lowest EDD.
double x() const
Common members of all points & poses classes.
Virtual base for specifying the kind and parameters of one map (normally, to be inserted into mrpt::m...
TFuseOptions()
Initialization.
mrpt::utils::CDynamicGrid< vector_int > * getGrid()
Parameters for CMetricMap::compute3DMatchingRatio()
void computeMatchingWith2D(const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose2D &otherMapPose, float maxDistForCorrespondence, float maxAngularDistForCorrespondence, const mrpt::poses::CPose2D &angularDistPivotPoint, mrpt::utils::TMatchingPairList &correspondences, float &correspondencesRatio, float *sumSqrDist=NULL, bool onlyKeepTheClosest=false, bool onlyUniqueRobust=false) const
float SiftEDDThreshold
[For SIFT landmarks only] The minimum Euclidean Descriptor Distance value of a match to set as corres...
FILE BASE_IMPEXP * fopen(const char *fileName, const char *mode) MRPT_NO_THROWS
An OS-independent version of fopen.
Non-defined feature (also used for Occupancy features)
Declares a class derived from "CObservation" that encapsules an image from a camera, whose relative pose to robot is also stored.
static CEllipsoidPtr Create()
size_t size() const
Returns the stored landmarks count.
mrpt::maps::CLandmarksMap::TInsertionOptions insertionOpts
bool read_bool(const std::string §ion, const std::string &name, bool defaultValue, bool failIfNotFound=false) const
void computeMatchingWith3DLandmarks(const mrpt::maps::CLandmarksMap *otherMap, mrpt::utils::TMatchingPairList &correspondences, float &correspondencesRatio, std::vector< bool > &otherCorrespondences) const
Perform a search for correspondences between "this" and another lansmarks map: In this class...
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
CPose3D mean
The mean value.
bool insert_SIFTs_from_stereo_images
If set to true (default), the insertion of a CObservationStereoImages in the map will insert SIFT 3D ...
This class is a "CSerializable" wrapper for "CMatrixTemplateNumeric<double>".
void createOneFeature()
Creates one feature in the vector "features", calling the appropriate constructor of the smart pointe...
bool BASE_IMPEXP isNaN(float v) MRPT_NO_THROWS
mrpt::utils::CImage imageLeft
Image from the left camera (this image will be ALWAYS present)
void getAs3DObject(mrpt::opengl::CSetOfObjectsPtr &outObj) const MRPT_OVERRIDE
Returns a 3D object representing the map.
float range
The sensed landmark distance, in meters.
double latitude_degrees
The measured latitude, in degrees (North:+ , South:-)
double distanceTo(const CPoseOrPoint< OTHERCLASS > &b) const
Returns the Euclidean distance to another pose/point:
This namespace provides a OS-independent interface to many useful functions: filenames manipulation...
unsigned int SIFTLikelihoodMethod
[For SIFT landmarks only] Method to compute the likelihood (Default = 0 (Our method)) 0: Our method -...
static bool _maxIDUpdated
float read_float(const std::string §ion, const std::string &name, float defaultValue, bool failIfNotFound=false) const
bool enableSaveAs3DObject
(Default=true) If false, calling CMetricMap::getAs3DObject() will have no effects ...
float beaconRangesStd
The standard deviation used for Beacon ranges likelihood (default=0.08) [meters]. ...
const CLandmark * getByID(CLandmark::TLandmarkID ID) const
Returns the landmark with a given landmrk ID, or NULL if not found.
int BASE_IMPEXP void BASE_IMPEXP fclose(FILE *f)
An OS-independent version of fclose.
mrpt::utils::TCamera cameraParams
Intrinsic and distortion parameters of the camera.
A class for storing images as grayscale or RGB bitmaps.
mrpt::system::TTimeStamp BASE_IMPEXP getCurrentTime()
Returns the current (UTC) system time.
CPoint3D mean
The mean value.
float SIFTs_stereo_maxDepth
Maximum depth of 3D landmarks when loading a landmarks map from a stereo image observation.
#define MRPT_CHECK_NORMAL_NUMBER(val)
void fuseWith(CLandmarksMap &other, bool justInsertAllOfThem=false)
Fuses the contents of another map with this one, updating "this" object with the result.
#define THROW_EXCEPTION(msg)
GLdouble GLdouble GLdouble GLdouble q
int x2idx(double x) const
Transform a coordinate values into cell indexes.
BASE_IMPEXP CRandomGenerator randomGenerator
A static instance of a CRandomGenerator class, for use in single-thread applications.
Declares a class derived from "CObservation" that stores a Landmarks Map as seen from a stereo camera...
uint32_t satellitesUsed
The number of satelites used to compute this estimation.
double norm() const
Point norm.
std::pair< mrpt::math::TPoint3D, unsigned int > TPairIdBeacon
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.
EIGEN_STRONG_INLINE iterator begin()
double computeLikelihood_SIFT_LandmarkMap(CLandmarksMap *map, mrpt::utils::TMatchingPairList *correspondences=NULL, std::vector< bool > *otherCorrespondences=NULL)
Returns the (logarithmic) likelihood of a set of landmarks "map" given "this" map.
long round_long(const T value)
Returns the closer integer (long) to x.
float extRobotPoseStd
The standard deviation used for external robot poses likelihood (default=0.05) [meters].
double BASE_IMPEXP extractDayTimeFromTimestamp(const mrpt::system::TTimeStamp t)
Returns the number of seconds ellapsed from midnight in the given timestamp.
An observation providing an alternative robot pose from an external source.
double pitch() const
Get the PITCH angle (in radians)
double yaw() const
Get the YAW angle (in radians)
Declares a class derived from "CObservation" that represents one (or more) range measurements to labe...
size_t getSizeY() const
Returns the vertical size of grid map in cells count.
int BASE_IMPEXP fprintf(FILE *fil, const char *format,...) MRPT_NO_THROWS MRPT_printf_format_check(2
An OS-independent version of fprintf.
int32_t beaconID
The ID of the sensed beacon (or INVALID_BEACON_ID if unknown)
TMapGenericParams genericMapParams
Common params to all maps.
internal::TSequenceLandmarks::iterator iterator
float epipolar_TH
Epipolar constraint (rows of pixels)
const Scalar * const_iterator
float minZ
Maximum allowed distance.
double z
X,Y,Z coordinates.
IMPLEMENTS_SERIALIZABLE(CLogFileRecord_FullEval, CHolonomicLogFileRecord, mrpt::nav) IMPLEMENTS_SERIALIZABLE(CHolonomicFullEval
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string §ion) MRPT_OVERRIDE
This method load the options from a ".ini"-like file or memory-stored string list.
int64_t TLandmarkID
The type for the IDs of landmarks.
GLsizei GLsizei GLuint * obj
void simulateBeaconReadings(const mrpt::poses::CPose3D &in_robotPose, const mrpt::poses::CPoint3D &in_sensorLocationOnRobot, mrpt::obs::CObservationBeaconRanges &out_Observations) const
Simulates a noisy reading toward each of the beacons in the landmarks map, if any.
double drawGaussian1D_normalized(double *likelihood=NULL)
Generate a normalized (mean=0, std=1) normally distributed sample.
mrpt::poses::CPose3D sensorPose
The pose of the sensor on the robot/vehicle.
const CLandmark * getByBeaconID(unsigned int ID) const
Returns the landmark with a given beacon ID, or NULL if not found.
double drawGaussian1D(const double mean, const double std)
Generate a normally distributed pseudo-random number.
This class allows loading and storing values and vectors of different types from a configuration text...
T square(const T x)
Inline function for the square of a number.
int y2idx(double y) const
bool beaconRangesUseObservationStd
(Default: false) If true, beaconRangesStd is ignored and each individual CObservationBeaconRanges::st...
static mrpt::maps::CLandmark::TLandmarkID _mapMaxID
float stdPixel
Standard deviation of the error in feature detection.
std::vector< mrpt::vision::CFeaturePtr > features
The set of features from which the landmark comes.
float yaw
The sensed landmark direction, in radians, measured as the yaw (azimuth) and pitch (negative elevatio...
bool insert_SIFTs_from_monocular_images
If set to true (default), the insertion of a CObservationImage in the map will insert SIFT 3D feature...
mrpt::math::TPoint3D VISION_IMPEXP pixelTo3D(const mrpt::utils::TPixelCoordf &xy, const mrpt::math::CMatrixDouble33 &A)
Extract a UNITARY 3D vector in the direction of a 3D point, given from its (x,y) pixels coordinates...
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.
int read_int(const std::string §ion, const std::string &name, int defaultValue, bool failIfNotFound=false) const
mrpt::poses::CPose3DQuat cameraPose
The pose of the LEFT camera, relative to the robot.
int32_t landmarkID
The ID of the sensed beacon, or INVALID_LANDMARK_ID (-1) if the sensor does not identify the landmark...
void bayesianFusion(const CPointPDFGaussian &p1, const CPointPDFGaussian &p2)
Bayesian fusion of two points gauss.
mrpt::maps::CLandmark::TLandmarkID getMapMaxID()
double altitude_meters
The measured altitude, in meters (A).
float SIFTsLoadDistanceOfTheMean
[For SIFT landmarks only] The distance (in meters) of the mean value of landmarks, for the initial position PDF (Default = 3m)
Matching by Euclidean distance between SIFT descriptors.
void composePoint(double lx, double ly, double lz, double &gx, double &gy, double &gz, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacobian_df_dpoint=NULL, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dpose=NULL, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dse3=NULL, bool use_small_rot_approx=false) const
An alternative, slightly more efficient way of doing with G and L being 3D points and P this 6D pose...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
int SIFTs_numberOfKLTKeypoints
Number of points to extract in the image.
This base provides a set of functions for maths stuff.
void setPose(const mrpt::poses::CPointPDFGaussian &p)
Sets the pose from an object:
virtual const mrpt::utils::TRuntimeClassId * GetRuntimeClass() const
Returns information about the class of an object in runtime.
void insert(const CRenderizablePtr &newObject, const std::string &viewportName=std::string("main"))
Insert a new object into the scene, in the given viewport (by default, into the "main" viewport)...
int SIFTs_decimation
Considers 1 out of "SIFTs_decimation" visual landmarks in the observation during the likelihood compu...
A class for storing a map of 3D probabilistic landmarks.
float getLargestDistanceFromOrigin() const
This method returns the largest distance from the origin to any of the points, such as a sphere cente...
void erase(unsigned int indx)
virtual void auxParticleFilterCleanUp() MRPT_OVERRIDE
This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::...
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
Eigen::Matrix< typename MATRIX::Scalar, MATRIX::ColsAtCompileTime, MATRIX::ColsAtCompileTime > cov(const MATRIX &v)
Computes the covariance matrix from a list of samples in an NxM matrix, where each row is a sample...
double norm() const
Returns the euclidean norm of vector: .
This CStream derived class allow using a file as a write-only, binary stream.
Parameters associated to a stereo system.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
mrpt::math::CMatrixDouble33 cov
The 3x3 covariance matrix.
void push_back(const CLandmark &lm)
The object is copied, thus the original copy passed as a parameter can be released.
CMatrixTemplateNumeric< double > CMatrixDouble
Declares a matrix of double numbers (non serializable).
float SIFTs_stdXY
[For SIFT landmarks only] The standard deviation (in pixels) for the SIFTs detector (This is used for...
Scale Invariant Feature Transform [LOWE'04].
size_t getSizeX() const
Returns the horizontal size of grid map in cells count.
std::deque< TMeasurement > sensedData
The list of observed ranges.
void sphericalCoordinates(const mrpt::math::TPoint3D &point, double &out_range, double &out_yaw, double &out_pitch) const
Computes the spherical coordinates of a 3D point as seen from the 6D pose specified by this object...
double longitude_degrees
The measured longitude, in degrees (East:+ , West:-)
Observation class for either a pair of left+right or left+disparity images from a stereo camera...
float fieldOfView_pitch
Information about the sensor: The "field-of-view" of the sensor, in radians (for pitch )...
virtual ~CLandmarksMap()
Virtual destructor.
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.
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
CMatrixFixedNumeric< double, 3, 3 > CMatrixDouble33
Classes for computer vision, detectors, features, etc.
void getPose(mrpt::poses::CPointPDFGaussian &p) const
Returns the pose as an object:
float SIFTnullCorrespondenceDistance
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const
Introduces a pure virtual method responsible for writing to a CStream.
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
bool isEmpty() const MRPT_OVERRIDE
Returns true if the map is empty/no observation has been inserted.
mrpt::maps::CLandmarksMap CLandmarksMap
Backward compatible typedef.
GLsizei const GLchar ** string
T wrapToPi(T a)
Modifies the given angle to translate it into the ]-pi,pi] range.
T * cellByIndex(unsigned int cx, unsigned int cy)
Returns a pointer to the contents of a cell given by its cell indexes, or NULL if it is out of the ma...
MSG_CLASS & getMsgByClass()
Returns a reference to the message in the list CObservationGPS::messages of the requested class...
A class used to store a 3D point.
mrpt::utils::TCamera leftCamera
Parameters for the left/right cameras: individual intrinsic and distortion parameters of the cameras...
float compute3DMatchingRatio(const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, const TMatchingRatioParams ¶ms) const MRPT_OVERRIDE
Computes the ratio in [0,1] of correspondences between "this" and the "otherMap" map, whose 6D pose relative to "this" is "otherMapPose" In the case of a multi-metric map, this returns the average between the maps.
A list of visual features, to be used as output by detectors, as input/output by trackers, etc.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
double roll() const
Get the ROLL angle (in radians)
float stdError
The "sigma" of the sensor, assuming a zero-mean Gaussian noise model.
mrpt::utils::CImage imageRight
Image from the right camera, only contains a valid image if hasImageRight == true.
mrpt::system::TTimeStamp timestampLastSeen
The last time that this landmark was observed.
mrpt::poses::CPose3D sensorLocationOnRobot
The position of the sensor on the robot.
Each one of the measurements:
#define INVALID_TIMESTAMP
Represents an invalid timestamp, where applicable.
void changeCoordinatesReference(const mrpt::poses::CPose3D &newOrg)
Changes the reference system of the map to a given 3D pose.
mrpt::math::CMatrixDouble33 intrinsicParams
Matrix of intrinsic parameters (containing the focal length and principal point coordinates) ...
mrpt::vision::CFeatureExtraction::TOptions SIFT_feat_options
Parameters of the SIFT feature detector/descriptors while inserting images in the landmark map...
mrpt::maps::CLandmarksMap::TInsertionOptions insertionOptions
unsigned int minTimesSeen
Required number of times of a landmark to be seen not to be removed, in "ellapsedTime" seconds...
static std::map< std::pair< mrpt::maps::CLandmark::TLandmarkID, mrpt::maps::CLandmark::TLandmarkID >, double > _mEDD
Map of the Euclidean Distance between the descriptors of two SIFT-based landmarks.
bool saveToTextFile(std::string file)
Save to a text file.
void hasBeenModified(unsigned int indx)
float sensedDistance
The sensed range itself (in meters).
unsigned int rangeScan2D_decimation
The number of rays from a 2D range scan will be decimated by this factor (default = 1...
mrpt::math::CMatrixDouble66 cov
The 6x6 covariance matrix.
mrpt::maps::CLandmarksMap::TLikelihoodOptions likelihoodOpts
#define CLASS_ID(class_name)
Access to runtime class ID for a defined class name.
mrpt::poses::CPose3D refCameraPose
The 3D pose of the reference camera relative to robot coordinates.
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string §ion) MRPT_OVERRIDE
This method load the options from a ".ini"-like file or memory-stored string list.
void hasBeenModifiedAll()
static CGridPlaneXYPtr Create()
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
The class for storing "landmarks" (visual or laser-scan-extracted features,...)
#define MAP_DEFINITION_REGISTER(_CLASSNAME_STRINGS, _CLASSNAME_WITH_NS)
Registers one map class into TMetricMapInitializer factory.
mrpt::system::TTimeStamp timestamp
The associated UTC time-stamp. Where available, this should contain the accurate satellite-based time...
CMatrixTemplateNumeric< T > generateAxisBaseFromDirection(T dx, T dy, T dz)
Computes an axis base (a set of three 3D normal vectors) with the given vector being the first of the...
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
mrpt::poses::CPose3DPDFGaussian pose
The observed robot pose.
double productIntegralNormalizedWith2D(const CPointPDFGaussian &p) const
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the int...
float ellapsedTime
See "minTimesSeen".
internal_msg_test_proxy< gnss::NMEA_GGA > has_GGA_datum
Evaluates as a bool; true if the corresponding field exists in messages.
bool internal_insertObservation(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL) MRPT_OVERRIDE
Internal method called by insertObservation()
Declares a virtual base class for all metric maps storage classes.
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
bool PLOT_IMAGES
Indicates if the images (as well as the SIFT detected features) should be shown in a window...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Declares a class that represents any robot's observation.
mrpt::math::TPoint3D normal
The "normal" to the landmark, i.e. a unitary 3D vector towards the viewing direction, or a null vector if not applicable.
std::deque< TPairIdBeacon > initialBeacons
Initial contents of the map, especified by a set of 3D Beacons with associated IDs.
float SIFTsLoadEllipsoidWidth
[For SIFT landmarks only] The width (in meters, standard deviation) of the ellipsoid in the axis perp...
double internal_computeObservationLikelihood(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) MRPT_OVERRIDE
Computes the (logarithmic) likelihood that a given observation was taken from a given pose in the wor...
void loadSiftFeaturesFromStereoImageObservation(const mrpt::obs::CObservationStereoImages &obs, mrpt::maps::CLandmark::TLandmarkID fID, const mrpt::vision::CFeatureExtraction::TOptions &feat_options=mrpt::vision::CFeatureExtraction::TOptions(mrpt::vision::featSIFT))
Loads into this landmarks map the SIFT features extracted from an observation consisting of a pair of...
double read_double(const std::string §ion, const std::string &name, double defaultValue, bool failIfNotFound=false) const
float maxZ
Maximum allowed distance.
void readFromStream(mrpt::utils::CStream &in, int version)
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
mrpt::poses::CPose3DQuat rightCameraPose
The pose of the right camera, relative to the left one: Note that using the conventional reference co...
mrpt::vision::TFeatureType getType() const
Gets the type of the first feature in its feature vector.
size_t VISION_IMPEXP matchFeatures(const CFeatureList &list1, const CFeatureList &list2, CMatchedFeatureList &matches, const TMatchingOptions &options=TMatchingOptions(), const TStereoSystemParams ¶ms=TStereoSystemParams())
Find the matches between two lists of features which must be of the same type.
This observation represents a number of range-bearing value pairs, each one for a detected landmark...
void loadOccupancyFeaturesFrom2DRangeScan(const mrpt::obs::CObservation2DRangeScan &obs, const mrpt::poses::CPose3D *robotPose=NULL, unsigned int downSampleFactor=1)
Loads into this landmarks-map a set of occupancy features according to a 2D range scan (Previous cont...
A structure containing options for the matching.
TInsertionOptions()
Initilization of default parameters.
mrpt::maps::CLandmarksMap landmarks
The landmarks, with coordinates origin in the camera reference system.
void loadSiftFeaturesFromImageObservation(const mrpt::obs::CObservationImage &obs, const mrpt::vision::CFeatureExtraction::TOptions &feat_options=mrpt::vision::CFeatureExtraction::TOptions(mrpt::vision::featSIFT))
Loads into this landmarks map the SIFT features extracted from an image observation (Previous content...
content_t fields
Message content, accesible by individual fields.
This class allows the user to create, load, save, and render 3D scenes using OpenGL primitives...
GLsizei GLsizei GLchar * source
float aperture
The "aperture" or field-of-view of the range finder, in radians (typically M_PI = 180 degrees)...
mrpt::poses::CPoint3D sensorLocationOnRobot
Position of the sensor on the robot.
mrpt::utils::CImage image
The image captured by the camera, that is, the main piece of information of this observation.
#define INVALID_LANDMARK_ID
Used for CObservationBearingRange::TMeasurement::beaconID and others.
TInternalFeatList::iterator iterator
std::vector< size_t > vector_size_t
Each one of the measurements.
bool insert_Landmarks_from_range_scans
If set to true (default), inserting a CObservation2DRangeScan in the map will generate landmarks for ...
internal::TSequenceLandmarks::const_iterator const_iterator
double computeLikelihood_RSLC_2007(const CLandmarksMap *s, const mrpt::poses::CPose2D &sensorPose)
Computes the (logarithmic) likelihood function for a sensed observation "o" according to "this" map...
std::vector< int32_t > vector_int
CLandmark * get(unsigned int indx)
float maxEDD_TH
Maximum Euclidean Distance Between SIFT Descriptors.
bool saveToMATLABScript2D(std::string file, const char *style="b", float stdCount=2.0f)
Save to a MATLAB script which displays 2D error ellipses for the map (top-view, projection on the XY ...
float maxSensorDistance
Info about sensor.
A especial case: this is not an image feature, but a 2D/3D beacon (used for range-only SLAM from mrpt...
bool validCovariances
True: The individual 3x3 covariance matrices must be taken into account, false (default): All the mea...
TCustomSequenceLandmarks()
Default constructor.
bool saveToMATLABScript3D(std::string file, const char *style="b", float confInterval=0.95f) const
Save to a MATLAB script which displays 3D error ellipses for the map.
mrpt::utils::ContainerReadOnlyProxyAccessor< std::vector< float > > scan
The range values of the scan, in meters. Must have same length than validRange.
mrpt::math::TPoint3D pose_mean
The mean of the landmark 3D position.
float SIFTs_epipolar_TH
Maximum distance (in pixels) from a point to a certain epipolar line to be considered a potential mat...
TMatchingMethod matching_method
Matching method.
This class stores messages from GNSS or GNSS+IMU devices, from consumer-grade inexpensive GPS receive...
float SiftLikelihoodThreshold
[For SIFT landmarks only] The minimum likelihood value of a match to set as correspondence (Default=0...
unsigned __int32 uint32_t
mrpt::vision::CFeatureExtraction::TOptions SIFT_feat_options
Parameters of the SIFT feature detector/descriptors while inserting images in the landmark map...
float sensor_std_range
Taken into account only if validCovariances=false: the standard deviation of the sensor noise model f...
virtual const mrpt::utils::TRuntimeClassId * GetRuntimeClass() const
Returns information about the class of an object in runtime.
struct VISION_IMPEXP mrpt::maps::CLandmarksMap::TLikelihoodOptions::TGPSOrigin GPSOrigin
double ang
These 3 params allow rotating and shifting GPS coordinates with other 2D maps (e.g.
GLenum const GLfloat * params
void internal_clear() MRPT_OVERRIDE
Internal method called by clear()
struct VISION_IMPEXP mrpt::maps::CLandmarksMap::TFuseOptions fuseOptions
mrpt::poses::CPose3D sensorPose
The 6D pose of the sensor on the robot at the moment of starting the scan.
float SiftCorrRatioThreshold
[For SIFT landmarks only] The ratio between the best and second best descriptor distances to set as c...
void isToBeModified(unsigned int indx)
uint32_t seenTimesCount
The number of times that this landmark has been seen.
double SIFTs_sigma_euclidean_dist
A structure for holding correspondences between two sets of points or points-like entities in 2D or 3...
void getHomogeneousMatrix(mrpt::math::CMatrixDouble44 &out_HM) const
Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (t...
double BASE_IMPEXP distance(const TPoint2D &p1, const TPoint2D &p2)
Gets the distance between two points in a 2D space.
unsigned int min_sat
Minimum number of sats to take into account the data.
A gaussian distribution for 3D points.
virtual int printf(const char *fmt,...) MRPT_printf_format_check(2
Writes a string to the stream in a textual form.
float GPS_sigma
A constant "sigma" for GPS localization data (in meters)
struct VISION_IMPEXP mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks landmarks
void saveMetricMapRepresentationToFile(const std::string &filNamePrefix) const MRPT_OVERRIDE
This virtual method saves the map to a file "filNamePrefix"+< some_file_extension >...
double SIFTs_sigma_descriptor_dist
bool rightToLeft
The scanning direction: true=counterclockwise; false=clockwise.
float stdDisp
Standard deviation of the error in disparity computation.
TLandmarkID ID
An ID for the landmark (see details next...) This ID was introduced in the version 3 of this class (2...
TMeasurementList sensedData
The list of observed ranges:
std::vector< CLandmark > TSequenceLandmarks
mrpt::math::CMatrixDouble33 K
Intrinsic parameters.
static CSetOfObjectsPtr Create()
mrpt::maps::CLandmarksMap::TLikelihoodOptions likelihoodOptions
void simulateRangeBearingReadings(const mrpt::poses::CPose3D &robotPose, const mrpt::poses::CPose3D &sensorLocationOnRobot, mrpt::obs::CObservationBearingRange &observations, bool sensorDetectsIDs=true, const float stdRange=0.01f, const float stdYaw=mrpt::utils::DEG2RAD(0.1f), const float stdPitch=mrpt::utils::DEG2RAD(0.1f), vector_size_t *real_associations=NULL, const double spurious_count_mean=0, const double spurious_count_std=0) const
Simulates a noisy bearing-range observation of all the beacons (landamrks with type glBeacon) in the ...
unsigned int SIFTMatching3DMethod
[For SIFT landmarks only] Method to compute 3D matching (Default = 0 (Our method)) 0: Our method -> E...