Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef CLOOPCLOSERERD_MR_IMPL_H
00011 #define CLOOPCLOSERERD_MR_IMPL_H
00012
00013 namespace mrpt { namespace graphslam { namespace deciders {
00014
00015
00016 template<class GRAPH_T>
00017 CLoopCloserERD_MR<GRAPH_T>::CLoopCloserERD_MR() {
00018
00019
00020
00021
00022 this->m_override_registered_nodes_check = true;
00023
00024 this->initializeLoggers("CLoopCloserERD_MR");
00025 }
00026
00027 template<class GRAPH_T>
00028 void CLoopCloserERD_MR<GRAPH_T>::addBatchOfNodeIDsAndScans(
00029 const std::map<
00030 mrpt::utils::TNodeID,
00031 mrpt::obs::CObservation2DRangeScanPtr>& nodeIDs_to_scans2D) {
00032 mr_parent_t::addBatchOfNodeIDsAndScans(nodeIDs_to_scans2D);
00033
00034 this->updateMapPartitions( true,
00035 false);
00036
00037 }
00038
00039 template<class GRAPH_T>
00040 void CLoopCloserERD_MR<GRAPH_T>::addScanMatchingEdges(
00041 mrpt::utils::TNodeID curr_nodeID) {
00042 MRPT_START;
00043
00044
00045
00046 bool is_own = this->m_engine->isOwnNodeID(curr_nodeID);
00047 if (is_own) {
00048 lc_parent_t::addScanMatchingEdges(curr_nodeID);
00049 }
00050
00051 MRPT_END;
00052 }
00053
00054 template<class GRAPH_T>
00055 void CLoopCloserERD_MR<GRAPH_T>::fetchNodeIDsForScanMatching(
00056 const mrpt::utils::TNodeID& curr_nodeID,
00057 std::set<mrpt::utils::TNodeID>* nodes_set) {
00058 ASSERT_(nodes_set);
00059
00060 size_t fetched_nodeIDs = 0;
00061 for (int nodeID_i = static_cast<int>(curr_nodeID)-1;
00062 ((fetched_nodeIDs <= this->m_prev_nodes_for_ICP) &&
00063 (nodeID_i >= 0));
00064 --nodeID_i) {
00065 bool is_own = this->m_engine->isOwnNodeID(nodeID_i);
00066 if (is_own) {
00067 nodes_set->insert(nodeID_i);
00068 fetched_nodeIDs++;
00069 }
00070 }
00071 }
00072
00073
00074 template<class GRAPH_T>
00075 CLoopCloserERD_MR<GRAPH_T>::~CLoopCloserERD_MR() {
00076
00077 }
00078
00079
00080 template<class GRAPH_T>
00081 bool CLoopCloserERD_MR<GRAPH_T>::updateState(
00082 mrpt::obs::CActionCollectionPtr action,
00083 mrpt::obs::CSensoryFramePtr observations,
00084 mrpt::obs::CObservationPtr observation ) {
00085
00086 bool success = lc_parent_t::updateState(action, observations, observation);
00087
00088
00089
00090
00091 return success;
00092 }
00093
00094
00095 } } }
00096
00097 #endif