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();
Interface for implementing node registration classes.
CNodeRegistrationDecider()
Default class constructor.
#define MRPT_LOG_DEBUG_STREAM(__CONTENTS)
Use: MRPT_LOG_DEBUG_STREAM("Var=" << value << " foo=" << foo_var);
GLsizei const GLchar ** string
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
#define ASSERTDEBMSG_(f, __ERROR_MSG)
#define ASSERTDEB_(f)
Defines an assertion mechanism - only when compiled in debug.
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
uint64_t TNodeID
A generic numeric type for unique IDs of nodes or entities.
#define MRPT_LOG_WARN(_STRING)
typename GRAPH_t ::global_pose_t global_pose_t
typename GRAPH_t ::constraint_t constraint_t
type of graph constraints