1 #ifndef CINCREMENTALNODEREGISTRATIONDECIDER_IMPL_H_UQKZGLEM 2 #define CINCREMENTALNODEREGISTRATIONDECIDER_IMPL_H_UQKZGLEM 6 template <
class GRAPH_T>
7 CIncrementalNodeRegistrationDecider<
12 template <
class GRAPH_T>
14 GRAPH_T>::~CIncrementalNodeRegistrationDecider()
18 template <
class GRAPH_T>
25 pose_t last_pose_inserted =
27 ? this->m_graph->nodes.at(this->m_prev_registered_nodeID)
31 bool registered =
false;
33 if (this->checkRegistrationConditionPose(
34 last_pose_inserted, this->getCurrentRobotPosEstimation()))
36 registered = this->registerNewNodeAtEnd();
43 template <
class GRAPH_T>
60 template <
class GRAPH_T>
67 std::cout <<
"In checkRegistrationConditionPose:\np1: " << p1.
asString()
68 <<
"\np2: " << p1.
asString() << std::endl;
73 params.registration_max_angle) ||
75 params.registration_max_angle) ||
84 template <
class GRAPH_T>
89 parent_t::loadParams(source_fname);
91 params.loadFromConfigFileName(
92 source_fname,
"NodeRegistrationDeciderParameters");
97 template <
class GRAPH_T>
101 parent_t::printParams();
107 template <
class GRAPH_T>
114 *report_str +=
params.getAsString();
115 *report_str += this->report_sep;
123 template <
class GRAPH_T>
128 template <
class GRAPH_T>
133 template <
class GRAPH_T>
135 std::ostream& out)
const 142 template <
class GRAPH_T>
149 registration_max_distance =
source.read_double(
150 section,
"registration_max_distance", 0.5 ,
false);
151 registration_max_angle =
source.read_double(
152 section,
"registration_max_angle", 15 ,
false);
153 registration_max_angle =
DEG2RAD(registration_max_angle);
158 template <
class GRAPH_T>
165 double max_angle_deg =
RAD2DEG(registration_max_angle);
169 "------------------[ Fixed Intervals Incremental Node Registration " 170 "]------------------\n";
172 "Max distance for registration = %.2f m\n", registration_max_distance);
174 "Max angle for registration = %.2f deg\n", max_angle_deg);
179 template <
class GRAPH_T>
186 this->getAsString(&str);
virtual void printParams() const
Print the problem parameters - relevant to the decider/optimizer to the screen in a unified/compact w...
double RAD2DEG(const double x)
Radians to degrees.
double distanceTo(const CPoseOrPoint< OTHERCLASS > &b) const
Returns the Euclidean distance to another pose/point:
double DEG2RAD(const double x)
Degrees to radians.
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)
virtual bool checkRegistrationConditionPose(const mrpt::poses::CPose2D &p1, const mrpt::poses::CPose2D &p2) const
This class allows loading and storing values and vectors of different types from a configuration text...
This base provides a set of functions for maths stuff.
void dumpToTextStream(std::ostream &out) const
This method should clearly display all the contents of the structure in textual form, sending it to a std::ostream.
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]"...
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
typename GRAPH_T::constraint_t::type_value pose_t
type of underlying poses (2D/3D).
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
const double & phi() const
Get the phi angle of the 2D pose (in radians)
Incremental Node registration decider.
GLsizei GLsizei GLchar * source
void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string §ion)
This method load the options from a ".ini"-like file or memory-stored string list.
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 void loadParams(const std::string &source_fname)
Load the necessary for the decider/optimizer configuration parameters.