9 #ifndef CNODEREGISTRATIONDECIDER_IMPL_H 10 #define CNODEREGISTRATIONDECIDER_IMPL_H 20 template <
class GRAPH_T>
26 m_init_inf_mat.unit();
27 m_init_inf_mat *= 10000;
28 resetPDF(&this->m_since_prev_node_PDF);
31 template <
class GRAPH_T>
36 template <
class GRAPH_T>
43 parent_t::getDescriptiveReport(report_str);
45 ss <<
"Node Registration Decider Strategy [NRD]: " << endl;
46 *report_str += ss.str();
51 template <
class GRAPH_T>
57 template <
class GRAPH_T>
59 const typename GRAPH_T::constraint_t& constraint)
70 global_pose_t tmp_pose = this->getCurrentRobotPosEstimation();
71 this->addNodeAnnotsToPose(&tmp_pose);
74 std::pair<typename GRAPH_T::global_poses_t::const_iterator, bool>
res =
75 this->m_graph->nodes.insert(
76 make_pair(this->m_graph->root, tmp_pose));
79 "nodeID \"%lu\" with pose \"%s\" seems to be " 80 "already registered.",
81 this->m_graph->root, tmp_pose.asString().c_str()));
83 this->m_prev_registered_nodeID = this->m_graph->root;
87 TNodeID from = this->m_prev_registered_nodeID;
90 TNodeID to = this->m_graph->nodeCount();
94 global_pose_t tmp_pose = this->getCurrentRobotPosEstimation();
95 this->addNodeAnnotsToPose(&tmp_pose);
98 std::pair<typename GRAPH_T::global_poses_t::const_iterator, bool>
res =
99 this->m_graph->nodes.insert(make_pair(to, tmp_pose));
102 "nodeID \"%lu\" with pose \"%s\" seems to be " 103 "already registered.",
104 to, tmp_pose.asString().c_str()));
105 this->m_graph->insertEdgeAtEnd(from, to, constraint);
108 m_prev_registered_nodeID = to;
111 "Registered new node:" << endl
112 <<
"\t" << from <<
" => " << to << endl
114 << constraint.getMeanVal().asString());
120 template <
class GRAPH_T>
123 bool res = this->registerNewNodeAtEnd(this->m_since_prev_node_PDF);
126 this->resetPDF(&m_since_prev_node_PDF);
131 template <
class GRAPH_T>
139 c->cov_inv = this->m_init_inf_mat;
144 template <
class GRAPH_T>
150 template <
class GRAPH_T>
151 typename GRAPH_T::global_pose_t
158 pose_out = this->m_graph->nodes.at(this->m_prev_registered_nodeID);
161 pose_out += m_since_prev_node_PDF.getMeanVal();
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Interface for implementing node registration classes.
CNodeRegistrationDecider()
Default class constructor.
GRAPH_t ::constraint_t constraint_t
type of graph constraints
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
#define MRPT_LOG_WARN_STREAM(__CONTENTS)
uint64_t TNodeID
The type for node IDs in graphs of different types.
GLsizei const GLchar ** string
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
GRAPH_t ::global_pose_t global_pose_t
#define MRPT_LOG_DEBUG_STREAM(__CONTENTS)
#define ASSERTMSG_(f, __ERROR_MSG)