14 template <
class GRAPH_T>
21 pose_t last_pose_inserted =
23 ? this->m_graph->nodes.at(this->m_prev_registered_nodeID)
27 bool registered =
false;
29 if (this->checkRegistrationConditionPose(
30 last_pose_inserted, this->getCurrentRobotPosEstimation()))
32 registered = this->registerNewNodeAtEnd();
39 template <
class GRAPH_T>
56 template <
class GRAPH_T>
63 std::cout <<
"In checkRegistrationConditionPose:\np1: " << p1.
asString()
64 <<
"\np2: " << p1.
asString() << std::endl;
69 params.registration_max_angle) ||
71 params.registration_max_angle) ||
80 template <
class GRAPH_T>
85 parent_t::loadParams(source_fname);
87 params.loadFromConfigFileName(
88 source_fname,
"NodeRegistrationDeciderParameters");
93 template <
class GRAPH_T>
97 parent_t::printParams();
103 template <
class GRAPH_T>
110 *report_str +=
params.getAsString();
111 *report_str += this->report_sep;
116 template <
class GRAPH_T>
118 std::ostream& out)
const 125 template <
class GRAPH_T>
132 registration_max_distance =
source.read_double(
133 section,
"registration_max_distance", 0.5 ,
false);
134 registration_max_angle =
source.read_double(
135 section,
"registration_max_angle", 15 ,
false);
136 registration_max_angle =
DEG2RAD(registration_max_angle);
141 template <
class GRAPH_T>
148 double max_angle_deg =
RAD2DEG(registration_max_angle);
152 "------------------[ Fixed Intervals Incremental Node Registration " 153 "]------------------\n";
155 "Max distance for registration = %.2f m\n", registration_max_distance);
157 "Max angle for registration = %.2f deg\n", max_angle_deg);
162 template <
class GRAPH_T>
169 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 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)
double distanceTo(const CPoseOrPoint< OTHERCLASS, DIM2 > &b) const
Returns the Euclidean distance to another pose/point:
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
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)
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.