18 #ifndef karto_sdk_MAPPER_H 19 #define karto_sdk_MAPPER_H 23 #include <unordered_map> 28 #include "tbb/parallel_for.h" 29 #include "tbb/blocked_range.h" 52 virtual void Info(
const std::string& ) {};
54 template<
class Archive>
55 void serialize(Archive &ar,
const unsigned int version)
69 virtual void Debug(
const std::string& ) {};
70 friend class boost::serialization::access;
71 template<
class Archive>
72 void serialize(Archive &ar,
const unsigned int version)
98 template<
class Archive>
99 void serialize(Archive &ar,
const unsigned int version)
127 friend class boost::serialization::access;
128 template<
class Archive>
155 Update(rPose1, rPose2, rCovariance);
185 m_Covariance = rotationMatrix * rCovariance * rotationMatrix.
Transpose();
212 return m_PoseDifference;
230 friend class boost::serialization::access;
231 template<
class Archive>
234 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(
EdgeLabel);
235 ar & BOOST_SERIALIZATION_NVP(m_Pose1);
236 ar & BOOST_SERIALIZATION_NVP(m_Pose2);
237 ar & BOOST_SERIALIZATION_NVP(m_PoseDifference);
238 ar & BOOST_SERIALIZATION_NVP(m_Covariance);
263 : m_pObject(
NULL), m_Score(1.0)
267 : m_pObject(pObject), m_Score(1.0)
282 inline const std::vector<Edge<T>*>&
GetEdges()
const 293 m_Edges.erase(m_Edges.begin() + idx);
338 std::vector<Vertex<T>*> vertices;
371 m_Edges.push_back(pEdge);
378 friend class boost::serialization::access;
379 template<
class Archive>
382 ar & BOOST_SERIALIZATION_NVP(m_pObject);
383 ar & BOOST_SERIALIZATION_NVP(m_Edges);
384 ar & BOOST_SERIALIZATION_NVP(m_Score);
415 m_pSource->AddEdge(
this);
416 m_pTarget->AddEdge(
this);
427 if (m_pLabel !=
NULL)
476 friend class boost::serialization::access;
477 template<
class Archive>
480 ar & BOOST_SERIALIZATION_NVP(m_pSource);
481 ar & BOOST_SERIALIZATION_NVP(m_pTarget);
482 ar & BOOST_SERIALIZATION_NVP(m_pLabel);
503 friend class boost::serialization::access;
504 template<
class Archive>
538 virtual std::vector<T*> TraverseForScans(
Vertex<T>* pStartVertex,
Visitor<T>* pVisitor) = 0;
539 virtual std::vector<Vertex<T>*> TraverseForVertices(
Vertex<T>* pStartVertex,
Visitor<T>* pVisitor) = 0;
544 friend class boost::serialization::access;
545 template<
class Archive>
548 ar & BOOST_SERIALIZATION_NVP(m_pGraph);
567 typedef std::map<Name, std::map<int, Vertex<T>*> >
VertexMap;
593 m_Vertices[rName].insert({pVertex->
GetObject()->GetStateId(), pVertex});
603 std::map<int, Vertex<LocalizedRangeScan>* >::iterator it = m_Vertices[rName].find(idx);
604 if (it != m_Vertices[rName].end())
607 m_Vertices[rName].erase(it);
611 std::cout <<
"RemoveVertex: Failed to remove vertex " << idx
612 <<
" because it doesnt exist in m_Vertices." << std::endl;
622 m_Edges.push_back(pEdge);
632 m_Edges.erase(m_Edges.begin() + idx);
641 forEachAs(
typename VertexMap, &m_Vertices, indexIter)
644 typename std::map<int, Vertex<T>*>::iterator iter;
645 for (iter = indexIter->second.begin(); iter != indexIter->second.end(); ++iter)
648 iter->second =
nullptr;
665 inline const std::vector<Edge<T>*>&
GetEdges()
const 692 friend class boost::serialization::access;
693 template<
class Archive>
696 std::cout <<
"Graph <- m_Edges; ";
697 ar & BOOST_SERIALIZATION_NVP(m_Edges);
698 std::cout <<
"Graph <- m_Vertices\n";
699 ar & BOOST_SERIALIZATION_NVP(m_Vertices);
794 std::vector<Vertex<LocalizedRangeScan>*> FindNearByVertices(
Name name,
const Pose2 refPose,
kt_double maxDistance);
808 return m_pLoopScanMatcher;
815 void UpdateLoopScanMatcher(
kt_double rangeThreshold);
826 std::map<int, Vertex<LocalizedRangeScan>* >::iterator it = m_Vertices[rName].find(pScan->
GetStateId());
827 if (it != m_Vertices[rName].end())
833 std::cout <<
"GetVertex: Failed to get vertex, idx " << pScan->
GetStateId() <<
834 " is not in m_Vertices." << std::endl;
891 Pose2 ComputeWeightedMean(
const Pose2Vector& rMeans,
const std::vector<Matrix3>& rCovariances)
const;
902 const Name& rSensorName,
924 friend class boost::serialization::access;
925 template<
class Archive>
928 std::cout <<
"MapperGraph <- Graph; ";
930 std::cout <<
"MapperGraph <- m_pMapper; ";
931 ar & BOOST_SERIALIZATION_NVP(m_pMapper);
932 std::cout <<
"MapperGraph <- m_pLoopScanMatcher; ";
933 ar & BOOST_SERIALIZATION_NVP(m_pLoopScanMatcher);
934 std::cout <<
"MapperGraph <- m_pTraversal\n";
935 ar & BOOST_SERIALIZATION_NVP(m_pTraversal);
973 virtual void Compute() = 0;
979 virtual const IdPoseVector& GetCorrections()
const = 0;
1026 virtual std::unordered_map<int, Eigen::Vector3d>*
getGraph()
1028 std::cout <<
"getGraph method not implemented for this solver type. Graph visualization unavailable." << std::endl;
1034 virtual void ModifyNode(
const int& unique_id, Eigen::Vector3d pose)
1036 std::cout <<
"ModifyNode method not implemented for this solver type. Manual loop closure unavailable." << std::endl;
1043 std::cout <<
"GetNodeOrientation method not implemented for this solver type." << std::endl;
1046 friend class boost::serialization::access;
1047 template<
class Archive>
1052 BOOST_SERIALIZATION_ASSUME_ABSTRACT(
ScanSolver)
1070 delete [] m_pKernel;
1092 assert(resolution != 0.0);
1095 kt_int32u borderSize = GetHalfKernelSize(smearDeviation, resolution) + 1;
1140 assert(m_pKernel !=
NULL);
1142 int gridIndex = GridIndex(rGridPoint);
1148 kt_int32s halfKernel = m_KernelSize / 2;
1151 for (
kt_int32s j = -halfKernel; j <= halfKernel; j++)
1155 kt_int32s kernelConstant = (halfKernel) + m_KernelSize * (j + halfKernel);
1160 for (
kt_int32s i = -halfKernel; i <= halfKernel; i++)
1162 kt_int32s kernelArrayIndex = i + kernelConstant;
1164 kt_int8u kernelValue = m_pKernel[kernelArrayIndex];
1165 if (kernelValue > pGridAdr[i])
1168 pGridAdr[i] = kernelValue;
1185 :
Grid<
kt_int8u>(width + borderSize * 2, height + borderSize * 2)
1186 , m_SmearDeviation(smearDeviation)
1189 GetCoordinateConverter()->SetScale(1.0 / resolution);
1205 assert(resolution != 0.0);
1206 assert(m_SmearDeviation != 0.0);
1210 const kt_double MIN_SMEAR_DISTANCE_DEVIATION = 0.5 * resolution;
1211 const kt_double MAX_SMEAR_DISTANCE_DEVIATION = 10 * resolution;
1214 if (!
math::InRange(m_SmearDeviation, MIN_SMEAR_DISTANCE_DEVIATION, MAX_SMEAR_DISTANCE_DEVIATION))
1216 std::stringstream error;
1217 error <<
"Mapper Error: Smear deviation too small: Must be between " 1218 << MIN_SMEAR_DISTANCE_DEVIATION
1220 << MAX_SMEAR_DISTANCE_DEVIATION;
1221 throw std::runtime_error(error.str());
1227 m_KernelSize = 2 * GetHalfKernelSize(m_SmearDeviation, resolution) + 1;
1230 m_pKernel =
new kt_int8u[m_KernelSize * m_KernelSize];
1231 if (m_pKernel ==
NULL)
1233 throw std::runtime_error(
"Unable to allocate memory for kernel!");
1237 kt_int32s halfKernel = m_KernelSize / 2;
1238 for (
kt_int32s i = -halfKernel; i <= halfKernel; i++)
1240 for (
kt_int32s j = -halfKernel; j <= halfKernel; j++)
1243 kt_double distanceFromMean = _hypot(i * resolution, j * resolution);
1245 kt_double distanceFromMean =
hypot(i * resolution, j * resolution);
1247 kt_double z =
exp(-0.5 *
pow(distanceFromMean / m_SmearDeviation, 2));
1250 assert(
math::IsUpTo(kernelValue, static_cast<kt_int32u>(255)));
1252 int kernelArrayIndex = (i + halfKernel) + m_KernelSize * (j + halfKernel);
1253 m_pKernel[kernelArrayIndex] =
static_cast<kt_int8u>(kernelValue);
1267 assert(resolution != 0.0);
1290 friend class boost::serialization::access;
1291 template<
class Archive>
1295 ar & BOOST_SERIALIZATION_NVP(m_SmearDeviation);
1296 ar & BOOST_SERIALIZATION_NVP(m_KernelSize);
1297 if (Archive::is_loading::value)
1299 m_pKernel =
new kt_int8u[m_KernelSize * m_KernelSize];
1301 ar & boost::serialization::make_array<kt_int8u>(m_pKernel, m_KernelSize * m_KernelSize);
1302 ar & BOOST_SERIALIZATION_NVP(m_Roi);
1328 void operator() (
const kt_double& y)
const;
1349 template<
class T = LocalizedRangeScanVector>
1351 const T& rBaseScans,
1354 kt_bool doRefineMatch =
true);
1373 const Pose2& rSearchCenter,
1393 void ComputePositionalCovariance(
const Pose2& rBestPose,
1395 const Pose2& rSearchCenter,
1410 void ComputeAngularCovariance(
const Pose2& rBestPose,
1412 const Pose2& rSearchCenter,
1423 return m_pCorrelationGrid;
1464 : m_pMapper(pMapper)
1465 , m_pCorrelationGrid(
NULL)
1466 , m_pSearchSpaceProbs(
NULL)
1467 , m_pGridLookup(
NULL)
1468 , m_pPoseResponse(
NULL)
1469 , m_doPenalize(false)
1490 friend class boost::serialization::access;
1491 template<
class Archive>
1494 ar & BOOST_SERIALIZATION_NVP(m_pMapper);
1495 ar & BOOST_SERIALIZATION_NVP(m_pCorrelationGrid);
1496 ar & BOOST_SERIALIZATION_NVP(m_pSearchSpaceProbs);
1497 ar & BOOST_SERIALIZATION_NVP(m_pGridLookup);
1498 ar & BOOST_SERIALIZATION_NVP(m_xPoses);
1499 ar & BOOST_SERIALIZATION_NVP(m_yPoses);
1500 ar & BOOST_SERIALIZATION_NVP(m_rSearchCenter);
1501 ar & BOOST_SERIALIZATION_NVP(m_searchAngleResolution);
1502 ar & BOOST_SERIALIZATION_NVP(m_nAngles);
1503 ar & BOOST_SERIALIZATION_NVP(m_searchAngleResolution);;
1504 ar & BOOST_SERIALIZATION_NVP(m_doPenalize);
1513 static_cast<kt_int32u>(m_xPoses.size() * m_yPoses.size() * m_nAngles);
1518 m_pPoseResponse =
new std::pair<kt_double, Pose2>[poseResponseSize];
1519 ar & boost::serialization::make_array<std::pair<kt_double, Pose2>>(m_pPoseResponse,
1523 delete[] m_pPoseResponse;
1524 m_pPoseResponse =
nullptr;
1547 : m_RunningBufferMaximumSize(runningBufferMaximumSize)
1548 , m_RunningBufferMaximumDistance(runningBufferMaximumDistance)
1570 void RegisterSensor(
const Name& rSensorName);
1586 std::vector<Name> deviceNames;
1589 deviceNames.push_back(iter->first);
1618 void ClearLastScan(
const Name& name);
1627 std::map<int, LocalizedRangeScan*>::iterator it = m_Scans.find(
id);
1628 if (it != m_Scans.end())
1634 std::cout <<
"GetScan: id " <<
id <<
1635 " does not exist in m_scans, cannot retrieve it." << std::endl;
1675 void ClearRunningScans(
const Name& rSensorName);
1680 kt_int32u GetRunningScanBufferSize(
const Name& rSensorName);
1686 void SetRunningScanBufferSize(
kt_int32u rScanBufferSize);
1692 void SetRunningScanBufferMaximumDistance(
kt_double rScanBufferMaxDistance);
1722 if (m_ScanManagers.find(rSensorName) != m_ScanManagers.end())
1724 return m_ScanManagers[rSensorName];
1730 friend class boost::serialization::access;
1731 template<
class Archive>
1734 std::cout <<
"MapperSensorManager <- m_ScanManagers; ";
1735 ar & BOOST_SERIALIZATION_NVP(m_ScanManagers);
1736 ar & BOOST_SERIALIZATION_NVP(m_RunningBufferMaximumSize);
1737 ar & BOOST_SERIALIZATION_NVP(m_RunningBufferMaximumDistance);
1738 ar & BOOST_SERIALIZATION_NVP(m_NextScanId);
1739 std::cout <<
"MapperSensorManager <- m_Scans\n";
1740 ar & BOOST_SERIALIZATION_NVP(m_Scans);
1942 Mapper(
const std::string& rName);
1954 void Initialize(
kt_double rangeThreshold);
1960 void SaveToFile(
const std::string& filename);
1966 void LoadFromFile(
const std::string& filename);
1972 virtual void Reset();
1999 void ClearLocalizationBuffer();
2043 virtual ScanMatcher* GetSequentialScanMatcher()
const;
2057 return m_pMapperSensorManager;
2067 return m_pGraph->TryCloseLoop(pScan, rSensorName);
2072 m_pGraph->CorrectPoses();
2076 void InitializeParameters();
2095 void FireInfo(
const std::string& rInfo)
const;
2101 void FireDebug(
const std::string& rInfo)
const;
2107 void FireLoopClosureCheck(
const std::string& rInfo)
const;
2113 void FireBeginLoopClosure(
const std::string& rInfo)
const;
2119 void FireEndLoopClosure(
const std::string& rInfo)
const;
2341 friend class boost::serialization::access;
2342 template<
class Archive>
2345 std::cout <<
"Mapper <- Module\n";
2346 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Module);
2347 ar & BOOST_SERIALIZATION_NVP(m_Initialized);
2348 std::cout <<
"Mapper <- m_pSequentialScanMatcher\n";
2349 ar & BOOST_SERIALIZATION_NVP(m_pSequentialScanMatcher);
2350 std::cout <<
"Mapper <- m_pGraph\n";
2351 ar & BOOST_SERIALIZATION_NVP(m_pGraph);
2352 std::cout <<
"Mapper <- m_pMapperSensorManager\n";
2353 ar & BOOST_SERIALIZATION_NVP(m_pMapperSensorManager);
2354 std::cout <<
"Mapper <- m_Listeners\n";
2355 ar & BOOST_SERIALIZATION_NVP(m_Listeners);
2356 ar & BOOST_SERIALIZATION_NVP(m_pUseScanMatching);
2357 ar & BOOST_SERIALIZATION_NVP(m_pUseScanBarycenter);
2358 ar & BOOST_SERIALIZATION_NVP(m_pMinimumTimeInterval);
2359 ar & BOOST_SERIALIZATION_NVP(m_pMinimumTravelDistance);
2360 ar & BOOST_SERIALIZATION_NVP(m_pMinimumTravelHeading);
2361 ar & BOOST_SERIALIZATION_NVP(m_pScanBufferSize);
2362 ar & BOOST_SERIALIZATION_NVP(m_pScanBufferMaximumScanDistance);
2363 ar & BOOST_SERIALIZATION_NVP(m_pLinkMatchMinimumResponseFine);
2364 ar & BOOST_SERIALIZATION_NVP(m_pLinkScanMaximumDistance);
2365 ar & BOOST_SERIALIZATION_NVP(m_pDoLoopClosing);
2366 ar & BOOST_SERIALIZATION_NVP(m_pLoopSearchMaximumDistance);
2367 ar & BOOST_SERIALIZATION_NVP(m_pLoopMatchMinimumChainSize);
2368 ar & BOOST_SERIALIZATION_NVP(m_pLoopMatchMaximumVarianceCoarse);
2369 ar & BOOST_SERIALIZATION_NVP(m_pLoopMatchMinimumResponseCoarse);
2370 ar & BOOST_SERIALIZATION_NVP(m_pLoopMatchMinimumResponseFine);
2371 ar & BOOST_SERIALIZATION_NVP(m_pCorrelationSearchSpaceDimension);
2372 ar & BOOST_SERIALIZATION_NVP(m_pCorrelationSearchSpaceResolution);
2373 ar & BOOST_SERIALIZATION_NVP(m_pCorrelationSearchSpaceSmearDeviation);
2374 ar & BOOST_SERIALIZATION_NVP(m_pLoopSearchSpaceDimension);
2375 ar & BOOST_SERIALIZATION_NVP(m_pLoopSearchSpaceResolution);
2376 ar & BOOST_SERIALIZATION_NVP(m_pLoopSearchSpaceSmearDeviation);
2377 ar & BOOST_SERIALIZATION_NVP(m_pDistanceVariancePenalty);
2378 ar & BOOST_SERIALIZATION_NVP(m_pAngleVariancePenalty);
2379 ar & BOOST_SERIALIZATION_NVP(m_pFineSearchAngleOffset);
2380 ar & BOOST_SERIALIZATION_NVP(m_pCoarseSearchAngleOffset);
2381 ar & BOOST_SERIALIZATION_NVP(m_pCoarseAngleResolution);
2382 ar & BOOST_SERIALIZATION_NVP(m_pMinimumAnglePenalty);
2383 ar & BOOST_SERIALIZATION_NVP(m_pMinimumDistancePenalty);
2384 ar & BOOST_SERIALIZATION_NVP(m_pUseResponseExpansion);
2385 std::cout <<
"**Finished serializing Mapper**\n";
2392 bool getParamUseScanMatching();
2393 bool getParamUseScanBarycenter();
2394 double getParamMinimumTimeInterval();
2395 double getParamMinimumTravelDistance();
2396 double getParamMinimumTravelHeading();
2397 int getParamScanBufferSize();
2398 double getParamScanBufferMaximumScanDistance();
2399 double getParamLinkMatchMinimumResponseFine();
2400 double getParamLinkScanMaximumDistance();
2401 double getParamLoopSearchMaximumDistance();
2402 bool getParamDoLoopClosing();
2403 int getParamLoopMatchMinimumChainSize();
2404 double getParamLoopMatchMaximumVarianceCoarse();
2405 double getParamLoopMatchMinimumResponseCoarse();
2406 double getParamLoopMatchMinimumResponseFine();
2409 double getParamCorrelationSearchSpaceDimension();
2410 double getParamCorrelationSearchSpaceResolution();
2411 double getParamCorrelationSearchSpaceSmearDeviation();
2414 double getParamLoopSearchSpaceDimension();
2415 double getParamLoopSearchSpaceResolution();
2416 double getParamLoopSearchSpaceSmearDeviation();
2419 double getParamDistanceVariancePenalty();
2420 double getParamAngleVariancePenalty();
2421 double getParamFineSearchAngleOffset();
2422 double getParamCoarseSearchAngleOffset();
2423 double getParamCoarseAngleResolution();
2424 double getParamMinimumAnglePenalty();
2425 double getParamMinimumDistancePenalty();
2426 bool getParamUseResponseExpansion();
2430 void setParamUseScanMatching(
bool b);
2431 void setParamUseScanBarycenter(
bool b);
2432 void setParamMinimumTimeInterval(
double d);
2433 void setParamMinimumTravelDistance(
double d);
2434 void setParamMinimumTravelHeading(
double d);
2435 void setParamScanBufferSize(
int i);
2436 void setParamScanBufferMaximumScanDistance(
double d);
2437 void setParamLinkMatchMinimumResponseFine(
double d);
2438 void setParamLinkScanMaximumDistance(
double d);
2439 void setParamLoopSearchMaximumDistance(
double d);
2440 void setParamDoLoopClosing(
bool b);
2441 void setParamLoopMatchMinimumChainSize(
int i);
2442 void setParamLoopMatchMaximumVarianceCoarse(
double d);
2443 void setParamLoopMatchMinimumResponseCoarse(
double d);
2444 void setParamLoopMatchMinimumResponseFine(
double d);
2447 void setParamCorrelationSearchSpaceDimension(
double d);
2448 void setParamCorrelationSearchSpaceResolution(
double d);
2449 void setParamCorrelationSearchSpaceSmearDeviation(
double d);
2452 void setParamLoopSearchSpaceDimension(
double d);
2453 void setParamLoopSearchSpaceResolution(
double d);
2454 void setParamLoopSearchSpaceSmearDeviation(
double d);
2457 void setParamDistanceVariancePenalty(
double d);
2458 void setParamAngleVariancePenalty(
double d);
2459 void setParamFineSearchAngleOffset(
double d);
2460 void setParamCoarseSearchAngleOffset(
double d);
2461 void setParamCoarseAngleResolution(
double d);
2462 void setParamMinimumAnglePenalty(
double d);
2463 void setParamMinimumDistancePenalty(
double d);
2464 void setParamUseResponseExpansion(
bool b);
2466 BOOST_SERIALIZATION_ASSUME_ABSTRACT(
Mapper)
2469 #endif // karto_sdk_MAPPER_H CorrelationGrid(kt_int32u width, kt_int32u height, kt_int32u borderSize, kt_double resolution, kt_double smearDeviation)
std::map< int, LocalizedRangeScan * > m_Scans
virtual void GetNodeOrientation(const int &unique_id, double &pose)
std::map< Name, ScanManager * > ScanManagerMap
ScanMatcher * m_pSequentialScanMatcher
void serialize(Archive &ar, const unsigned int version)
GraphTraversal(Graph< T > *pGraph)
virtual ~CorrelationGrid()
Parameter< kt_double > * m_pLinkScanMaximumDistance
virtual void Info(const std::string &)
kt_double Round(kt_double value)
kt_bool TryCloseLoop(LocalizedRangeScan *pScan, const Name &rSensorName)
virtual void AddNode(Vertex< LocalizedRangeScan > *)
void serialize(Archive &ar, const unsigned int version)
Parameter< kt_double > * m_pCoarseAngleResolution
kt_int32s GetStateId() const
Parameter< kt_double > * m_pLoopMatchMaximumVarianceCoarse
void serialize(Archive &ar, const unsigned int version)
std::vector< Vector2< kt_double > > PointVectorDouble
Parameter< kt_double > * m_pMinimumTravelHeading
virtual void EndLoopClosure(const std::string &)
#define forEachAs(listtype, list, iter)
void AddEdge(Edge< T > *pEdge)
Parameter< kt_double > * m_pMinimumAnglePenalty
Matrix3 Transpose() const
std::vector< MapperListener * > m_Listeners
virtual void RemoveNode(kt_int32s)
void serialize(Archive &ar, const unsigned int version)
void serialize(Archive &ar, const unsigned int version)
Rectangle2< kt_int32s > m_Roi
virtual void RemoveConstraint(kt_int32s, kt_int32s)
virtual ~GraphTraversal()
std::map< Name, std::map< int, Vertex< T > * > > VertexMap
std::vector< Name > GetSensorNames()
Vertex< LocalizedRangeScan > * vertex
virtual void LoopClosureCheck(const std::string &)
Parameter< kt_double > * m_pLoopSearchSpaceSmearDeviation
void serialize(Archive &ar, const unsigned int version)
void Update(const Pose2 &rPose1, const Pose2 &rPose2, const Matrix3 &rCovariance)
const std::vector< Edge< T > * > & GetEdges() const
const Matrix3 & GetCovariance()
virtual std::unordered_map< int, Eigen::Vector3d > * getGraph()
Parameter< kt_int32u > * m_pLoopMatchMinimumChainSize
INLINE Rall1d< T, V, S > hypot(const Rall1d< T, V, S > &y, const Rall1d< T, V, S > &x)
Parameter< kt_double > * m_pCorrelationSearchSpaceResolution
virtual kt_int32s GridIndex(const Vector2< kt_int32s > &rGrid, kt_bool boundaryCheck=true) const
Parameter< kt_double > * m_pMinimumDistancePenalty
void AddVertex(const Name &rName, Vertex< T > *pVertex)
virtual void AddConstraint(Edge< LocalizedRangeScan > *)
Parameter< kt_double > * m_pDistanceVariancePenalty
MapperSensorManager * GetMapperSensorManager() const
Parameter< kt_bool > * m_pUseScanMatching
Vertex< T > * GetTarget() const
#define forEach(listtype, list)
std::vector< kt_double > m_xPoses
void serialize(Archive &ar, const unsigned int version)
kt_double m_SmearDeviation
virtual void ModifyNode(const int &unique_id, Eigen::Vector3d pose)
const double GetScore() const
void SetROI(const Rectangle2< kt_int32s > &roi)
MapperSensorManager * m_pMapperSensorManager
kt_int32u m_RunningBufferMaximumSize
GraphTraversal< LocalizedRangeScan > * m_pTraversal
Parameter< kt_bool > * m_pDoLoopClosing
friend class boost::serialization::access
Parameter< kt_double > * m_pFineSearchAngleOffset
Parameter< kt_double > * m_pScanBufferMaximumScanDistance
ScanSolver * m_pScanOptimizer
LocalizedRangeScan * scan
virtual void Debug(const std::string &)
Parameter< kt_double > * m_pLoopSearchSpaceDimension
void serialize(Archive &ar, const unsigned int version)
void RemoveEdge(const int &idx)
virtual kt_int32s GridIndex(const Vector2< kt_int32s > &rGrid, kt_bool boundaryCheck=true) const
void serialize(Archive &ar, const unsigned int version)
const Name & GetSensorName() const
void SmearPoint(const Vector2< kt_int32s > &rGridPoint)
CorrelationGrid * GetCorrelationGrid() const
void serialize(Archive &ar, const unsigned int version)
Parameter< kt_double > * m_pMinimumTravelDistance
std::vector< Edge< T > * > m_Edges
void serialize(Archive &ar, const unsigned int version)
void SetScore(const double score)
void serialize(Archive &ar, const unsigned int version)
void AddEdge(Edge< T > *pEdge)
void SetUseScanMatching(kt_bool val)
std::vector< Pose2 > Pose2Vector
ScanMatcher * GetLoopScanMatcher() const
void serialize(Archive &ar, const unsigned int version)
void RemoveVertex(const Name &rName, const int &idx)
virtual ~MapperSensorManager()
Vertex< T > * GetSource() const
ScanMatcher(Mapper *pMapper)
kt_bool InRange(const T &value, const T &a, const T &b)
kt_double m_RunningBufferMaximumDistance
#define const_forEach(listtype, list)
LocalizationScanVertices m_LocalizationScanVertices
virtual void BeginLoopClosure(const std::string &)
INLINE Rall1d< T, V, S > exp(const Rall1d< T, V, S > &arg)
void serialize(Archive &ar, const unsigned int version)
std::vector< Vertex< T > * > GetAdjacentVertices() const
GridIndexLookup< kt_int8u > * m_pGridLookup
INLINE Rall1d< T, V, S > pow(const Rall1d< T, V, S > &arg, double m)
void serialize(Archive &ar, const unsigned int version)
static CorrelationGrid * CreateGrid(kt_int32s width, kt_int32s height, kt_double resolution, kt_double smearDeviation)
CorrelationGrid * m_pCorrelationGrid
Parameter< kt_double > * m_pLoopSearchSpaceResolution
void RemoveEdge(const int &idx)
Parameter< kt_double > * m_pCorrelationSearchSpaceDimension
MapperSensorManager(kt_int32u runningBufferMaximumSize, kt_double runningBufferMaximumDistance)
const std::vector< Edge< T > * > & GetEdges() const
LocalizedRangeScan * GetScan(kt_int32s id)
std::vector< std::pair< kt_int32s, Pose2 > > IdPoseVector
Parameter< kt_double > * m_pLinkMatchMinimumResponseFine
Vertex< LocalizedRangeScan > * GetVertex(LocalizedRangeScan *pScan)
void serialize(Archive &ar, const unsigned int version)
std::pair< kt_double, Pose2 > * m_pPoseResponse
ScanMatcher * m_pLoopScanMatcher
void SetLabel(EdgeLabel *pLabel)
ScanManagerMap m_ScanManagers
Grid< kt_double > * m_pSearchSpaceProbs
std::vector< kt_double > m_yPoses
static kt_int32s GetHalfKernelSize(kt_double smearDeviation, kt_double resolution)
Edge(Vertex< T > *pSource, Vertex< T > *pTarget)
Parameter< kt_double > * m_pCorrelationSearchSpaceSmearDeviation
Parameter< kt_double > * m_pLoopMatchMinimumResponseCoarse
const Rectangle2< kt_int32s > & GetROI() const
LinkInfo(const Pose2 &rPose1, const Pose2 &rPose2, const Matrix3 &rCovariance)
const VertexMap & GetVertices() const
Parameter< kt_double > * m_pCoarseSearchAngleOffset
Parameter< kt_double > * m_pLoopSearchMaximumDistance
Parameter< kt_double > * m_pAngleVariancePenalty
virtual void CalculateKernel()
Parameter< kt_double > * m_pMinimumTimeInterval
Parameter< kt_bool > * m_pUseResponseExpansion
Parameter< kt_int32u > * m_pScanBufferSize
kt_bool IsUpTo(const T &value, const T &maximum)
kt_double m_searchAngleOffset
std::queue< LocalizationScanVertex > LocalizationScanVertices
std::vector< Edge< T > * > m_Edges
ScanManager * GetScanManager(LocalizedRangeScan *pScan)
kt_double m_searchAngleResolution
std::vector< LocalizedRangeScan * > LocalizedRangeScanVector
ScanManager * GetScanManager(const Name &rSensorName)
Parameter< kt_bool > * m_pUseScanBarycenter
std::map< int, LocalizedRangeScan * > LocalizedRangeScanMap
const Pose2 & GetPoseDifference()
Parameter< kt_double > * m_pLoopMatchMinimumResponseFine
kt_double GetHeading() const
void FromAxisAngle(kt_double x, kt_double y, kt_double z, const kt_double radians)