1 #ifndef CINCREMENTALNODEREGISTRATIONDECIDER_IMPL_H_UQKZGLEM 2 #define CINCREMENTALNODEREGISTRATIONDECIDER_IMPL_H_UQKZGLEM 10 template <
class GRAPH_T>
11 CIncrementalNodeRegistrationDecider<
16 template <
class GRAPH_T>
18 GRAPH_T>::~CIncrementalNodeRegistrationDecider()
22 template <
class GRAPH_T>
29 pose_t last_pose_inserted =
31 ? this->m_graph->nodes.at(this->m_prev_registered_nodeID)
35 bool registered =
false;
37 if (this->checkRegistrationConditionPose(
38 last_pose_inserted, this->getCurrentRobotPosEstimation()))
40 registered = this->registerNewNodeAtEnd();
47 template <
class GRAPH_T>
64 template <
class GRAPH_T>
71 std::cout <<
"In checkRegistrationConditionPose:\np1: " << p1.
asString()
72 <<
"\np2: " << p1.
asString() << std::endl;
77 params.registration_max_angle) ||
79 params.registration_max_angle) ||
88 template <
class GRAPH_T>
94 parent_t::loadParams(source_fname);
96 params.loadFromConfigFileName(
97 source_fname,
"NodeRegistrationDeciderParameters");
102 template <
class GRAPH_T>
106 parent_t::printParams();
112 template <
class GRAPH_T>
119 *report_str +=
params.getAsString();
120 *report_str += this->report_sep;
128 template <
class GRAPH_T>
133 template <
class GRAPH_T>
138 template <
class GRAPH_T>
143 out.
printf(
"%s", this->getAsString().c_str());
147 template <
class GRAPH_T>
155 registration_max_distance =
source.read_double(
156 section,
"registration_max_distance", 0.5 ,
false);
157 registration_max_angle =
source.read_double(
158 section,
"registration_max_angle", 15 ,
false);
159 registration_max_angle =
DEG2RAD(registration_max_angle);
164 template <
class GRAPH_T>
172 double max_angle_deg =
RAD2DEG(registration_max_angle);
176 "------------------[ Fixed Intervals Incremental Node Registration " 177 "]------------------\n";
179 "Max distance for registration = %.2f m\n", registration_max_distance);
181 "Max angle for registration = %.2f deg\n", max_angle_deg);
186 template <
class GRAPH_T>
193 this->getAsString(&str);
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
virtual void printParams() const
Print the problem parameters - relevant to the decider/optimizer to the screen in a unified/compact w...
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
double distanceTo(const CPoseOrPoint< OTHERCLASS > &b) const
Returns the Euclidean distance to another pose/point:
void dumpToTextStream(mrpt::utils::CStream &out) const
This method should clearly display all the contents of the structure in textual form, sending it to a CStream.
double pitch() const
Get the PITCH angle (in radians)
virtual void getDescriptiveReport(std::string *report_str) const
Fill the provided string with a detailed report of the decider/optimizer state.
double yaw() const
Get the YAW angle (in radians)
This class allows loading and storing values and vectors of different types from a configuration text...
virtual bool checkRegistrationConditionPose(const mrpt::poses::CPose2D &p1, const mrpt::poses::CPose2D &p2) const
GRAPH_T::constraint_t::type_value pose_t
type of underlying poses (2D/3D).
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
This base provides a set of functions for maths stuff.
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string §ion)
This method load the options from a ".ini"-like file or memory-stored string list.
GLsizei const GLchar ** string
T wrapToPi(T a)
Modifies the given angle to translate it into the ]-pi,pi] range.
double roll() const
Get the ROLL angle (in radians)
void asString(std::string &s) const
Returns a human-readable textual representation of the object (eg: "[x y z yaw pitch roll]"...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
const double & phi() const
Get the phi angle of the 2D pose (in radians)
Incremental Node registration decider.
GLsizei GLsizei GLchar * source
virtual bool checkRegistrationCondition()
If estimated position surpasses the registration max values since the previous registered node...
GLenum const GLfloat * params
std::string getAsString() const
virtual int printf(const char *fmt,...) MRPT_printf_format_check(2
Writes a string to the stream in a textual form.
virtual void loadParams(const std::string &source_fname)
Load the necessary for the decider/optimizer configuration parameters.