CLoopCloserERD_MR_impl.h
Go to the documentation of this file.
00001 /* +---------------------------------------------------------------------------+
00002    |                     Mobile Robot Programming Toolkit (MRPT)               |
00003    |                          http://www.mrpt.org/                             |
00004    |                                                                           |
00005    | Copyright (c) 2005-2016, Individual contributors, see AUTHORS file        |
00006    | See: http://www.mrpt.org/Authors - All rights reserved.                   |
00007    | Released under BSD License. See details in http://www.mrpt.org/License    |
00008    +---------------------------------------------------------------------------+ */
00009 
00010 #pragma once
00011 
00012 namespace mrpt { namespace graphslam { namespace deciders {
00013 
00014 // Ctors, Dtors
00015 template<class GRAPH_T>
00016 CLoopCloserERD_MR<GRAPH_T>::CLoopCloserERD_MR() {
00017         // CLoopCloser Ctor is automatically called.
00018 
00019         // since this is for MR-SLAM, we do expect more than one node registered
00020         // between successive calls
00021         this->m_override_registered_nodes_check = true;
00022 
00023         this->initializeLoggers("CLoopCloserERD_MR");
00024 }
00025 
00026 template<class GRAPH_T>
00027 void CLoopCloserERD_MR<GRAPH_T>::addBatchOfNodeIDsAndScans(
00028                 const std::map<
00029                         TNodeID,
00030                         mrpt::obs::CObservation2DRangeScan::Ptr>& nodeIDs_to_scans2D) {
00031         mr_parent_t::addBatchOfNodeIDsAndScans(nodeIDs_to_scans2D);
00032 
00033         this->updateMapPartitions(/*full update=*/ true,
00034                         /* is_first_time_node_reg = */ false);
00035 
00036 } // end of addBatchOfNodeIDsAndScans
00037 
00038 template<class GRAPH_T>
00039 void CLoopCloserERD_MR<GRAPH_T>::addScanMatchingEdges(
00040                 TNodeID curr_nodeID) {
00041         MRPT_START;
00042 
00043         // Do scan-matching only if I have initially registered curr_nodeID in the
00044         // graph.
00045         bool is_own = this->m_engine->isOwnNodeID(curr_nodeID);
00046         if (is_own) {
00047                 lc_parent_t::addScanMatchingEdges(curr_nodeID);
00048         }
00049 
00050         MRPT_END;
00051 }
00052 
00053 template<class GRAPH_T>
00054 void CLoopCloserERD_MR<GRAPH_T>::fetchNodeIDsForScanMatching(
00055                 const TNodeID& curr_nodeID,
00056                 std::set<TNodeID>* nodes_set) {
00057         ASSERT_(nodes_set);
00058 
00059         size_t fetched_nodeIDs = 0;
00060         for (int nodeID_i = static_cast<int>(curr_nodeID)-1;
00061                         (fetched_nodeIDs <= static_cast<size_t>(this->m_laser_params.prev_nodes_for_ICP) &&
00062                          nodeID_i >= 0);
00063                         --nodeID_i) {
00064                 if (this->m_engine->isOwnNodeID(nodeID_i)) {
00065                         nodes_set->insert(nodeID_i);
00066                         fetched_nodeIDs++;
00067                 }
00068         }
00069 }
00070 
00071 // Member methods implementations
00072 template<class GRAPH_T>
00073 bool CLoopCloserERD_MR<GRAPH_T>::updateState(
00074                 mrpt::obs::CActionCollection::Ptr action,
00075                 mrpt::obs::CSensoryFrame::Ptr observations,
00076                 mrpt::obs::CObservation::Ptr observation ) {
00077 
00078         bool success = lc_parent_t::updateState(action, observations, observation);
00079 
00080         // search for possible edges with the other agent's graph.
00081         // TODO
00082 
00083         return success;
00084 }
00085 
00086 
00087 } } } // end of namespaces
00088 


mrpt_graphslam_2d
Author(s): Nikos Koukis
autogenerated on Thu Jun 6 2019 21:40:26